%{?nodejs_find_provides_and_requires}
%global enable_tests 1
Name: nodejs-commander
Version: 1.2.0
Release: 5%{?dist}
Summary: Node.js command-line interfaces made easy
# License text is included in Readme.md
License: MIT
Group: System Environment/Libraries
URL: https://github.com/visionmedia/commander.js
Source0: http://registry.npmjs.org/commander/-/commander-%{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
BuildArch: noarch
%if 0%{?fedora} >= 19
ExclusiveArch: %{nodejs_arches} noarch
%else
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
%endif
# Dep generator bug which adds a trailing dot in the nodejs(engine) requires.
Patch0: nodejs-commander-1.1.1-deps.patch
BuildRequires: nodejs-packaging
%if 0%{?enable_tests}
BuildRequires: npm(keypress)
BuildRequires: npm(should)
%endif
%description
The complete solution for Node.js command-line interfaces,
inspired by Ruby's commander.
%prep
%setup -q -n package
%setup -T -D -a 1 -q -n package
%patch0 -p1
%nodejs_fixdep keypress '2.x'
%build
#nothing to do
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/commander
cp -pr package.json index.js \
%{buildroot}%{nodejs_sitelib}/commander
%nodejs_symlink_deps
%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
find test/test.*.js -exec ./test/run '{}' \;
%endif
%files
%doc History.md Readme.md
%{nodejs_sitelib}/commander
%changelog
* Wed Aug 28 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 1.2.0-5
- fix version of dependency on nodejs-keypress
* Mon Aug 26 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 1.2.0-4
- rebuild to enable tests
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Sat Jul 06 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 1.2.0-2
- fix compatible arches for f18/el6
* Fri Jul 05 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 1.2.0-1
- restrict to compatible arches
- update to upstream release 1.2.0
* Wed Jun 19 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1.1.1-2
- rebuild for missing npm(commander) provides on EL6
* Tue Feb 12 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 1.1.1-1
- update to upstream release 1.1.1
- remove patch that disables a known broken test
* Mon Feb 11 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.6.1-1
- initial package