!1 add package

From: @fly_fzc
Reviewed-by: @solarhu
Signed-off-by: @solarhu
This commit is contained in:
openeuler-ci-bot 2020-09-11 22:19:22 +08:00 committed by Gitee
commit 22982508f9
4 changed files with 88 additions and 0 deletions

BIN
1.9.0.tar.gz Normal file

Binary file not shown.

23
dl-tests.sh Normal file
View File

@ -0,0 +1,23 @@
#!/bin/bash
tag=1.3.2
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/Constellation/escodegen.git
cd escodegen
git archive --prefix="test/" --format=tar tags/${tag}:test/ \
| bzip2 > "$pwd"/tests-${tag}.tar.bz2
popd

61
nodejs-escodegen.spec Normal file
View File

@ -0,0 +1,61 @@
%{?nodejs_find_provides_and_requires}
%global enable_tests 0
Name: nodejs-escodegen
Version: 1.9.0
Release: 1
Summary: ECMAScript code generator
License: BSD
URL: https://github.com/Constellation/escodegen
Source0: https://github.com/Constellation/escodegen/archive/%{version}.tar.gz
Source10: dl-tests.sh
BuildArch: noarch
ExclusiveArch: %{nodejs_arches} noarch
BuildRequires: nodejs-packaging
%if 0%{?enable_tests}
BuildRequires: npm(mocha) npm(chai) npm(estraverse) npm(esutils) npm(source-map)
%endif
%description
%{summary}.
%prep
%autosetup -n escodegen-%{version}
%nodejs_fixdep esprima
%nodejs_fixdep estraverse
%nodejs_fixdep source-map "^0.5.2"
rm -f *.min.js
sed -i '1s/env //' bin/*.js
%build
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/escodegen
cp -pr package.json escodegen.js \
%{buildroot}%{nodejs_sitelib}/escodegen
mkdir -p %{buildroot}%{nodejs_sitelib}/escodegen/bin
install -p -D -m0755 bin/escodegen.js \
%{buildroot}%{nodejs_sitelib}/escodegen/bin/escodegen.js
install -p -D -m0755 bin/esgenerate.js \
%{buildroot}%{nodejs_sitelib}/escodegen/bin/esgenerate.js
mkdir -p %{buildroot}%{_bindir}
ln -sf %{nodejs_sitelib}/escodegen/bin/escodegen.js \
%{buildroot}%{_bindir}/escodegen.js
ln -sf %{nodejs_sitelib}/escodegen/bin/esgenerate.js \
%{buildroot}%{_bindir}/esgenerate.js
%nodejs_symlink_deps
%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
%{_bindir}/mocha --reporter spec --timeout 30000
%endif
%files
%{!?_licensedir:%global license %doc}
%license LICENSE.BSD LICENSE.source-map
%{nodejs_sitelib}/escodegen
%{_bindir}/escodegen.js
%{_bindir}/esgenerate.js
%changelog
* Thu Aug 20 2020 Anan Fu <fuanan3@huawei.com> - 1.9.0-1
- package init

4
nodejs-escodegen.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: github
src_repo: Constellation/escodegen
tag_prefix: "^"
seperator: "."