diff --git a/nodejs-closure-compiler-invoke.patch b/nodejs-closure-compiler-invoke.patch new file mode 100644 index 0000000..5456c91 --- /dev/null +++ b/nodejs-closure-compiler-invoke.patch @@ -0,0 +1,42 @@ +commit 2a9727fa15ef3ab823d9b4daad4395c0bc6c0840 +Author: Tom Hughes +Date: Thu Apr 24 00:18:35 2014 +0100 + + Use closure-compiler wrapper script to get correct class path + +diff --git a/src/index.coffee b/src/index.coffee +index c9dea72..8a85770 100644 +--- a/src/index.coffee ++++ b/src/index.coffee +@@ -22,10 +22,7 @@ + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + spawn = require('child_process').spawn +-path = require 'path' + +-JAVA_PATH = exports.JAVA_PATH = 'java' +-JAR_PATH = exports.JAR_PATH = path.join __dirname, '../node_modules/google-closure-compiler/compiler.jar' + OPTIONS = exports.OPTIONS = {} + + exports.compile = (input, options, callback) -> +@@ -42,11 +39,6 @@ exports.compile = (input, options, callback) -> + + args = [] + +- if !options.jar +- options.jar = JAR_PATH +- +- args.push('-jar') +- args.push(options.jar) + delete options.jar + + Object.keys(options).forEach (key) -> +@@ -67,7 +59,7 @@ exports.compile = (input, options, callback) -> + if value != true + args.push value + +- compiler = spawn JAVA_PATH, args ++ compiler = spawn 'closure-compiler', args + stdout = '' + stderr = '' + diff --git a/nodejs-closure-compiler.spec b/nodejs-closure-compiler.spec new file mode 100644 index 0000000..50d4222 --- /dev/null +++ b/nodejs-closure-compiler.spec @@ -0,0 +1,36 @@ +Name: nodejs-closure-compiler +Version: 0.2.10 +Release: 1 +Summary: Bindings to Google's Closure Compiler for Node.js +License: MIT +URL: https://github.com/tim-smart/node-closure +Source0: https://github.com/tim-smart/node-closure/archive/v%{version}.tar.gz +Patch0: nodejs-closure-compiler-invoke.patch +BuildArch: noarch +ExclusiveArch: %{nodejs_arches} noarch +Requires: closure-compiler +BuildRequires: nodejs-packaging coffee-script +%description +A wrapper to the Google Closure compiler tool. It runs the jar file +in a child process and returns the results in a callback. + +%prep +%autosetup -n node-closure-%{version} -S git +%nodejs_fixdep -r google-closure-compiler +rm -rf node_modules lib/* + +%build +cake build + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/closure-compiler +cp -pr package.json lib %{buildroot}%{nodejs_sitelib}/closure-compiler +%nodejs_symlink_deps + +%files +%doc LICENSE.txt README.md +%{nodejs_sitelib}/closure-compiler + +%changelog +* Mon Aug 17 2020 Anan Fu - 0.2.10-1 +- package init diff --git a/nodejs-closure-compiler.yaml b/nodejs-closure-compiler.yaml new file mode 100644 index 0000000..28750e2 --- /dev/null +++ b/nodejs-closure-compiler.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: tim-smart/node-closure +tag_prefix: "^v" +seperator: "." diff --git a/v0.2.10.tar.gz b/v0.2.10.tar.gz new file mode 100644 index 0000000..dc52c6d Binary files /dev/null and b/v0.2.10.tar.gz differ