%{?nodejs_find_provides_and_requires} %global packagename array-buffer-from-string %global enable_tests 1 Name: nodejs-array-buffer-from-string Version: 0.1.0 Release: 1%{?dist} Summary: Create an ArrayBuffer with the [raw bytes][javascript-encoding] from a String License: MIT URL: https://github.com/linusu/array-buffer-from-string Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz # license file requested at https://github.com/LinusU/array-buffer-from-string/issues/1 Source1: LICENSE-MIT.txt ExclusiveArch: %{nodejs_arches} noarch BuildArch: noarch BuildRequires: nodejs-packaging %if 0%{?enable_tests} BuildRequires: npm(arraybuffer-equal) BuildRequires: npm(hex-to-array-buffer) %endif %description Create an ArrayBuffer with the [raw bytes][javascript-encoding] from a String. %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 *.md %license LICENSE %{nodejs_sitelib}/%{packagename} %changelog * Tue Oct 3 2017 Jared Smith - 0.1.0-1 - Initial packaging