Changed files:
closure-compiler.spec -> 1.7
get-source.sh -> 1.1
# TODO
-# - build from source
+# - build from source (get-source.sh fetches it)
%include /usr/lib/rpm/macros.java
Summary: Closure Compiler - JavaScript compressor
Source0: http://closure-compiler.googlecode.com/files/compiler-%{version}.tar.gz
# Source0-md5: 815d453b7c51657241d11307231a4037
Source1: %{name}.sh
+Source2: get-source.sh
URL: http://closure-compiler.appspot.com/
BuildRequires: rpm-javaprov
BuildRequires: rpmbuild(macros) >= 1.300
--- /dev/null
+#!/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
+
+html() {
+ if [ -z "$html" ]; then
+ html=$(lynx -width 1200 -dump -nolist "$dl")
+ fi
+ echo "$html"
+}
+
+rev=$(html | perl -nne '/'$fn'-latest.tar.gz.*Build at r(\d+)/and print $1')
+date=$(html | perl -ne '/'$fn'-(\d+).tar.gz.*Build at r'$rev'/and print $1')
+
+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