fuanan add package

This commit is contained in:
fwx913451 2020-08-28 18:08:10 +08:00
parent 0e0d6d05c5
commit 7aee3900a6
5 changed files with 72 additions and 0 deletions

BIN
diff-1.0.8.tgz Normal file

Binary file not shown.

23
dl-tests.sh Normal file
View File

@ -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

45
nodejs-diff.spec Normal file
View File

@ -0,0 +1,45 @@
%{?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: http://registry.npmjs.org/diff/-/diff-%{version}.tgz
Source1: tests-v%{version}.tar.bz2
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
%setup -q -n package
%setup -q -T -D -a 1 -n package
%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 <fuanan3@huawei.com> - 1.0.8-1
- package init

4
nodejs-diff.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: github
src_repo: kpdecker/jsdiff
tag_prefix: "^v"
seperator: "."

BIN
tests-v1.0.8.tar.bz2 Normal file

Binary file not shown.