Blob Blame History Raw
%{?nodejs_find_provides_and_requires}

%global packagename bcrypt
%global enable_tests 1

Name:		nodejs-bcrypt
Version:	0.8.7
Release:	3%{?dist}
Summary:	A bcrypt library for NodeJS

License:	MIT
URL:		https://github.com/ncb000gt/node.bcrypt.js
Source0:	https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz


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

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

%if 0%{?enable_tests}
BuildRequires:	npm(nodeunit)
%endif

%description
A bcrypt library for NodeJS.


%prep
%autosetup -n package

%nodejs_fixdep nan

%build
%nodejs_symlink_deps --check
export CXXFLAGS="%{optflags}"
%{_bindir}/node-gyp configure build
rm -rf node_modules

%install
mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
cp -pr package.json *.js build/ \
	%{buildroot}%{nodejs_sitelib}/%{packagename}

%nodejs_symlink_deps

%check
%nodejs_symlink_deps --check
%{__nodejs} -e 'require("./")'
%if 0%{?enable_tests}
%{_bindir}/nodeunit test
%else
%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
%endif

%files
%{!?_licensedir:%global license %doc}
%doc *.md examples/
%license LICENSE
%{nodejs_sitelib}/%{packagename}

%changelog
* Wed Oct 19 2016 Kalev Lember <klember@redhat.com> - 0.8.7-3
- Rebuild for nodejs(v8-abi) update

* Thu Sep 01 2016 Stephen Gallagher <sgallagh@redhat.com> - 0.8.7-2
- Rebuild for nodejs(v8-abi) update

* Fri Jul  8 2016 Jared Smith <jsmith@fedoraproject.org> - 0.8.7-1
- Initial packaging