Blob Blame History Raw
# This macro is needed at the start for building on EL6
%{?nodejs_find_provides_and_requires}

%global barename stringmap

Name:               nodejs-stringmap
Version:            0.2.2
Release:            1%{?dist}
Summary:            Fast and robust stringmap

Group:              Development/Libraries
License:            MIT
URL:                https://www.npmjs.org/package/stringmap
Source0:            http://registry.npmjs.org/%{barename}/-/%{barename}-%{version}.tgz
BuildArch:          noarch
%if 0%{?fedora} >= 19
ExclusiveArch:      %{nodejs_arches} noarch
%else
ExclusiveArch:      %{ix86} x86_64 %{arm} noarch
%endif

BuildRequires:      nodejs-packaging >= 6

%description
A fast and robust stringmap implementation that can hold any string keys,
including __proto__, with minimal overhead compared to a plain object. Works in
node and browsers.

The API is created to be as close to the ES6 Map API as possible. Prefer
sm.remove("key") for deleting a key. ES6 Map uses map.delete("key") instead and
for that reason sm['delete']("key") is available as a stringmap alias as well.
Never do sm.delete("key") unless you're certain to be in the land of ES5 or
later.


%prep
%setup -q -n package

# Remove bundled node_modules if there are any..
rm -rf node_modules/

%nodejs_fixdep --caret

%build
%nodejs_symlink_deps --build

%install
mkdir -p %{buildroot}%{nodejs_sitelib}/stringmap
cp -pr package.json examples.js stringmap.js \
    %{buildroot}%{nodejs_sitelib}/stringmap

%nodejs_symlink_deps



%files
%doc LICENSE README.md
%{nodejs_sitelib}/stringmap/

%changelog
* Tue Jul 22 2014 Ralph Bean <rbean@redhat.com> - 0.2.2-1
- Initial packaging for Fedora.