diff --git a/.gitignore b/.gitignore index e69de29..e99795e 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,2 @@ +/passport-oauth1-1.0.0.tgz +/passport-oauth1-tests-v1.0.0.tar.bz2 diff --git a/nodejs-passport-oauth1.spec b/nodejs-passport-oauth1.spec new file mode 100644 index 0000000..5841207 --- /dev/null +++ b/nodejs-passport-oauth1.spec @@ -0,0 +1,78 @@ +%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 - 1.0.0-1 +- Initial build of 1.0.0 diff --git a/passport-oauth1-dl-tests.sh b/passport-oauth1-dl-tests.sh new file mode 100744 index 0000000..72767bb --- /dev/null +++ b/passport-oauth1-dl-tests.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +tag=v1.0.0 + +set -e + +tmp=$(mktemp -d) + +trap cleanup EXIT +cleanup() { + set +e + [ -z "$tmp" -o ! -d "$tmp" ] || rm -rf "$tmp" +} + +unset CDPATH +pwd=$(pwd) + +pushd "$tmp" +git clone git://github.com/jaredhanson/passport-oauth1.git +cd passport-oauth1 +git archive --prefix="test/" --format=tar tags/${tag}:test/ \ + | bzip2 > "$pwd"/passport-oauth1-tests-${tag}.tar.bz2 +popd diff --git a/sources b/sources index e69de29..a441e60 100644 --- a/sources +++ b/sources @@ -0,0 +1,2 @@ +96fb38afc18f690b112e021f8a8bd87f passport-oauth1-1.0.0.tgz +54005ecc92d2510c78e3f75b773a02ec passport-oauth1-tests-v1.0.0.tar.bz2