%{?nodejs_find_provides_and_requires} %global packagename is-utf8 %global enable_tests 1 Name: nodejs-is-utf8 Version: 0.2.1 Release: 1%{?dist} Summary: Detect if a buffer is utf8 encoded License: BSD URL: https://github.com/wayfind/is-utf8.git Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz # Test files aren't part of the npm package # The 0.2.1 release isn't tagged in github, so pull the files from 'master' for now Source1: https://raw.githubusercontent.com/wayfind/is-utf8/master/test.js Source2: https://raw.githubusercontent.com/wayfind/is-utf8/master/ansi.txt Source3: https://raw.githubusercontent.com/wayfind/is-utf8/master/utf8.txt ExclusiveArch: %{nodejs_arches} noarch BuildArch: noarch BuildRequires: nodejs-packaging %if 0%{?enable_tests} #BuildRequires: %endif Requires: nodejs %description Detect if a buffer is utf8 encoded. %prep %setup -q -n package # copy the test files cp -p %{SOURCE1} %{SOURCE2} %{SOURCE3} . %build # nothing to do! %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json is-utf8.js \ %{buildroot}%{nodejs_sitelib}/%{packagename} %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_sitelib}/%{packagename} %changelog * Tue Feb 09 2016 Jared Smith - 0.2.1-1 - Update to upstream 0.2.1 release * Thu Oct 29 2015 Jared Smith - 0.2.0-2 - Initial packaging