%{?nodejs_find_provides_and_requires}
%global enable_tests 1
Name: nodejs-argparse
Version: 1.0.7
Release: 2%{?dist}
Summary: A native port of Python's argparse, an options parsing library
License: MIT
Group: System Environment/Libraries
URL: https://github.com/nodeca/argparse
Source0: http://registry.npmjs.org/argparse/-/argparse-%{version}.tgz
# The test/ directory is not included in the npm tarball.
# Source{1,2} is generated by running Source10, which pulls from the upstream
# revision control repository.
Source1: tests-%{version}.tar.bz2
Source10: dl-tests.sh
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(mocha)
BuildRequires: npm(underscore)
BuildRequires: npm(underscore.string)
BuildRequires: npm(sprintf-js)
%endif
Patch0001: 0001-fix-tests-for-Node.js-6.5.patch
%description
This is a native port of Python's argparse, an options parsing library.
It's a full port, except some very rare options. Method names have been
changed to CamelCase.
%prep
%setup -q -n package
%setup -q -D -T -a 1 -n package
%patch0001 -p1
%nodejs_fixdep underscore '~1.4'
%build
#nothing to do
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/argparse
cp -pr package.json *.js lib/ \
%{buildroot}%{nodejs_sitelib}/argparse
%nodejs_symlink_deps
%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
%{__nodejs} -e 'require("./")'
%{nodejs_sitelib}/mocha/bin/mocha -R spec
%endif
%files
%{!?_licensedir:%global license %doc}
%doc CHANGELOG.md README.md
%license LICENSE
%{nodejs_sitelib}/argparse
%changelog
* Mon Dec 05 2016 Stephen Gallagher <sgallagh@redhat.com> - 1.0.7-2
- Fix tests for building with Node.js 6.5+
* Thu Jul 28 2016 Tom Hughes <tom@compton.nu> - 1.0.7-1
- Update to 1.0.7 upstream release
- Enable tests
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Fri Dec 04 2015 Jared Smith <jsmith@fedoraproject.org> - 1.0.3-1
- Update to upstream 1.0.3 release
- Remove redundant examples tarball, as the npm tarball contains the examples
* Mon Oct 19 2015 Jared Smith <jsmith@fedoraproject.org> - 1.0.2-1
- Update to upstream 1.0.2 release
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.15-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.15-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Thu May 08 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.1.15-7
- add logic for building on EL6
* Sat Apr 26 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.1.15-6
- fix version of npm(underscore) dependency
* Fri Apr 18 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.1.15-5
- fix version of npm(underscore) dependency
* Sun Jan 19 2014 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.1.15-4
- fix underscore for 1.5.1
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.15-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
- also because last EL6 build was garbage collected
* Sat Jul 06 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.1.15-2
- improve %%description
- add ExclusiveArch
- use %%nodejs_symlink_deps --check
- BR on nodejs-packaging instead of nodejs-devel
* Fri Jun 21 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.1.15-1
- initial package