commit 4bcf28d31ede0c22c46edffccde520968a9f04fd Author: Rosa Date: Thu Sep 25 19:41:15 2014 +0400 Automatic import for version 20131014-1 diff --git a/.abf.yml b/.abf.yml new file mode 100644 index 0000000..416ce78 --- /dev/null +++ b/.abf.yml @@ -0,0 +1,2 @@ +sources: + "compiler-20131014.tar.gz": f5d3a782b30d0d2f102c4ce6264000ea6f21ed35 diff --git a/closure-compiler.sh b/closure-compiler.sh new file mode 100644 index 0000000..3641d33 --- /dev/null +++ b/closure-compiler.sh @@ -0,0 +1,2 @@ +#!/bin/sh +exec java -jar /usr/share/java/closure-compiler.jar "$@" diff --git a/closure-compiler.spec b/closure-compiler.spec new file mode 100644 index 0000000..1efe5b0 --- /dev/null +++ b/closure-compiler.spec @@ -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 + diff --git a/get-source.sh b/get-source.sh new file mode 100644 index 0000000..ca54780 --- /dev/null +++ b/get-source.sh @@ -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