From eee7afb98c5843b63533acf44a84b762afed9b80 Mon Sep 17 00:00:00 2001 From: Jared K. Smith Date: Oct 22 2015 06:26:10 +0000 Subject: Initial packaging --- diff --git a/.gitignore b/.gitignore index e69de29..7d255f9 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,3 @@ +/on-finished-2.3.0.tgz +/tests-2.3.0.tar.bz2 +/dl-tests.sh diff --git a/nodejs-on-finished.spec b/nodejs-on-finished.spec new file mode 100644 index 0000000..b1dce4e --- /dev/null +++ b/nodejs-on-finished.spec @@ -0,0 +1,75 @@ +%{?nodejs_find_provides_and_requires} + +%global packagename on-finished +%global enable_tests 1 + +Name: nodejs-on-finished +Version: 2.3.0 +Release: 2%{?dist} +Summary: Execute a callback when a HTTP request closes, finishes, or errors + +License: MIT +URL: https://github.com/jshttp/on-finished +Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz +# The test files are not included in the npm tarball. +# Source1 is generated by running Source10, which pulls from the upstream +# version control repository. +Source1: tests-%{version}.tar.bz2 +Source10: dl-tests.sh + + +ExclusiveArch: %{nodejs_arches} noarch +BuildArch: noarch + +BuildRequires: nodejs-packaging +%if 0%{?enable_tests} +BuildRequires: mocha +BuildRequires: npm(ee-first) +%endif + +Requires: nodejs + +%description +Execute a callback when a HTTP request closes, finishes, or errors + + +%prep +%setup -q -n package +%if 0%{?enable_tests} +# setup the tests +%setup -q -T -D -a 1 -n package +%endif + + + +%build +# nothing to do! + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} +cp -pr package.json *.js \ + %{buildroot}%{nodejs_sitelib}/%{packagename} + +%nodejs_symlink_deps + +%if 0%{?enable_tests} +%check +%nodejs_symlink_deps --check +/usr/bin/mocha -R spec +%endif + + +%files +%{!?_licensedir:%global license %doc} +%doc README.md HISTORY.md +%license LICENSE +%{nodejs_sitelib}/%{packagename} + + + +%changelog +* Thu Oct 22 2015 Jared Smith - 2.3.0-2 +- Adjust Source0 to point to npmjs.org version + +* Wed Oct 7 2015 Jared Smith - 2.3.0-1 +- Initial packaging diff --git a/sources b/sources index e69de29..3083f08 100644 --- a/sources +++ b/sources @@ -0,0 +1,3 @@ +745329d06dcc1e7d0c3bb19c98db92ff on-finished-2.3.0.tgz +7c582aa09b401944866f590a0ee82746 tests-2.3.0.tar.bz2 +1af52aa00f36d18ff161485cfda5a087 dl-tests.sh