!1 add package

Merge pull request !1 from 付安安/master
This commit is contained in:
openeuler-ci-bot 2020-09-08 20:48:50 +08:00 committed by Gitee
commit fe6ba754c4
4 changed files with 82 additions and 0 deletions

View File

@ -0,0 +1,42 @@
commit 2a9727fa15ef3ab823d9b4daad4395c0bc6c0840
Author: Tom Hughes <tom@compton.nu>
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 = ''

View File

@ -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 <fuanan3@huawei.com> - 0.2.10-1
- package init

View File

@ -0,0 +1,4 @@
version_control: github
src_repo: tim-smart/node-closure
tag_prefix: "^v"
seperator: "."

BIN
v0.2.10.tar.gz Normal file

Binary file not shown.