diff --git a/nodejs-shelljs.spec b/nodejs-shelljs.spec new file mode 100644 index 0000000..c832eff --- /dev/null +++ b/nodejs-shelljs.spec @@ -0,0 +1,59 @@ +%{?nodejs_find_provides_and_requires} +%global enable_tests 1 +Name: nodejs-shelljs +Version: 0.7.3 +Release: 1 +Summary: Portable Unix shell commands for Node.js +License: BSD and MIT +URL: http://github.com/arturadib/shelljs +Source0: http://github.com/arturadib/shelljs/archive/v%{version}.tar.gz +Patch0: nodejs-shelljs_fix-tests.patch +BuildArch: noarch +ExclusiveArch: %{nodejs_arches} noarch +BuildRequires: nodejs-packaging +%if 0%{?enable_tests} +BuildRequires: coffee-script npm(glob) +%endif +%description +%{summary}. + +%prep +%autosetup -n shelljs-%{version} -S git +rm test/exec.js +sed -i '1s/env //' bin/shjs +%nodejs_fixdep glob + +%build + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/shelljs +cp -pr package.json global.js make.js shell.js src/ \ + %{buildroot}%{nodejs_sitelib}/shelljs +mkdir -p %{buildroot}%{nodejs_sitelib}/shelljs/bin +install -p -m0755 bin/shjs \ + %{buildroot}%{nodejs_sitelib}/shelljs/bin +mkdir -p %{buildroot}%{_bindir} +ln -sf %{nodejs_sitelib}/shelljs/bin/shjs \ + %{buildroot}%{_bindir}/shjs +%nodejs_symlink_deps + +%check +%nodejs_symlink_deps --check +%{__nodejs} -e 'require("./")' + +%if 0%{?enable_tests} +%__nodejs scripts/run-tests +%else +%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" +%endif + +%files +%{!?_licensedir:%global license %doc} +%license LICENSE +%doc README.md MAINTAINERS +%{nodejs_sitelib}/shelljs +%{_bindir}/shjs + +%changelog +* Fri Aug 21 2020 wangyue - 0.7.3-1 +- package init diff --git a/nodejs-shelljs.yaml b/nodejs-shelljs.yaml new file mode 100644 index 0000000..5395b73 --- /dev/null +++ b/nodejs-shelljs.yaml @@ -0,0 +1,5 @@ +git_url: https://github.com/arturadib/shelljs +version_control: github +src_repo: arturadib/shelljs +tag_prefix: "^" +seperator: "." diff --git a/nodejs-shelljs_fix-tests.patch b/nodejs-shelljs_fix-tests.patch new file mode 100644 index 0000000..351ae21 --- /dev/null +++ b/nodejs-shelljs_fix-tests.patch @@ -0,0 +1,12 @@ +diff --git a/scripts/run-tests.js b/scripts/run-tests.js +index 1b361da..a0be383 100755 +--- a/scripts/run-tests.js ++++ b/scripts/run-tests.js +@@ -10,6 +10,7 @@ var failed = false; + cd(__dirname + '/../test'); + ls('*.js').forEach(function(file) { + echo('Running test:', file); ++ if (file === "shjs.js") return; + if (exec(JSON.stringify(process.execPath)+' '+file).code !== 123) { // 123 avoids false positives (e.g. premature exit) + failed = true; + echo('*** TEST FAILED! (missing exit code "123")'); diff --git a/v0.7.3.tar.gz b/v0.7.3.tar.gz new file mode 100644 index 0000000..4a700d4 Binary files /dev/null and b/v0.7.3.tar.gz differ