]> git.pld-linux.org Git - packages/closure-compiler.git/commitdiff
- add script to build source package auto/th/closure-compiler-20110811-1
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 25 Aug 2011 14:29:37 +0000 (14:29 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    closure-compiler.spec -> 1.7
    get-source.sh -> 1.1

closure-compiler.spec
get-source.sh [new file with mode: 0644]

index 8e533300315cc52e46e99cd2f3df035ceab56bad..0b6ce66afb8a1d398ba8d31bca6a68a98bf50e01 100644 (file)
@@ -1,5 +1,5 @@
 # TODO
-# - build from source
+# - build from source (get-source.sh fetches it)
 
 %include       /usr/lib/rpm/macros.java
 Summary:       Closure Compiler - JavaScript compressor
@@ -11,6 +11,7 @@ Group:                Applications/WWW
 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
diff --git a/get-source.sh b/get-source.sh
new file mode 100644 (file)
index 0000000..0ab1dd0
--- /dev/null
@@ -0,0 +1,27 @@
+#!/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
This page took 0.086272 seconds and 4 git commands to generate.