!1 add package

Merge pull request !1 from 付安安/master
This commit is contained in:
openeuler-ci-bot 2020-09-08 18:40:50 +08:00 committed by Gitee
commit 518b2ee601
4 changed files with 70 additions and 0 deletions

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

43
nodejs-diff.spec Normal file
View File

@ -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 <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
v1.0.8.tar.gz Normal file

Binary file not shown.