Blob Blame History Raw
%global enable_tests 1

Name:           nodejs-passport
Version:        0.1.17
Release:        1%{?dist}
Summary:        Simple, unobtrusive authentication for Node.js

License:        MIT
URL:            https://github.com/jaredhanson/passport
Source0:        http://registry.npmjs.org/passport/-/passport-%{version}.tgz
# The test files are not included in the npm tarball.
# Source1 is generated using Source10, which pulls from the upstream
# version control repository.
Source1:        passport-tests-v%{version}.tar.bz2
Source10:       passport-dl-tests.sh
BuildArch:      noarch

BuildRequires:  nodejs-devel

%if 0%{?enable_tests}
BuildRequires:  npm(vows)
BuildRequires:  npm(pause)
BuildRequires:  npm(pkginfo)
%endif

%description
Passport is an authentication framework for Connect and Express, which
is extensible through "plugins" known as strategies.

Passport is designed to be a general-purpose, yet simple, modular, and
unobtrusive, authentication framework. Passport's sole purpose is to
authenticate requests. In being modular, it doesn't force any particular
authentication strategy on your application. In being unobtrusive, it
doesn't mount routes in your application. The API is simple: you give
Passport a request to authenticate, and Passport provides hooks for
controlling what occurs when authentication succeeds or fails.


%prep
%setup -q -n package
%setup -T -D -a 1 -q -n package
%nodejs_fixdep pkginfo "~0.3.0"
rm -rf node_modules


%build


%install
mkdir -p %{buildroot}/%{nodejs_sitelib}/passport
cp -pr package.json lib %{buildroot}/%{nodejs_sitelib}/passport
%nodejs_symlink_deps


%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
NODE_PATH=lib %{nodejs_sitelib}/vows/bin/vows \
  test/*-test.js test/**/*-test.js test/context/http/*-test.js
%endif


%files
%doc LICENSE README.md
%{nodejs_sitelib}/passport


%changelog
* Mon May 13 2013 Tom Hughes <tom@compton.num> - 0.1.17-1
- Update to 0.1.17 upstream release
- Enable tests

* Sat Mar  2 2013 Tom Hughes <tom@compton.nu> - 0.1.16-1
- Update to 0.1.16 upstream release
- BuildRequire pkginfo for tests
- Link node_modules for tests

* Sat Feb 23 2013 Tom Hughes <tom@compton.nu> - 0.1.15-2
- Update pkginfo dependency

* Sun Feb 10 2013 Tom Hughes <tom@compton.nu> - 0.1.15-1
- Initial build of 0.1.15