%{?nodejs_find_provides_and_requires} %global packagename hex-to-array-buffer %global enable_tests 1 Name: nodejs-hex-to-array-buffer Version: 0.1.0 Release: 1%{?dist} Summary: Turn a string of hexadecimal characters into an `ArrayBuffer` License: MIT URL: https://github.com/linusu/hex-to-array-buffer Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz # license file requested at https://github.com/LinusU/hex-to-array-buffer/issues/2 Source1: LICENSE-MIT.txt ExclusiveArch: %{nodejs_arches} noarch BuildArch: noarch BuildRequires: nodejs-packaging %if 0%{?enable_tests} BuildRequires: npm(arraybuffer-equal) %endif %description Turn a string of hexadecimal characters into an `ArrayBuffer`. %prep %autosetup -n package cp -p %{SOURCE1} LICENSE %build # nothing to do! %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json *.js \ %{buildroot}%{nodejs_sitelib}/%{packagename} %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} %{__nodejs} test.js %else %{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif %files %doc readme.md %license LICENSE %{nodejs_sitelib}/%{packagename} %changelog * Tue Oct 3 2017 Jared Smith - 0.1.0-1 - Initial packaging