summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 706142d1541632604599501185e37e439f18b530 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Maintainer: Benjamin Denhartog <ben@sudoforge.com>
# Contributor: Joshua Marsh <joshua@themarshians.com>
# Contributor: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Richard Hoffman <coverslide@gmail.com>
# Contributor: Max <fuzymonkey@gmail.com>

# For ISSUES, REQUESTS, and QUESTIONS:
# https://github.com/sudoforge/pkgbuilds

pkgname=google-appengine-go
pkgver=1.9.48
pkgrel=2
pkgdesc='Google App Engine SDK for Go'
arch=('x86_64' 'i686')
depends=('python2')
url='http://code.google.com/appengine/downloads.html#Google_App_Engine_SDK_for_Go'
license=('APACHE')
options=('!strip' 'staticlibs')
makedepends=('unzip')
optdepends=('mysql-python: MySQL support for Python 2'
            'python2-imaging: Image processing capabilities for Python')
source_i686=("https://commondatastorage.googleapis.com/appengine-sdks/featured/go_appengine_sdk_linux_386-$pkgver.zip")
source_x86_64=("https://commondatastorage.googleapis.com/appengine-sdks/featured/go_appengine_sdk_linux_amd64-$pkgver.zip")
sha1sums_x86_64=('d8f94d4f8c03dec058b3235b3f0248b90475cdf9')
sha1sums_i686=('3b725827b577fb58ca535f328b519b32ce2af7aa')

# Get the name of the zip file
_source=$(echo source_$CARCH)
noextract=("$(basename ${!_source})")

prepare() {
  unzip -q "$noextract"
}

build() {
  cd 'go_appengine'

  # This is to avoid name conflicts in /usr/bin with other appengine packages
  for f in *.py
  do
    msg2 "Generating wrapper script for $f named `basename $f .py`-go"
    echo -e "#!/bin/sh\npython2 /opt/google-appengine-go/$f \$*" \
      > "$srcdir/`basename $f .py`-go"
    # Modifying script to use Python 2
	  sed -i '0,/on/s//on2/' $f
  done
}

package() {
  cd 'go_appengine'

  install -d "$pkgdir/opt"
  cp -R "./" "$pkgdir/opt/$pkgname"

  install -d "$pkgdir/usr/lib/python2.7/site-packages"

  cp -r "$pkgdir/opt/$pkgname/google" "$pkgdir/usr/lib/python2.7/site-packages/google" 
  
  install -d "$pkgdir/usr/bin"
  install -Dm755 $srcdir/*-go "$pkgdir/usr/bin/"
  install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  ln -s "/opt/$pkgname/goapp" "$pkgdir/usr/bin/goapp"
}