updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / clojurescript-git / PKGBUILD
blob92df505e6c41a529dc90df25b2852575dde03cf8
1 #maintainer: kuno <neokuno AT gmail DOT com>
3 pkgname=clojurescript-git
4 _realname=clojurescript
5 pkgver=20120111
6 pkgrel=1
7 pkgdesc="Clojure to JS compiler"
8 arch=('i686' 'x86_64')
9 url="https://github.com/clojure/clojurescript"
10 license=('EPL')
11 groups=()
12 depends=('clojure' 'rhino' 'closure-compiler')
13 makedepends=('git' 'unzip' 'curl')
14 optdepends=()
15 provides=()
16 conflicts=()
17 replaces=()
18 backup=()
19 options=()
20 install=$pkgname.install
21 source=(clojurescript.sh)
22 noextract=()
23 #md5sums=() #generate with 'makepkg -g'
24 _gittrunk="git://github.com/clojure/clojurescript.git"
25 _gitmod=$_realname       
27 build() {
28   if [ -d $srcdir/$_gitmod-build ]; then
29      rm -rf $srcdir/$_gitmod-build
30   fi
32   cd $srcdir
33   #
34   msg "Connecting to the github...."
35   if [ ! -d $_gitmod/.git ]; then
36     git clone $_gittrunk $_gitmod
37   else
38     cd $_gitmod
39     git pull $_gittrunk
40   fi
42   cp -r $srcdir/$_gitmod $srcdir/$_gitmod-build
44   #
45   cd $srcdir/$_gitmod-build/
46   mkdir -p lib || return 1
48   #
49   echo "Fetching Google Closure library..."
50   mkdir -p closure/library
51   cd closure/library
52   curl -O -s http://closure-library.googlecode.com/files/closure-library-20111110-r1376.zip
53   unzip -qu closure-library-20111110-r1376.zip
54   echo "Cleaning up Google Closure library archive..."
55   rm closure-library-20111110-r1376.zip
57   cd $srcdir/$_gitmod-build/
58   echo "Building lib/goog.jar..."
59   echo "jar cf ./lib/goog.jar -C closure/library/closure/ goog"
60   jar cf ./lib/goog.jar -C closure/library/closure/ goog     
62   #
63   ln -s /usr/share/clojure/clojure.jar lib/clojure.jar 
64   #
65   ln -s /usr/share/java/closure-compiler/closure-compiler.jar lib/compiler.jar
66   #
67   ln -s /usr/share/java/js-1.7R3.jar lib/js.jar
70 package() {
71   mkdir -p $pkgdir/etc/profile.d
72   mkdir -p $pkgdir/opt/$_realname
74   cp -r $srcdir/$_gitmod-build/{bin,lib,src,test,script} $pkgdir/opt/$_realname/ || return 1
76   cp $_realname.sh $pkgdir/etc/profile.d || return 1
77   rm -rf $srcdir/$_gitmod-build
79 md5sums=('ba08df6fbefe09783bf04a150f555b22')