%{?nodejs_find_provides_and_requires} %global commit c98f29965b86979c77975ac02c18fd8906ba5b48 %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: nodejs-sha Version: 1.0.1 Release: 2%{?dist} Summary: Check and get file hashes BuildArch: noarch Group: Development/Libraries License: BSD or MIT URL: https://github.com/ForbesLindesay/sha # the npm tarball doesn't contain the tests or the LICENSE file, so we grab # it from github instead Source0: https://github.com/ForbesLindesay/sha/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: nodejs-devel #for tests BuildRequires: npm(mocha) BuildRequires: npm(graceful-fs) %description Check and get file hashes using MD5, SHA1, or any other algorithm supported by OpenSSL. %prep %setup -q -n sha-%{commit} #fix EOL encodings sed -i 's/\r//g' README.md #we don't currently support optionalDependencies properly so make it mandatory %nodejs_fixdep graceful-fs 1.2 %build #nothing to do %install rm -rf %buildroot mkdir -p %{buildroot}%{nodejs_sitelib}/sha cp -pr index.js package.json %{buildroot}%{nodejs_sitelib}/sha %nodejs_symlink_deps %check %nodejs_symlink_deps --check mocha -R list %clean rm -rf %buildroot %files %defattr(-,root,root,-) %{nodejs_sitelib}/sha %doc README.md LICENSE %changelog * Thu May 30 2013 T.C. Hollingsworth - 1.0.1-2 - use github tarball instead so we get tests and LICENSE file * Thu May 30 2013 T.C. Hollingsworth - 1.0.1-1 - initial package