1 # Maintainer: Alexander Rødseth <rodseth@gmail.com>
2 # Contributor: Richard Hoffman <coverslide@gmail.com>
3 pkgname=google-appengine-go
6 pkgdesc="Google App Engine SDK for Go"
8 depends=("python2>=2.7")
9 url="http://code.google.com/appengine/downloads.html#Google_App_Engine_SDK_for_Go"
12 if [ $CARCH != "i686" ]; then
13 source=("http://googleappengine.googlecode.com/files/go_appengine_sdk_linux_amd64-$pkgver.zip")
14 sha256sums=('73087d6cbc099dae1e2bb2b0b6c0a7bda9b5efcbe82b0311ac1ef3d17562a299')
16 source=("http://googleappengine.googlecode.com/files/go_appengine_sdk_linux_386-$pkgver.zip")
17 sha256sums=('923da3f24621ed6dc6d561d3d018ee56725a4684f70a4034580ee7a5aa33e73b')
21 cd "$srcdir/google_appengine"
23 msg2 "Correcting file permissions..."
24 # Only make the .py files executable
25 find . -type f -exec chmod 644 '{}' \;
26 chmod +x *.py goroot/bin/*
30 if [ "$f" != "dev_appserver.py" ]; then
31 msg2 "Creating wrapperscript for $f [`basename $f .py`-go]..."
32 echo -e "#!/bin/sh\npython2 /opt/google-appengine-go/$f \$*" \
33 > "$srcdir/`basename $f .py`-go"
35 msg2 "Creating wrapperscript for $f [appserver]..."
36 echo -e "#!/bin/sh\npython2 /opt/google-appengine-go/$f \$*" \
39 msg2 "Modifying script to use Python 2"
40 sed -i '0,/on/s//on2/' $f
45 cd "$srcdir/google_appengine"
47 msg2 "Packaging files..."
49 cp -R "./" "$pkgdir/opt/$pkgname"
51 msg2 "Creating a symbolic link for the python modules..."
52 mkdir -p "$pkgdir/usr/lib/python2.7/site-packages"
53 ln -s "/opt/$pkgname/google" "$pkgdir/usr/lib/python2.7/site-packages/google"
55 msg2 "Packaging wrapperscripts..."
56 mkdir -p "$pkgdir/usr/bin"
57 install -Dm755 "$srcdir/appserver" "$pkgdir/usr/bin/appserver"
58 install -Dm755 $srcdir/*-go "$pkgdir/usr/bin/"
60 msg2 "Cleaning up deprecated files..."
61 rm -r "$pkgdir/opt/$pkgname/tools"
63 msg2 "Packaging license..."
64 install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
67 # vim:set ts=2 sw=2 et: