diff --git a/dl-tests.sh b/dl-tests.sh new file mode 100644 index 0000000..9d15847 --- /dev/null +++ b/dl-tests.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +tag=3.5.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/nodeca/js-yaml.git +cd js-yaml +git archive --prefix="test/" --format=tar tags/${tag}:test/ \ + | bzip2 > "$pwd"/tests-${tag}.tar.bz2 +popd diff --git a/examples-3.10.0.tar.bz2 b/examples-3.10.0.tar.bz2 new file mode 100644 index 0000000..4708c76 Binary files /dev/null and b/examples-3.10.0.tar.bz2 differ diff --git a/js-yaml-3.10.0.tgz b/js-yaml-3.10.0.tgz new file mode 100644 index 0000000..f9cc861 Binary files /dev/null and b/js-yaml-3.10.0.tgz differ diff --git a/nodejs-js-yaml.spec b/nodejs-js-yaml.spec new file mode 100644 index 0000000..f7f9587 --- /dev/null +++ b/nodejs-js-yaml.spec @@ -0,0 +1,61 @@ +%{?nodejs_find_provides_and_requires} +%global enable_tests 1 +Name: nodejs-js-yaml +Version: 3.10.0 +Release: 1 +Summary: YAML 1.2 parser and serializer +License: MIT +URL: https://github.com/nodeca/js-yaml +Source0: https://registry.npmjs.org/js-yaml/-/js-yaml-%{version}.tgz +Source1: tests-%{version}.tar.bz2 +Source2: examples-%{version}.tar.bz2 +BuildArch: noarch +ExclusiveArch: %{nodejs_arches} noarch +BuildRequires: nodejs-packaging +%if 0%{?enable_tests} +BuildRequires: npm(esprima) npm(mocha) +%endif +%description +This is an implementation of YAML (YAML Ain't Markup Language), a human +friendly data serialization language. It started as PyYAML port, and was +completely rewritten from scratch. Now it's very fast, and supports the +1.2 spec. + +%prep +%setup -q -n package +%setup -q -T -D -a 1 -n package +%setup -q -T -D -a 2 -n package +sed -i '1s/env //' bin/js-yaml.js +%nodejs_fixdep esprima + +%build + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/js-yaml +cp -pr package.json index.js lib/ \ + %{buildroot}%{nodejs_sitelib}/js-yaml +mkdir -p %{buildroot}%{nodejs_sitelib}/js-yaml/bin +install -p -D -m0755 bin/js-yaml.js \ + %{buildroot}%{nodejs_sitelib}/js-yaml/bin/js-yaml.js +mkdir -p %{buildroot}%{_bindir} +ln -sf %{nodejs_sitelib}/js-yaml/bin/js-yaml.js \ + %{buildroot}%{_bindir}/js-yaml +%nodejs_symlink_deps + +%check +%nodejs_symlink_deps --check +%{__nodejs} -e 'require("./")' +%if 0%{?enable_tests} +NODE_ENV=test %{_bindir}/mocha -R spec +%endif + +%files +%{!?_licensedir:%global license %doc} +%doc README.md CHANGELOG.md examples/ +%license LICENSE +%{nodejs_sitelib}/js-yaml +%{_bindir}/js-yaml + +%changelog +* Thu Aug 20 2020 wangxiao - 3.10.0-1 +- Package init diff --git a/nodejs-js-yaml.yaml b/nodejs-js-yaml.yaml new file mode 100644 index 0000000..37d3a8e --- /dev/null +++ b/nodejs-js-yaml.yaml @@ -0,0 +1,5 @@ +git_url: https://github.com/nodeca/js-yaml +version_control: github +src_repo: nodeca/js-yaml +tag_prefix: "" +seperator: "." diff --git a/tests-3.10.0.tar.bz2 b/tests-3.10.0.tar.bz2 new file mode 100644 index 0000000..a033ab1 Binary files /dev/null and b/tests-3.10.0.tar.bz2 differ