diff --git a/fix-tests.patch b/fix-tests.patch new file mode 100644 index 0000000..16ad1e7 --- /dev/null +++ b/fix-tests.patch @@ -0,0 +1,11 @@ +--- test/parse.js.orig 2016-02-07 21:34:22.432551791 +0100 ++++ test/parse.js 2016-02-07 21:34:33.276669826 +0100 +@@ -2,7 +2,7 @@ + var path = require('path'); + var test = require('tap').test; + +-var $0 = 'node ./' + path.relative(process.cwd(), __filename); ++var $0 = '/usr/bin/node ./' + path.relative(process.cwd(), __filename); + + test('short boolean', function (t) { + var parse = optimist.parse([ '-b' ]); diff --git a/nodejs-optimist.spec b/nodejs-optimist.spec new file mode 100644 index 0000000..0e08e24 --- /dev/null +++ b/nodejs-optimist.spec @@ -0,0 +1,46 @@ +%{?nodejs_find_provides_and_requires} +%global bootstrap 0 +Name: nodejs-optimist +Version: 0.6.1 +Release: 1 +Summary: Light-weight option parsing for Node.js +BuildArch: noarch +License: MIT/X11 +URL: https://github.com/substack/node-optimist +Source0: https://registry.npmjs.org/optimist/-/optimist-%{version}.tgz +Patch0: fix-tests.patch +BuildRequires: nodejs-packaging +%if !0%{?bootstrap} +BuildRequires: npm(tap) npm(hashish) npm(wordwrap) +%endif +%description +Light-weight option parsing with an argv hash. No optstrings attached. + +%prep +%setup -q -n package +%patch0 -p0 +%nodejs_fixdep wordwrap +%nodejs_fixdep minimist + +%build + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/optimist +cp -pr package.json index.js %{buildroot}%{nodejs_sitelib}/optimist +%nodejs_symlink_deps + +%check +%nodejs_symlink_deps --check +%{__nodejs} -e 'require("./")' +%if !0%{?bootstrap} +tap test/*.js +%endif + +%files +%{nodejs_sitelib}/optimist +%doc readme.markdown example +%license LICENSE + +%changelog +* Mon Aug 17 2020 wutao - 0.6.1-1 +- Package init diff --git a/nodejs-optimist.yaml b/nodejs-optimist.yaml new file mode 100644 index 0000000..c05a394 --- /dev/null +++ b/nodejs-optimist.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: substack/node-optimist +tag_prefix: "^" +seperator: "." diff --git a/optimist-0.6.1.tgz b/optimist-0.6.1.tgz new file mode 100644 index 0000000..fd305cf Binary files /dev/null and b/optimist-0.6.1.tgz differ