%{?nodejs_find_provides_and_requires} %global packagename loophole %global enable_tests 1 Name: nodejs-loophole Version: 1.1.0 Release: 1%{?dist} Summary: A hack to enable use of libraries that depend on a basic form of eval in Atom License: MIT URL: https://github.com/atom/loophole.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 Source2: tests-%{version}.tar.bz2 Source10: dl-tests.sh BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch BuildRequires: nodejs-packaging BuildRequires: coffee-script %if 0%{?enable_tests} BuildRequires: jasmine-node %endif %description A hack to enable use of libraries that depend on a basic form of eval in Atom %prep %autosetup -n package # setup the src and tests %autosetup -T -D -a 1 -n package %autosetup -T -D -a 2 -n package # remove pre-transpiled file rm lib/loophole.js %build # nothing to do %{_bindir}/coffee -b -o lib/ src/*.coffee %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json lib/ \ %{buildroot}%{nodejs_sitelib}/%{packagename} %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} NODE_ENV=test %{_bindir}/jasmine-node --coffee spec/ %else %{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif %files %doc *.md %license LICENSE.md %{nodejs_sitelib}/%{packagename} %changelog * Fri Apr 27 2018 Jared K. Smith - 1.1.0-1 - Initial packaging