diff --git a/nodejs-promises-aplus-tests.spec b/nodejs-promises-aplus-tests.spec new file mode 100644 index 0000000..4829c51 --- /dev/null +++ b/nodejs-promises-aplus-tests.spec @@ -0,0 +1,86 @@ +%{?nodejs_find_provides_and_requires} + +%global packagename promises-aplus-tests +%global enable_tests 1 + +Name: nodejs-promises-aplus-tests +Version: 2.1.2 +Release: 1 +Summary: Compliance test suite for Promises/A+ + +License: WTFPL +URL: https://github.com/promises-aplus/promises-tests.git +Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz +#git clone https://github.com/promises-aplus/promises-tests.git +#cd promises-tests +#git archive --prefix='tests/' --format=tar ${gittag}:tests/ \ +# | bzip2 > "$pwd"/tests-${tag}.tar.bz2 +Source1: tests-%{version}.tar.bz2 +#git archive --prefix='scripts/' --format=tar ${gittag}:scripts/ \ +# | bzip2 > "$pwd"/scripts-${tag}.tar.bz2 +Source2: scripts-%{version}.tar.bz2 + +# Grab the readme, as it isn't in the npm tarball +Source11: https://raw.githubusercontent.com/promises-aplus/promises-tests/%{version}/README.md + +BuildArch: noarch +ExclusiveArch: %{nodejs_arches} noarch + +BuildRequires: nodejs-packaging npm(underscore) +%if 0%{?enable_tests} +BuildRequires: mocha +%endif + +%description +Compliance test suite for Promises/A+ + + +%prep +%setup -q -n package +# setup the tests and scripts +%setup -q -T -D -a 1 -n package +%setup -q -T -D -a 2 -n package +# copy the readme +cp -p %{SOURCE11} . + +chmod +x ./lib/cli.js + +%nodejs_fixdep mocha +%nodejs_fixdep underscore '^1.8.3' + +%build +%{__nodejs} ./scripts/generateTestFiles.js + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} +cp -pr package.json lib/ \ + %{buildroot}%{nodejs_sitelib}/%{packagename} + +mkdir -p %{buildroot}%{_bindir} +ln -sf %{nodejs_sitelib}/%{packagename}/lib/cli.js \ + %{buildroot}%{_bindir}/promises-aplus-tests + +%nodejs_symlink_deps + +%check +%nodejs_symlink_deps --check +%{__nodejs} -e 'require("./")' +%if 0%{?enable_tests} +%{_bindir}/mocha -R spec +%else +%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" +%endif + + +%files +%{!?_licensedir:%global license %doc} +%doc *.md +%license LICENSE.txt +%{nodejs_sitelib}/%{packagename} +%{_bindir}/promises-aplus-tests + + + +%changelog +* Wed Aug 19 2020 wangxiao - 2.1.2-1 +- package init diff --git a/nodejs-promises-aplus-tests.yaml b/nodejs-promises-aplus-tests.yaml new file mode 100644 index 0000000..5423e3f --- /dev/null +++ b/nodejs-promises-aplus-tests.yaml @@ -0,0 +1,5 @@ +git_url: https://github.com/promises-aplus/promises-tests +version_control: github +src_repo: promises-aplus/promises-tests +tag_prefix: "" +seperator: "." diff --git a/promises-aplus-tests-2.1.2.tgz b/promises-aplus-tests-2.1.2.tgz new file mode 100644 index 0000000..67a20cb Binary files /dev/null and b/promises-aplus-tests-2.1.2.tgz differ diff --git a/scripts-2.1.2.tar.bz2 b/scripts-2.1.2.tar.bz2 new file mode 100644 index 0000000..24259de Binary files /dev/null and b/scripts-2.1.2.tar.bz2 differ diff --git a/tests-2.1.2.tar.bz2 b/tests-2.1.2.tar.bz2 new file mode 100644 index 0000000..d653a30 Binary files /dev/null and b/tests-2.1.2.tar.bz2 differ