diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8cdfb7b --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +SOURCES/ms-0.7.1.tgz +SOURCES/tests-0.7.1.tar.bz2 diff --git a/.nodejs010-nodejs-ms.metadata b/.nodejs010-nodejs-ms.metadata new file mode 100644 index 0000000..6158586 --- /dev/null +++ b/.nodejs010-nodejs-ms.metadata @@ -0,0 +1,2 @@ +9cd13c03adbff25b65effde7ce864ee952017098 SOURCES/ms-0.7.1.tgz +fd1a6b2d0d21568d944b6fcba7b20f9978d8fec4 SOURCES/tests-0.7.1.tar.bz2 diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/dl-tests.ms.sh b/SOURCES/dl-tests.ms.sh new file mode 100644 index 0000000..1ecfa77 --- /dev/null +++ b/SOURCES/dl-tests.ms.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +tag=0.7.1 + +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 https://github.com/guille/ms.js.git +cd ms.js +git archive --prefix="test/" --format=tar tags/${tag}:test/ \ + | bzip2 > "$pwd"/tests-${tag}.tar.bz2 +popd diff --git a/SPECS/nodejs-ms.spec b/SPECS/nodejs-ms.spec new file mode 100644 index 0000000..f416aa8 --- /dev/null +++ b/SPECS/nodejs-ms.spec @@ -0,0 +1,101 @@ +%{?scl:%scl_package nodejs-ms} +%{!?scl:%global pkg_name %{name}} + +%{?nodejs_find_provides_and_requires} + +%global enable_tests 0 + +Name: %{?scl_prefix}nodejs-ms +Version: 0.7.1 +Release: 2%{?dist} +Summary: Tiny milliseconds conversion utility for Node.js +License: MIT +Group: System Environment/Libraries +URL: https://github.com/guille/ms.js/ +Source0: http://registry.npmjs.org/ms/-/ms-%{version}.tgz +# The tests 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.ms.sh + +BuildArch: noarch +%if 0%{?fedora} >= 19 +ExclusiveArch: %{nodejs_arches} noarch +%else +ExclusiveArch: %{ix86} x86_64 %{arm} noarch +%endif + +BuildRequires: nodejs010-runtime + +%if 0%{?enable_tests} +BuildRequires: %{?scl_prefix}npm(expect.js) +BuildRequires: %{?scl_prefix}npm(mocha) +%endif + +%description +This module is a tiny milliseconds conversion utility for Node.js. + +It does the following: + - If a number is supplied to ms, a string with a unit is returned. + - If a string that contains the number is supplied, it returns it as a + number (e.g: it returns 100 for '100'). + - If you pass a string with a number and a valid unit, the number of + equivalent milliseconds is returned. + +%prep +%setup -q -n package +%setup -q -T -D -a 1 -n package + +%build +#nothing to do + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/ms +cp -pr package.json index.js \ + %{buildroot}%{nodejs_sitelib}/ms + +%nodejs_symlink_deps + + +%if 0%{?enable_tests} + +%check +%nodejs_symlink_deps --check +%{nodejs_sitelib}/mocha/bin/mocha test/test.js +%endif + +%files +%doc History.md LICENSE README.md +%{nodejs_sitelib}/ms + +%changelog +* Tue Dec 01 2015 Tomas Hrcka - 0.7.1-2 +- Enable scl macros + +* Thu Sep 10 2015 Troy Dawson - 0.7.1-1 +- Update to 0.7.1 +- Turn off tests until all dependencies are built + +* Fri Apr 18 2014 Jamie Nguyen - 0.6.2-1 +- update to upstream release 0.6.2 + +* Sun Jul 28 2013 Jamie Nguyen - 0.6.1-2 +- restrict to compatible arches + +* Sat May 25 2013 Jamie Nguyen - 0.6.1-1 +- update to upstream release 0.6.1 + +* Sat Mar 16 2013 Jamie Nguyen - 0.6.0-1 +- update to upstream release 0.6.0 +- History.md is now not included in the npm tarball +- tests are now not included in the npm tarball, so download separately + +* Fri Mar 15 2013 Jamie Nguyen - 0.5.1-1 +- update to upstream release 0.5.1 + +* Fri Feb 22 2013 Jamie Nguyen - 0.5.0-2 +- add a copy of the MIT license to comply with license requirements + +* Thu Feb 14 2013 Jamie Nguyen - 0.5.0-1 +- initial package