Blob Blame History Raw
%{?nodejs_find_provides_and_requires}

%global enable_tests 0

Name:       nodejs-node-stringprep
Version:    0.2.3
Release:    6%{?dist}
Summary:    ICU StringPrep profiles for Node.js
License:    MIT
Group:      System Environment/Libraries
URL:        https://github.com/astro/node-stringprep
Source0:    http://registry.npmjs.org/node-stringprep/-/node-stringprep-%{version}.tgz

Patch0:     %{name}-0.2.3-Fix-NanAssignPersistent-for-Nan-1.0.0.patch

%if 0%{?fedora} >= 19
ExclusiveArch: %{nodejs_arches}
%else
ExclusiveArch: %{ix86} x86_64 %{arm}
%endif

BuildRequires:  libicu-devel
BuildRequires:  nodejs-packaging
BuildRequires:  node-gyp
BuildRequires:  npm(bindings)
BuildRequires:  npm(nan)

# The project uses Grunt, but there isn't anything fancy being done so we
# can just use mocha directly.
%if 0%{?enable_tests}
BuildRequires:  npm(mocha)
BuildRequires:  npm(should)
# Not yet packaged for Fedora.
# BuildRequires:  npm(proxyquire)
%endif

%description
This module exposes predefined Unicode normalization functions that are
required by many protocols. This is just a binding to ICU, which is said
to be fast.


%prep
%setup -q -n package
%patch0 -p1
%nodejs_fixdep bindings '~1.1'
%nodejs_fixdep nan '~1.0'


%build
%nodejs_symlink_deps --check
export CXXFLAGS="%{optflags}"
node-gyp configure
node-gyp build


%install
mkdir -p %{buildroot}%{nodejs_sitelib}/node-stringprep
cp -p package.json index.js \
    %{buildroot}%{nodejs_sitelib}/node-stringprep
install -p -D -m0755 build/Release/node_stringprep.node \
    %{buildroot}%{nodejs_sitelib}/node-stringprep/build/node-stringprep.node

%nodejs_symlink_deps


%if 0%{?enable_tests}
%check
# /usr/bin/npm install proxyquire@~0.5.2
/usr/bin/mocha -R spec --ui tdd
%endif


%files
%doc LICENSE README.markdown
%{nodejs_sitelib}/node-stringprep


%changelog
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.3-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sat May 10 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.2.3-4
- patch for new Nan 1.0.0 API

* Sat May 10 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.2.3-3
- fix version of npm(nan)

* Mon Apr 21 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.2.3-2
- fix version of npm(nan) and npm(bindings) dependencies

* Sat Apr 19 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.2.3-1
- update to upstream release 0.2.3

* Fri Feb 14 2014 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.1.8-2
- rebuild for icu-53 (via v8)

* Sun Jul 28 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.1.8-1
- update to upstream release 0.1.8
- add ExclusiveArch logic
- enable tests

* Wed Jun 19 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.1.5-5
- rebuild for missing npm(node-stringprep) provides on EL6

* Sun Mar 17 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.1.5-4
- remove npm(bindings) from Requires

* Sun Mar 17 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.1.5-3
- remove dependencies on v8 as these are now automatic
- remove redundant comments
- add libicu-devel to BuildRequires
- fix the test in %%check
- move library to %%{nodejs_sitelib}/node-stringprep/node-stringprep.node
  to comply with packaging guidelines

* Thu Feb 14 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.1.5-2
- make use of %%nodejs_fixdep

* Mon Feb 11 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.1.5-1
- initial package