Blame nodejs-jsonm.spec

Jared K. Smith 25eff0a
%{?nodejs_find_provides_and_requires}
Jared K. Smith 25eff0a
Jared K. Smith 25eff0a
%global packagename jsonm
Jared K. Smith 25eff0a
%global enable_tests 1
Jared K. Smith 25eff0a
Jared K. Smith 25eff0a
Name:		nodejs-jsonm
Jared K. Smith 25eff0a
Version:	1.0.9
Jared K. Smith 25eff0a
Release:	1%{?dist}
Jared K. Smith 25eff0a
Summary:	JSON compressor for packing messages with memoization
Jared K. Smith 25eff0a
Jared K. Smith 25eff0a
License:	MIT
Jared K. Smith 25eff0a
URL:		https://github.com/lennartcl/jsonm
Jared K. Smith 25eff0a
Source0:	https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
Jared K. Smith 25eff0a
Jared K. Smith 25eff0a
ExclusiveArch:	%{nodejs_arches} noarch
Jared K. Smith 25eff0a
BuildArch:	noarch
Jared K. Smith 25eff0a
Jared K. Smith 25eff0a
BuildRequires:	nodejs-packaging
Jared K. Smith 25eff0a
%if 0%{?enable_tests}
Jared K. Smith 25eff0a
BuildRequires:	mocha
Jared K. Smith 25eff0a
%endif
Jared K. Smith 25eff0a
Jared K. Smith 25eff0a
%description
Jared K. Smith 25eff0a
JSON compressor for packing messages with memoization
Jared K. Smith 25eff0a
Jared K. Smith 25eff0a
Jared K. Smith 25eff0a
%prep
Jared K. Smith 25eff0a
%autosetup -n package
Jared K. Smith 25eff0a
Jared K. Smith 25eff0a
sed -i '1s/env //' bin/cli.js
Jared K. Smith 25eff0a
Jared K. Smith 25eff0a
%build
Jared K. Smith 25eff0a
# nothing to do!
Jared K. Smith 25eff0a
Jared K. Smith 25eff0a
%install
Jared K. Smith 25eff0a
mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
Jared K. Smith 25eff0a
cp -pr package.json build/ \
Jared K. Smith 25eff0a
	%{buildroot}%{nodejs_sitelib}/%{packagename}
Jared K. Smith 25eff0a
Jared K. Smith 25eff0a
mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}/bin
Jared K. Smith 25eff0a
install -p -D -m0755 bin/cli.js %{buildroot}%{nodejs_sitelib}/%{packagename}/bin/
Jared K. Smith 25eff0a
Jared K. Smith 25eff0a
mkdir -p %{buildroot}%{_bindir}
Jared K. Smith 25eff0a
ln -sf %{nodejs_sitelib}/%{packagename}/bin/cli.js \
Jared K. Smith 25eff0a
    %{buildroot}%{_bindir}/%{packagename}
Jared K. Smith 25eff0a
Jared K. Smith 25eff0a
%nodejs_symlink_deps
Jared K. Smith 25eff0a
Jared K. Smith 25eff0a
%check
Jared K. Smith 25eff0a
%nodejs_symlink_deps --check
Jared K. Smith 25eff0a
%{__nodejs} -e 'require("./")'
Jared K. Smith 25eff0a
%if 0%{?enable_tests}
Jared K. Smith 25eff0a
%{_bindir}/mocha -R spec
Jared K. Smith 25eff0a
%else
Jared K. Smith 25eff0a
%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
Jared K. Smith 25eff0a
%endif
Jared K. Smith 25eff0a
Jared K. Smith 25eff0a
%files
Jared K. Smith 25eff0a
%doc *.md
Jared K. Smith 25eff0a
%license LICENSE
Jared K. Smith 25eff0a
%{nodejs_sitelib}/%{packagename}
Jared K. Smith 25eff0a
%{_bindir}/%{packagename}
Jared K. Smith 25eff0a
Jared K. Smith 25eff0a
%changelog
Jared K. Smith 25eff0a
* Wed Mar 29 2017 Jared Smith <jsmith@fedoraproject.org> - 1.0.9-1
Jared K. Smith 25eff0a
- Initial packaging