fuanan add package

This commit is contained in:
fwx913451 2020-08-28 17:55:10 +08:00
parent 4c51e08d7e
commit 949e27e073
5 changed files with 75 additions and 0 deletions

23
dl-tests.sh Normal file
View File

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

BIN
eventemitter2-0.4.13.tgz Normal file

Binary file not shown.

48
nodejs-eventemitter2.spec Normal file
View File

@ -0,0 +1,48 @@
%{?nodejs_find_provides_and_requires}
%global enable_tests 0
Name: nodejs-eventemitter2
Version: 0.4.13
Release: 1
Summary: A Node.js event emitter implementation with namespaces, wildcards and TTL
License: MIT
URL: https://github.com/hij1nx/EventEmitter2
Source0: http://registry.npmjs.org/eventemitter2/-/eventemitter2-%{version}.tgz
Source1: tests-%{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(nodeunit)
%endif
%description
A Node.js event emitter implementation with namespaces, wildcards,
time to live (TTL) and browser support.
%prep
%setup -q -n package
%setup -q -T -D -a 1 -n package
%build
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/eventemitter2
cp -pr package.json index.js lib/ \
%{buildroot}%{nodejs_sitelib}/eventemitter2
%nodejs_symlink_deps
%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
%{nodejs_sitelib}/nodeunit/bin/nodeunit test/simple/
%{nodejs_sitelib}/nodeunit/bin/nodeunit test/wildcardEvents/
%endif
%files
%doc README.md
%{nodejs_sitelib}/eventemitter2
%changelog
* Thu Aug 20 2020 Anan Fu <fuanan3@huawei.com> - 0.4.13-1
- package init

View File

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

BIN
tests-0.4.13.tar.bz2 Normal file

Binary file not shown.