%{?nodejs_find_provides_and_requires} %global packagename tslib %global enable_tests 1 Name: nodejs-tslib Version: 1.9.1 Release: 1%{?dist} Summary: Runtime library for TypeScript helper functions License: ASL 2.0 URL: https://github.com/Microsoft/tslib.git Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch BuildRequires: nodejs-packaging %if 0%{?enable_tests} BuildRequires: mocha %endif %description Runtime library for TypeScript helper functions %prep %autosetup -n package %build # nothing to do %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json *.js *.ts \ %{buildroot}%{nodejs_sitelib}/%{packagename} %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} %{_bindir}/echo -e "\e[102m -=#=- This package has no tests -=#=- \e[0m" %else %{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif %files %doc *.md docs/ %license LICENSE.txt CopyrightNotice.txt %{nodejs_sitelib}/%{packagename} %changelog * Wed May 23 2018 Jared K. Smith - 1.9.1-1 - Initial packaging