81ca9e4
%global enable_tests 0
81ca9e4
81ca9e4
Name:       nodejs-commander
81ca9e4
Version:    1.1.1
81ca9e4
Release:    1%{?dist}
81ca9e4
Summary:    Node.js command-line interfaces made easy
81ca9e4
# License text is included in Readme.md
81ca9e4
License:    MIT
81ca9e4
Group:      System Environment/Libraries
81ca9e4
URL:        https://github.com/visionmedia/commander.js
81ca9e4
Source0:    http://registry.npmjs.org/commander/-/commander-%{version}.tgz
81ca9e4
# The test files are not included in the npm tarball.
81ca9e4
# Source1 is generated by running Source10, which pulls from the upstream
81ca9e4
# version control repository.
81ca9e4
Source1:    tests-%{version}.tar.bz2
81ca9e4
Source10:   dl-tests.sh
81ca9e4
BuildArch:  noarch
81ca9e4
81ca9e4
# Dep generator bug which adds a trailing dot in the nodejs(engine) requires.
81ca9e4
Patch0:     nodejs-commander-1.1.1-deps.patch
81ca9e4
81ca9e4
BuildRequires:  nodejs-devel
81ca9e4
81ca9e4
%if 0%{?enable_tests}
81ca9e4
BuildRequires:  npm(keypress)
81ca9e4
BuildRequires:  npm(should)
81ca9e4
%endif
81ca9e4
81ca9e4
%description
81ca9e4
The complete solution for Node.js command-line interfaces,
81ca9e4
inspired by Ruby's commander.
81ca9e4
81ca9e4
81ca9e4
%prep
81ca9e4
%setup -q -n package
81ca9e4
%setup -T -D -a 1 -q -n package
81ca9e4
%patch0 -p1
81ca9e4
81ca9e4
81ca9e4
%build
81ca9e4
#nothing to do
81ca9e4
81ca9e4
81ca9e4
%install
81ca9e4
mkdir -p %{buildroot}%{nodejs_sitelib}/commander
81ca9e4
cp -pr package.json index.js \
81ca9e4
    %{buildroot}%{nodejs_sitelib}/commander
81ca9e4
81ca9e4
%nodejs_symlink_deps
81ca9e4
81ca9e4
81ca9e4
%if 0%{?enable_tests}
81ca9e4
%check
81ca9e4
cp -pr %{nodejs_sitelib} .
81ca9e4
make test
81ca9e4
%endif
81ca9e4
81ca9e4
81ca9e4
%files
81ca9e4
%doc History.md Readme.md
81ca9e4
%{nodejs_sitelib}/commander
81ca9e4
81ca9e4
81ca9e4
%changelog
81ca9e4
* Tue Feb 12 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 1.1.1-1
81ca9e4
- update to upstream release 1.1.1
81ca9e4
- remove patch that disables a known broken test
81ca9e4
81ca9e4
* Mon Feb 11 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.6.1-1
81ca9e4
- initial package