%{?nodejs_find_provides_and_requires} %global packagename common-tags # tests require npm(jest), which is not yet packaged %global enable_tests 0 Name: nodejs-common-tags Version: 1.8.0 Release: 1%{?dist} Summary: A few common utility template tags for ES2015 License: MIT URL: https://github.com/declandewet/common-tags.git Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz # The test files are not included in the npm tarball. # Source{1-9} are generated by running Source10, which pulls from the upstream # version control repository. Source1: src-%{version}.tar.bz2 Source10: dl-tests.sh BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch BuildRequires: nodejs-packaging %if 0%{?enable_tests} BuildRequires: npm(jest) %endif %description A few common utility template tags for ES2015 %prep %autosetup -n package # setup the src %autosetup -T -D -a 1 -n package %build # nothing to do yet, until babel is packaged in Fedora %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json lib/ es/ \ %{buildroot}%{nodejs_sitelib}/%{packagename} %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} NODE_ENV=test %{_bindir}/jest %else %{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif %files %doc readme.md %license license.md %{nodejs_sitelib}/%{packagename} %changelog * Sat Dec 8 2018 Jared K. Smith - 1.8.0-1 - Initial packaging