Blob Blame History Raw
%{?nodejs_find_provides_and_requires}

%global enable_tests 0

Name:       nodejs-argparse
Version:    0.1.15
Release:    8%{?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.
# Source1 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)
%endif

%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
chmod -x examples/*.js

%nodejs_fixdep underscore '~1.4'


%build
#nothing to do


%install
mkdir -p %{buildroot}%{nodejs_sitelib}/argparse
cp -pr package.json index.js lib/ \
    %{buildroot}%{nodejs_sitelib}/argparse

%nodejs_symlink_deps


%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
NODE_ENV=test %{nodejs_sitelib}/mocha/bin/mocha
%endif


%files
%doc HISTORY.md LICENSE README.md examples/
%{nodejs_sitelib}/argparse


%changelog
* 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