From f2df6726dacb40af2510514e96bda375c879740e Mon Sep 17 00:00:00 2001 From: Jamie Nguyen Date: Mar 12 2014 12:36:44 +0000 Subject: Initial import --- diff --git a/.gitignore b/.gitignore index e69de29..5916edd 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,2 @@ +/serve-static-1.0.2.tgz +/tests-v1.0.2.tar.bz2 diff --git a/dl-tests.sh b/dl-tests.sh new file mode 100644 index 0000000..145cd71 --- /dev/null +++ b/dl-tests.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +tag=v1.0.2 + +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/expressjs/serve-static.git +cd serve-static +git archive --prefix="test/" --format=tar tags/${tag}:test/ \ + | bzip2 > "$pwd"/tests-${tag}.tar.bz2 +popd diff --git a/nodejs-serve-static.spec b/nodejs-serve-static.spec new file mode 100644 index 0000000..484d903 --- /dev/null +++ b/nodejs-serve-static.spec @@ -0,0 +1,71 @@ +%{?nodejs_find_provides_and_requires} + +%global enable_tests 0 + +Name: nodejs-serve-static +Version: 1.0.2 +Release: 1%{?dist} +Summary: Middleware for serving static files for Node.js and Connect +License: MIT +Group: System Environment/Libraries +URL: https://github.com/expressjs/serve-static +Source0: http://registry.npmjs.org/serve-static/-/serve-static-%{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-v%{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 + +BuildRequires: nodejs-packaging + +%if 0%{?enable_tests} +BuildRequires: mocha +BuildRequires: npm(connect) +BuildRequires: npm(send) +BuildRequires: npm(should) +BuildRequires: npm(supertest) +%endif + +%description +%{summary}. + + +%prep +%setup -q -n package +%setup -q -T -D -a 1 -n package + + +%build +#nothing to do + + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/serve-static +cp -pr package.json index.js \ + %{buildroot}%{nodejs_sitelib}/serve-static + +%nodejs_symlink_deps + + +%if 0%{?enable_tests} +%check +%nodejs_symlink_deps --check +/usr/bin/mocha --require should --reporter spec +%endif + + +%files +%doc LICENSE Readme.md +%{nodejs_sitelib}/serve-static + + +%changelog +* Mon Mar 10 2014 Jamie Nguyen - 1.0.2-1 +- initial package diff --git a/sources b/sources index e69de29..398b1a2 100644 --- a/sources +++ b/sources @@ -0,0 +1,2 @@ +dd844d16e981b9e8c13e05075544a273 serve-static-1.0.2.tgz +0a151c8def84aaf03c3483fc1343912b tests-v1.0.2.tar.bz2