%{?nodejs_find_provides_and_requires}
%global enable_tests 0
Name: nodejs-maxmin
Version: 0.2.0
Release: 1%{?dist}
Summary: Get pretty output of the original, minified gzipped size of a string/buffer
License: MIT
Group: System Environment/Libraries
URL: https://github.com/sindresorhus/maxmin
Source0: http://registry.npmjs.org/maxmin/-/maxmin-%{version}.tgz
Source1: https://raw.githubusercontent.com/sindresorhus/maxmin/84b50e3e9137aa5aab9295755aab3dd7d93e1e4f/test.js
# https://github.com/sindresorhus/maxmin/pull/1
Source2: LICENSE
# gzip-size cannot be packaged for fedora<21 or rhel<7 due to the dependency
# on js-zlib. To make maxmin available to these older branches, we can remove
# the use of gzip-size. This is not ideal, but better than not having the
# package available at all.
Patch0: %{name}-0.2.0-Remove-use-of-gzip-size.patch
BuildArch: noarch
%if 0%{?fedora} >= 19
ExclusiveArch: %{nodejs_arches} noarch
%else
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
%endif
BuildRequires: nodejs-packaging
%if 0%{?enable_tests}
BuildRequires: npm(chalk)
BuildRequires: npm(gzip-size)
BuildRequires: npm(pretty-bytes)
BuildRequires: npm(mocha)
%endif
%description
%{summary}.
%prep
%setup -q -n package
cp -p %{SOURCE1} .
cp -p %{SOURCE2} .
%if 0%{?fedora} < 21 || 0%{?rhel} < 7
%patch0 -p1
%endif
%build
#nothing to do
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/maxmin
cp -pr package.json index.js \
%{buildroot}%{nodejs_sitelib}/maxmin
%nodejs_symlink_deps
%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
/usr/bin/mocha
%endif
%files
%doc LICENSE readme.md
%{nodejs_sitelib}/maxmin
%changelog
* Thu May 08 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.2.0-1
- update to upstream release 0.2.0
- disable use of gzip-size on branches where js-zlib cannot be packaged
* Thu Mar 13 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.1.0-1
- initial package