updated on Fri Jan 20 04:00:45 UTC 2012
[aur-mirror.git] / google-appengine-go / PKGBUILD
blobaf8eaec84da71d0a92477695a93b1bdb8fa46e3d
1 # Maintainer: Alexander Rødseth <rodseth@gmail.com>
2 # Contributor: Richard Hoffman <coverslide@gmail.com>
3 pkgname=google-appengine-go
4 pkgver=1.6.1
5 pkgrel=1
6 pkgdesc="Google App Engine SDK for Go"
7 arch=('x86_64' 'i686')
8 depends=("python2>=2.7")
9 url="http://code.google.com/appengine/downloads.html#Google_App_Engine_SDK_for_Go"
10 license=("Apache")
11 options=(!strip)
12 if [ $CARCH != "i686" ]; then
13         source=("http://googleappengine.googlecode.com/files/go_appengine_sdk_linux_amd64-$pkgver.zip")
14   sha256sums=('73087d6cbc099dae1e2bb2b0b6c0a7bda9b5efcbe82b0311ac1ef3d17562a299')
15 else
16         source=("http://googleappengine.googlecode.com/files/go_appengine_sdk_linux_386-$pkgver.zip")
17   sha256sums=('923da3f24621ed6dc6d561d3d018ee56725a4684f70a4034580ee7a5aa33e73b')
20 build() {
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/*
28   for f in *.py
29   do
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"
34     else
35       msg2 "Creating wrapperscript for $f [appserver]..."
36       echo -e "#!/bin/sh\npython2 /opt/google-appengine-go/$f \$*" \
37         > "$srcdir/appserver"
38     fi
39     msg2 "Modifying script to use Python 2"
40           sed -i '0,/on/s//on2/' $f
41   done
44 package() {
45   cd "$srcdir/google_appengine"
47   msg2 "Packaging files..."
48   mkdir "$pkgdir/opt"
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" 
54   
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: