Blob Blame History Raw
%global enable_tests 1

Name:           nodejs-passport-oauth1
Version:        1.0.0
Release:        1%{?dist}
Summary:        OAuth 1.0 authentication strategy for Passport

License:        MIT
URL:            https://github.com/jaredhanson/passport-oauth1
Source0:        http://registry.npmjs.org/passport-oauth1/-/passport-oauth1-%{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-oauth1-tests-v%{version}.tar.bz2
Source10:       passport-oauth1-dl-tests.sh
BuildArch:      noarch
ExclusiveArch:  %{nodejs_arches} noarch

BuildRequires:  nodejs-packaging

%if 0%{?enable_tests}
BuildRequires:  npm(mocha)
BuildRequires:  npm(chai)
BuildRequires:  npm(chai-passport-strategy)
BuildRequires:  npm(passport-strategy)
BuildRequires:  npm(oauth)
BuildRequires:  npm(utils-merge)
%endif

%description
General-purpose OAuth 1.0 authentication strategy for Passport.

This module lets you authenticate using OAuth in your Node.js
applications. By plugging into Passport, OAuth authentication can be
easily and unobtrusively integrated into any application or framework
that supports Connect-style middleware, including Express.

Note that this strategy provides generic OAuth support. In many cases,
a provider-specific strategy can be used instead, which cuts down on
unnecessary configuration, and accommodates any provider-specific
quirks. See the list for supported providers.

Developers who need to implement authentication against an OAuth
provider that is not already supported are encouraged to sub-class
this strategy. If you choose to open source the new provider-specific
strategy, please add it to the list so other people can find it.


%prep
%setup -q -n package
%setup -T -D -a 1 -q -n package
rm -rf node_modules


%build


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


%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
%{nodejs_sitelib}/mocha/bin/mocha --reporter spec --require test/bootstrap/node test/*.test.js
%endif


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


%changelog
* Sun Aug 18 2013 Tom Hughes <tom@compton.nu> - 1.0.0-1
- Initial build of 1.0.0