%{?nodejs_find_provides_and_requires} %global packagename rollup-plugin-buble %global enable_tests 1 Name: nodejs-rollup-plugin-buble Version: 0.19.2 Release: 1%{?dist} Summary: Compile ES2015 with buble License: MIT URL: https://github.com/rollup/rollup-plugin-buble 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 # rollup config Source11: https://raw.githubusercontent.com/rollup/rollup-plugin-buble/v%{version}/rollup.config.js # license file Source12: https://raw.githubusercontent.com/rollup/rollup/master/LICENSE.md BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch BuildRequires: nodejs-packaging BuildRequires: npm(buble) BuildRequires: npm(rollup) BuildRequires: npm(rollup-pluginutils) %if 0%{?enable_tests} BuildRequires: mocha %endif %description Compile ES2015 with buble %prep %autosetup -n package # setup the source code and tests %autosetup -T -D -a 1 -n package %autosetup -T -D -a 2 -n package cp -p %{SOURCE11} . cp -p %{SOURCE12} . %nodejs_fixdep micromatch '~3.1.10' %nodejs_fixdep buble '^0.16.0' %build rollup -m -i src/index.js -f cjs -o dist/rollup-plugin-buble.cjs.js rollup -m -i src/index.js -f es -o dist/rollup-plugin-buble.es.js %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 %doc *.md %license LICENSE.md %{nodejs_sitelib}/%{packagename} %changelog * Tue May 29 2018 Jared K. Smith - 0.19.2-1 - Initial packaging