From 588e550ae8ef0bd54e58c8b6c217977d2e6a4bbd Mon Sep 17 00:00:00 2001 From: Ben Rosser Date: Aug 29 2019 02:50:14 +0000 Subject: Unorphan nodeunit. Switch to maintained nodeunit-x fork. --- diff --git a/.gitignore b/.gitignore index cc6a5e0..2e5b569 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /nodeunit-0.8.6.tgz /nodeunit-0.9.1.tgz +/nodeunit-x-0.13.0.tgz diff --git a/nodeunit.spec b/nodeunit.spec index cc8d261..df0074d 100644 --- a/nodeunit.spec +++ b/nodeunit.spec @@ -1,39 +1,32 @@ -%{?nodejs_find_provides_and_requires} - %global enable_tests 1 +# This package is now a fork, nodeunit-x, maintained by the grunt team. +# The original nodeunit was deprecated for good (?) last year. + Name: nodeunit -Version: 0.9.1 -Release: 11%{?dist} +Version: 0.13.0 +Release: 1%{?dist} Summary: Easy asynchronous unit testing framework for Node.js + License: MIT -URL: https://github.com/caolan/nodeunit -Source0: https://registry.npmjs.org/nodeunit/-/nodeunit-%{version}.tgz -Patch0: %{name}-0.8.6-Load-system-modules.patch -Patch1: %{name}-0.8.6-Use-system-assert.js.patch -Patch2: %{name}-0.9.1-Use-newer-should.patch -Patch3: %{name}-0.9.1-Use-fs-stat.patch +URL: https://github.com/gruntjs/nodeunit-x +Source0: https://registry.npmjs.org/nodeunit-x/-/nodeunit-x-%{version}.tgz BuildArch: noarch -%if 0%{?fedora} >= 19 ExclusiveArch: %{nodejs_arches} noarch -%else -ExclusiveArch: %{ix86} x86_64 %{arm} noarch -%endif BuildRequires: nodejs-packaging %if 0%{?enable_tests} -BuildRequires: coffee-script -BuildRequires: expresso -BuildRequires: npm(async) -BuildRequires: npm(console.log) BuildRequires: npm(ejs) -BuildRequires: npm(paperboy) BuildRequires: npm(should) BuildRequires: npm(tap) %endif +# I'm not sure about doing this, but for backwards compatibility I think +# it probably makes sense for nodeunit to claim to be both nodeunit + nodeunit-x? +Provides: npm(nodeunit) = %{version} + %description Nodeunit provides an easy asynchronous unit testing framework for Node.js: - helps you avoid common pitfalls when testing asynchronous code @@ -42,66 +35,53 @@ Nodeunit provides an easy asynchronous unit testing framework for Node.js: - built-in support for HTML and jUnit XML - allows the use of mocks and stubs +This package ship nodeunit-x, the maintained release for the gruntjs project, +as it is more active than the original upstream project. %prep -%setup -q -n package -# Remove bundled dependencies -rm -rf deps/ -rm -f lib/assert.js -# The requires need to be amended to use the unbundled dependencies. -%patch0 -p1 -%patch1 -p1 -# Fix some tests for changes in npm(should) -%patch2 -p1 -# Fix use of path.exists in tests -%patch3 -p1 - -%nodejs_fixdep async '^1.5.0' -%nodejs_fixdep console.log '~0.1' -%nodejs_fixdep ejs '~1.0' +%autosetup -n package + +# tap is *horrendously* out of date in Fedora. The current package is 0.7... +# the latest release is 14. +# ejs is less terribly out of date but still bad. %nodejs_fixdep tap +%nodejs_fixdep ejs +# deps/json2.js is not actually used. +rm deps/json2.js +# the other modules (async and assert) that are "bundled" +# are actually forks of bundled modules. %build #nothing to do - %install mkdir -p %{buildroot}%{nodejs_sitelib}/nodeunit -cp -pr package.json index.js lib/ \ - %{buildroot}%{nodejs_sitelib}/nodeunit -install -p -D -m0755 bin/nodeunit \ - %{buildroot}%{nodejs_sitelib}/nodeunit/bin/nodeunit +cp -pr package.json index.js lib/ %{buildroot}%{nodejs_sitelib}/nodeunit +install -p -D -m0755 bin/nodeunit %{buildroot}%{nodejs_sitelib}/nodeunit/bin/nodeunit mkdir -p %{buildroot}%{_bindir} -ln -sf %{nodejs_sitelib}/nodeunit/bin/nodeunit \ - %{buildroot}%{_bindir}/nodeunit +ln -sf %{nodejs_sitelib}/nodeunit/bin/nodeunit %{buildroot}%{_bindir}/nodeunit -install -p -D -m0644 man1/nodeunit.1 \ - %{buildroot}%{_mandir}/man1/nodeunit.1 +install -p -D -m0644 man1/nodeunit.1 %{buildroot}%{_mandir}/man1/nodeunit.1 # Put non-javascript arch independent files in _datadir to comply with Node.js # packaging guidelines. mkdir -p %{buildroot}%{_datadir}/nodeunit/bin -install -p -D -m0644 bin/nodeunit.json \ - %{buildroot}%{_datadir}/nodeunit/bin/nodeunit.json +install -p -D -m0644 bin/nodeunit.json %{buildroot}%{_datadir}/nodeunit/bin/nodeunit.json cp -pr share/ %{buildroot}%{_datadir}/nodeunit mkdir -p %{buildroot}%{nodejs_sitelib}/nodeunit/bin -ln -sf %{_datadir}/nodeunit/bin/nodeunit.json \ - %{buildroot}%{nodejs_sitelib}/nodeunit/bin/nodeunit.json -ln -sf %{_datadir}/nodeunit/share \ - %{buildroot}%{nodejs_sitelib}/nodeunit/share - +ln -sf %{_datadir}/nodeunit/bin/nodeunit.json %{buildroot}%{nodejs_sitelib}/nodeunit/bin/nodeunit.json +ln -sf %{_datadir}/nodeunit/share %{buildroot}%{nodejs_sitelib}/nodeunit/share %nodejs_symlink_deps - %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} # Fails in Koji rm -f test/test-httputil.js -%__nodejs ./bin/nodeunit test --reporter tap +%__nodejs ./bin/nodeunit test %else %{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif @@ -117,6 +97,9 @@ rm -f test/test-httputil.js %changelog +* Mon Aug 26 2019 Ben Rosser - 0.13.0-1 +- Switched package to point at nodeunit-x and update to latest release. + * Thu Jul 25 2019 Fedora Release Engineering - 0.9.1-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild diff --git a/sources b/sources index 0aac8fc..c23878b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -473d3dbc4a6e56345c8c6fd80a54325d nodeunit-0.9.1.tgz +SHA512 (nodeunit-x-0.13.0.tgz) = eb8019acbfb725a88b9bbe8a72532566eda2d18294d748bc238990cc446ab3c5dfed482aa10e42b973c99b1e1cfb1f1dba2c1ab5e819fa0d8340234e46e1972c