[nodejs-bytes] Initial commit
Jamie Nguyen
jamielinux at fedoraproject.org
Fri Feb 22 13:56:15 UTC 2013
commit 8b683654fde7f6a34f2b43e9b27366616e527807
Author: Jamie Nguyen <j at jamielinux.com>
Date: Fri Feb 22 13:56:06 2013 +0000
Initial commit
.gitignore | 2 +
dl-tests.sh | 23 +++++++++++++++++++
nodejs-bytes.spec | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++
sources | 2 +
4 files changed, 91 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..027ace2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/bytes-0.2.0.tgz
+/tests-0.2.0.tar.bz2
diff --git a/dl-tests.sh b/dl-tests.sh
new file mode 100755
index 0000000..97ec5fd
--- /dev/null
+++ b/dl-tests.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+tag=0.2.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/visionmedia/bytes.js.git
+cd bytes.js
+git archive --prefix="test/" --format=tar tags/${tag}:test/ \
+ | bzip2 > "$pwd"/tests-${tag}.tar.bz2
+popd
diff --git a/nodejs-bytes.spec b/nodejs-bytes.spec
new file mode 100644
index 0000000..a1a507c
--- /dev/null
+++ b/nodejs-bytes.spec
@@ -0,0 +1,64 @@
+%global enable_tests 0
+
+Name: nodejs-bytes
+Version: 0.2.0
+Release: 2%{?dist}
+Summary: Byte size string parser/serializer for Node.js
+# License text is included in Readme.md
+License: MIT
+Group: System Environment/Libraries
+URL: https://github.com/visionmedia/bytes.js
+Source0: http://registry.npmjs.org/bytes/-/bytes-%{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-%{version}.tar.bz2
+Source10: dl-tests.sh
+BuildArch: noarch
+
+BuildRequires: nodejs-devel
+
+%if 0%{?enable_tests}
+BuildRequires: npm(mocha)
+BuildRequires: npm(should)
+%endif
+
+%description
+%summary
+
+
+%prep
+%setup -q -n package
+%setup -T -D -a 1 -q -n package
+
+
+%build
+#nothing to do
+
+
+%install
+mkdir -p %{buildroot}%{nodejs_sitelib}/bytes
+cp -pr package.json index.js \
+ %{buildroot}%{nodejs_sitelib}/bytes
+
+%nodejs_symlink_deps
+
+
+%if 0%{?enable_tests}
+%check
+cp -pr %{nodejs_sitelib} .
+%{nodejs_sitelib}/mocha/bin/mocha --reporter spec --require should
+%endif
+
+
+%files
+%doc History.md Readme.md
+%{nodejs_sitelib}/bytes
+
+
+%changelog
+* Tue Feb 12 2013 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.2.0-2
+- document how to retrieve tests
+
+* Mon Feb 11 2013 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.2.0-1
+- initial package
diff --git a/sources b/sources
index e69de29..1e812d2 100644
--- a/sources
+++ b/sources
@@ -0,0 +1,2 @@
+29031f6b5b73e7605e983e07b8b587dd bytes-0.2.0.tgz
+69dd4716ecfa3f177cc4dcc41f9e2e46 tests-0.2.0.tar.bz2
More information about the scm-commits
mailing list