%{?nodejs_find_provides_and_requires} %global enable_tests 0 %if 0%{?fedora} || 0%{?rhel} >= 7 %global installdir %{_jsdir}/gzip %else %global installdir %{_datadir}/javascript/zlib %endif Name: nodejs-gzip-js Version: 0.3.2 Release: 1%{?dist} Summary: JavaScript library reimplementing gzip, made available for Node.js Group: System Environment/Libraries License: MIT URL: https://github.com/beatgammit/gzip-js Source0: http://registry.npmjs.org/gzip-js/-/gzip-js-%{version}.tgz BuildArch: noarch %if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 ExclusiveArch: %{nodejs_arches} noarch %else ExclusiveArch: %{ix86} x86_64 %{arm} noarch %endif BuildRequires: nodejs-packaging %if 0%{?fedora} || 0%{?rhel} >= 7 BuildRequires: web-assets-devel Requires: web-assets-filesystem %endif %if 0%{?enable_tests} BuildRequires: npm(buster) %endif Requires: js-gzip = %{version} %description gzip-js is a pure JavaScript implementation of the GZIP file format. It uses the DEFLATE algorithm for compressing data. %prep %setup -q -n package %nodejs_fixdep optimist '~0.2' %build # nothing to do %install mkdir -p %{buildroot}%{nodejs_sitelib}/gzip-js cp -pr package.json \ %{buildroot}%{nodejs_sitelib}/gzip-js # link to file provided by js-gzip package mkdir -p %{buildroot}%{nodejs_sitelib}/gzip-js/lib ln -sf %{installdir}/lib/gzip.js \ %{buildroot}%{nodejs_sitelib}/gzip-js/lib ln -sf %{installdir}/bin/{gzip,gunzip}.js \ %{buildroot}%{nodejs_sitelib}/gzip-js/ %nodejs_symlink_deps %if 0%{?enable_tests} %check %nodejs_symlink_deps --check /usr/bin/buster-test %endif %files %doc LICENSE LICENSE.MIT README.md %{nodejs_sitelib}/gzip-js %changelog * Thu Mar 20 2014 Zbigniew Jędrzejewski-Szmek - 0.3.2-1 - initial package