diff --git a/dl-tests.sh b/dl-tests.sh new file mode 100644 index 0000000..bfe0a10 --- /dev/null +++ b/dl-tests.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +tag=v1.0.8 + +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/kpdecker/jsdiff.git +cd jsdiff +git archive --prefix="test/" --format=tar tags/${tag}:test/ \ + | bzip2 > "$pwd"/tests-${tag}.tar.bz2 +popd diff --git a/nodejs-diff.spec b/nodejs-diff.spec new file mode 100644 index 0000000..467ef10 --- /dev/null +++ b/nodejs-diff.spec @@ -0,0 +1,43 @@ +%{?nodejs_find_provides_and_requires} +%global enable_tests 1 +Name: nodejs-diff +Version: 1.0.8 +Release: 1 +Summary: A JavaScript text diff implementation for Node.js +License: BSD +URL: https://github.com/kpdecker/jsdiff +Source0: https://github.com/kpdecker/jsdiff/archive/v%{version}.tar.gz +Source10: dl-tests.sh +BuildArch: noarch +ExclusiveArch: %{nodejs_arches} noarch +ExclusiveArch: %{ix86} x86_64 %{arm} noarch +BuildRequires: nodejs-packaging +%if 0%{?enable_tests} +BuildRequires: npm(colors) npm(mocha) npm(should) +%endif +%description +%{summary} + +%prep +%autosetup -n jsdiff-%{version} + +%build + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/diff +cp -pr package.json diff.js \ + %{buildroot}%{nodejs_sitelib}/diff +%nodejs_symlink_deps +%if 0%{?enable_tests} + +%check +%{nodejs_sitelib}/mocha/bin/mocha test/*.js +%endif + +%files +%doc README.md +%{nodejs_sitelib}/diff + +%changelog +* Tue Aug 18 2020 Anan Fu - 1.0.8-1 +- package init diff --git a/nodejs-diff.yaml b/nodejs-diff.yaml new file mode 100644 index 0000000..efcde6d --- /dev/null +++ b/nodejs-diff.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: kpdecker/jsdiff +tag_prefix: "^v" +seperator: "." diff --git a/v1.0.8.tar.gz b/v1.0.8.tar.gz new file mode 100644 index 0000000..8973ea5 Binary files /dev/null and b/v1.0.8.tar.gz differ