Automatic import for version 20131014-1

This commit is contained in:
Rosa 2014-09-25 19:41:15 +04:00
commit 4bcf28d31e
4 changed files with 80 additions and 0 deletions

2
.abf.yml Normal file
View file

@ -0,0 +1,2 @@
sources:
"compiler-20131014.tar.gz": f5d3a782b30d0d2f102c4ce6264000ea6f21ed35

2
closure-compiler.sh Normal file
View file

@ -0,0 +1,2 @@
#!/bin/sh
exec java -jar /usr/share/java/closure-compiler.jar "$@"

45
closure-compiler.spec Normal file
View file

@ -0,0 +1,45 @@
Summary: Closure Compiler - JavaScript compressor
Name: closure-compiler
Version: 20131014
Release: 1
License: Apache License
Group: Development/Tools
Url: http://closure-compiler.appspot.com/
# Source0Download: https://code.google.com/p/closure-compiler/downloads/list
Source0: http://closure-compiler.googlecode.com/files/compiler-%{version}.tar.gz
# Source0-md5: 37e8eb83d3fe271a002f41e7c2d1e2d7
Source1: %{name}.sh
Source2: get-source.sh
BuildArch: noarch
%description
The Closure Compiler is a tool for making JavaScript download and run
faster. It is a true compiler for JavaScript. Instead of compiling
from a source language to machine code, it compiles from JavaScript to
better JavaScript. It parses your JavaScript, analyzes it, removes
dead code and rewrites and minimizes what's left. It also checks
syntax, variable references, and types, and warns about common
JavaScript pitfalls.
%files
%doc README
%{_bindir}/%{name}
%{_javadir}/*.jar
#----------------------------------------------------------------------------
%prep
%setup -qc
chmod 0644 README
%build
%install
mkdir -p %{buildroot}%{_bindir}
install -m 0755 %{SOURCE1} %{buildroot}%{_bindir}/%{name}
# jars
mkdir -p %{buildroot}%{_javadir}
install -m 0644 compiler.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
ln -s %{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar

31
get-source.sh Normal file
View file

@ -0,0 +1,31 @@
#!/bin/sh
p=closure-compiler
fn=compiler
svn=http://$p.googlecode.com/svn/trunk
dl=https://code.google.com/p/$p/downloads/list?can=3
set -x
set -e
html() {
if [ -z "$html" ]; then
html=$(lynx -width 1200 -dump -nolist "$dl")
fi
echo "$html" | tee debug.log
}
rev=$(html | perl -ne '/'$fn'-.+tar.*Buil[dt] at r?(\d+)/and print $1 and exit')
test -n "$rev"
date=$(html | perl -ne '/'$fn'-(\d+).tar.gz.*Buil[dt] at r?'$rev'/and print $1')
test -n "$date"
d=$p-$date
if [ ! -d "$d" ]; then
svn export -q $svn@$rev $p-$date
fi
t=$d.tar.bz2
if [ ! -f "$t" ]; then
tar -cjf $t --exclude-vcs $d
fi