fuanan add package
This commit is contained in:
parent
f7e9487033
commit
9b36c6fba2
23
dl-tests.sh
Normal file
23
dl-tests.sh
Normal 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
|
||||
BIN
escodegen-1.9.0.tgz
Normal file
BIN
escodegen-1.9.0.tgz
Normal file
Binary file not shown.
63
nodejs-escodegen.spec
Normal file
63
nodejs-escodegen.spec
Normal file
@ -0,0 +1,63 @@
|
||||
%{?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://registry.npmjs.org/escodegen/-/escodegen-%{version}.tgz
|
||||
Source1: tests-%{version}.tar.bz2
|
||||
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
|
||||
%setup -q -n package
|
||||
%setup -q -T -D -a 1 -n package
|
||||
%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
4
nodejs-escodegen.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
version_control: github
|
||||
src_repo: Constellation/escodegen
|
||||
tag_prefix: "^v"
|
||||
seperator: "."
|
||||
BIN
tests-1.9.0.tar.bz2
Normal file
BIN
tests-1.9.0.tar.bz2
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user