%{?nodejs_find_provides_and_requires} %global packagename rollup-pluginutils # This package is both a dependency on npm(rollup-plugin-buble) and # depends on it to build itself. So we'll initiall run with the # pre-compiled versions in dist/ until we can rebuild them after # npm(rollup-plugin-buble) is done. %global bootstrap 1 # tests fail due to upstream changes in npm(snapdragon) %global enable_tests 0 Name: nodejs-rollup-pluginutils Version: 2.3.0 Release: 1%{?dist} Summary: Functionality commonly needed by Rollup plugins License: MIT URL: https://github.com/rollup/rollup-pluginutils 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: tests-%{version}.tar.bz2 Source10: dl-tests.sh # Rollup config Source11: https://raw.githubusercontent.com/rollup/rollup-pluginutils/v%{version}/rollup.config.js # License Source12: LICENSE-MIT.txt BuildArch: noarch %if 0%{?fedora} >= 19 ExclusiveArch: %{nodejs_arches} noarch %else ExclusiveArch: %{ix86} x86_64 %{arm} noarch %endif BuildRequires: nodejs-packaging BuildRequires: npm(estree-walker) BuildRequires: npm(micromatch) BuildRequires: npm(rollup) %if 0%{?enable_tests} BuildRequires: mocha %endif %description Functionality commonly needed by Rollup plugins %prep %autosetup -n package # setup the tests %autosetup -T -D -a 1 -n package # rollup config cp -p %{SOURCE11} . # license cp -p %{SOURCE12} . %nodejs_fixdep micromatch ^3.1.10 %nodejs_fixdep minimatch %build %if 0%{?bootstrap} # nothing to do %else %{_bindir}/rollup -c -f cjs -o dist/pluginutils.cjs.js %{_bindir}/rollup -c -f es6 -o dist/pluginutils.es6.js %endif %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json dist/ \ %{buildroot}%{nodejs_sitelib}/%{packagename} %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} NODE_ENV=test %{_bindir}/mocha -R spec %else %{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif %files %{!?_licensedir:%global license %doc} %doc *.md %license LICENSE-MIT.txt %{nodejs_sitelib}/%{packagename} %changelog * Tue May 29 2018 Jared K. Smith - 2.3.0-1 - Update to upstream 2.3.0 release * Mon Aug 1 2016 Jared Smith - 1.5.1-1 - Initial packaging