diff --git a/2.4.0.tar.gz b/2.4.0.tar.gz new file mode 100644 index 0000000..0957f12 Binary files /dev/null and b/2.4.0.tar.gz differ diff --git a/dl-tests.sh b/dl-tests.sh new file mode 100644 index 0000000..79b0648 --- /dev/null +++ b/dl-tests.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +tag=2.4.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..df79faa --- /dev/null +++ b/nodejs-bytes.spec @@ -0,0 +1,43 @@ +%{?nodejs_find_provides_and_requires} +%global enable_tests 1 +Name: nodejs-bytes +Version: 2.4.0 +Release: 1 +Summary: Utility to parse a string bytes to bytes and vice-versa +License: MIT +URL: https://github.com/visionmedia/bytes.js +Source0: https://github.com/visionmedia/bytes.js/archive/%{version}.tar.gz +BuildArch: noarch +ExclusiveArch: %{nodejs_arches} noarch +BuildRequires: nodejs-packaging +%if 0%{?enable_tests} +BuildRequires: npm(mocha) +%endif +%description +%summary + +%prep +%autosetup -n bytes.js-%{version} + +%build + +%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 +%nodejs_symlink_deps --check +%{nodejs_sitelib}/mocha/bin/mocha --check-leaks --reporter spec +%endif + +%files +%doc History.md Readme.md +%license LICENSE +%{nodejs_sitelib}/bytes + +%changelog +* Mon Aug 17 2020 Shaoqiang Kang - 2.4.0-1 +- Package init diff --git a/nodejs-bytes.yaml b/nodejs-bytes.yaml new file mode 100644 index 0000000..ea86444 --- /dev/null +++ b/nodejs-bytes.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: visionmedia/bytes.js +tag_prefix: "^" +seperator: "."