%{?nodejs_find_provides_and_requires} %global packagename buffertools %global enable_tests 1 Name: nodejs-buffertools Version: 2.1.3 Release: 7%{?dist} Summary: Working with node.js buffers made easy License: ISC URL: https://github.com/bnoordhuis/node-buffertools Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz # Patch for building on ARM Patch0: nodejs-buffertools_signed_char.patch # Patch to use the nodejs "bindings" module instead of hardcoding the path Patch1: nodejs-buffertools_use-bindings.patch ExclusiveArch: %{nodejs_arches} BuildRequires: nodejs-packaging %if 0%{?enable_tests} BuildRequires: node-gyp BuildRequires: nodejs-devel BuildRequires: npm(bindings) %endif %description Working with node.js buffers made easy. %prep %setup -q -n package %patch0 -p2 %patch1 -p2 %build export CXXFLAGS="%{optflags}" node-gyp rebuild mkdir -p %{buildroot}%{nodejs_sitearch}/%{packagename}/build/Release cp -p package.json buffertools.js %{buildroot}%{nodejs_sitearch}/%{packagename}/ cp -p build/Release/%{packagename}.node %{buildroot}%{nodejs_sitearch}/%{packagename}/build %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} %__nodejs test.js %endif %files %{!?_licensedir:%global license %doc} %doc *.md %license LICENSE %{nodejs_sitearch}/%{packagename} %changelog * Tue Jan 19 2016 Jared Smith - 2.1.3-7 - Add missing BuildRequires for bindings * Tue Jan 19 2016 Jared Smith - 2.1.3-6 - Add patch to use npm(buffertools) to handle path to native code * Tue Jan 19 2016 Jared Smith - 2.1.3-4 - Add patch to build on ARM * Tue Jan 19 2016 Jared Smith - 2.1.3-3 - Better handle installation of the output of node-gyp compilation * Tue Jan 19 2016 Jared Smith - 2.1.3-2 - Fix minor packaging issue for package review * Thu Oct 22 2015 Jared Smith - 2.1.3-1 - Initial packaging