Name: nodejs-%{npm_name} Version: Release: 1%{?dist} Summary: License: Group: System Environment/Libraries URL: Source0: http://registry.npmjs.org/%{npm_name}/-/%{npm_name}-%{version}.tgz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: nodejs-devel %description %prep %setup -q -n package #remove bundled modules #rm -rf node_modules %build #nothing to do %install rm -rf %{buildroot} #adjust the second line to install all the necessary .js files mkdir -p %{buildroot}%{nodejs_sitelib}/%{npm_name} cp -pr package.json lib bin %{buildroot}%{nodejs_sitelib}/%{npm_name}/ #if any binaries are included, symlink them to bindir here mkdir -p %{buildroot}%{_bindir} ln -sf ../lib/node_modules/%{npm_name}/bin/foo %{buildroot}%{_bindir}/foo %nodejs_symlink_deps #most Node.js libraries use the TAP framework for testing, and the %%check #section will look something like this %check #%%tap test/*.js %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %{nodejs_sitelib}/npm %{_bindir}/foo %changelog