# needed for building on el6 %{?nodejs_find_provides_and_requires} %global srcname dreamopt Name: nodejs-%{srcname} Version: 0.8.0 Release: 1%{?dist} Summary: Command-line parser with readable syntax from your sweetest dreams License: MIT URL: https://github.com/andreyvit/dreamopt.js Source0: https://registry.npmjs.org/%{srcname}/-/%{srcname}-%{version}.tgz # License added in yet unreleased version Source1: https://raw.githubusercontent.com/andreyvit/dreamopt.js/master/LICENSE BuildArch: noarch %if 0%{?rhel} == 6 ExclusiveArch: %{ix86} x86_64 %{arm} noarch %else ExclusiveArch: %{nodejs_arches} noarch %endif BuildRequires: nodejs-packaging BuildRequires: coffee-script BuildRequires: npm(mocha) %description %{summary}. %prep %setup -qn package # remove pregenerated JavaScript rm -f lib/dreamopt.js # remove bundled modules (if there are any) rm -rf node_modules cp -p %{SOURCE1} . %build %nodejs_symlink_deps --build %{_bindir}/coffee -c -o lib lib/dreamopt.coffee %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{srcname} cp -pr package.json lib/ \ %{buildroot}%{nodejs_sitelib}/%{srcname} %nodejs_symlink_deps %check %{_bindir}/mocha %files %{!?_licensedir:%global license %doc} %doc README.md examples/ %license LICENSE %{nodejs_sitelib}/%{srcname} %changelog * Sun Dec 27 2015 Piotr Popieluch - 0.8.0-1 - Initial package