Last active
August 29, 2015 14:03
-
-
Save tommie/94e64ca647da38df0530 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maintainer: Alexander Rødseth <[email protected]> | |
# Contributor: Richard Hoffman <[email protected]> | |
# Contributor: Max <[email protected]> | |
pkgname=google-appengine-go | |
pkgver=1.9.6 | |
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') | |
optdepends=('mysql-python: MySQL support for Python 2' | |
'python2-imaging: Image processing capabilities for Python') | |
if [[ $CARCH != i686 ]]; then | |
_zipname="go_appengine_sdk_linux_amd64-$pkgver.zip" | |
sha1sums=('4e9afab288106ea7405a53a093c1f8841a21ab38') | |
else | |
_zipname="go_appengine_sdk_linux_386-$pkgver.zip" | |
sha1sums=('f29f2031c4a2180696201b677ddcfc64fbd5b49a') | |
fi | |
source=("https://commondatastorage.googleapis.com/appengine-sdks/featured/$_zipname") | |
# Create a wrapper script in /usr/bin/ to execute something | |
# in /opt/google-appengine-go/. | |
_mkwrapperscript() { | |
local src="$1" dest="${2:-${1%.py}-go}" | |
echo -e "#!/bin/sh\nexec /opt/google-appengine-go/$src"' "$@"' \ | |
> "$pkgdir/usr/bin/$dest" | |
chmod 755 "$pkgdir/usr/bin/$dest" | |
} | |
build() { | |
local _srcdir="$srcdir/go_appengine" | |
# All scripts use "#!/usr/bin/env python" | |
# They are Python 2 scripts, so enforce that. | |
msg2 "Forcing use of python2 in executables..." | |
find "$_srcdir" -type f -executable \ | |
-exec sed -ri '1 s:(#!/.*)python([^2].+)?$:\1python2\2:' {} \; | |
# Other is ---, so we need to fix that. | |
# Group seems to be set correctly, so just copy from there. | |
msg2 "Allowing world readability..." | |
find "$_srcdir" -exec chmod o=g {} \; | |
} | |
package() { | |
local _srcdir="$srcdir/go_appengine" | |
install -d "$pkgdir/opt" | |
cp -a "$_srcdir" "$pkgdir/opt/$pkgname" | |
msg2 "Installing executables..." | |
install -d "$pkgdir/usr/bin" | |
_mkwrapperscript appcfg.py | |
_mkwrapperscript dev_appserver.py | |
_mkwrapperscript goapp goapp | |
msg2 "Copying LICENSE file..." | |
install -Dm644 "$_srcdir/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" | |
} | |
# vim:set ts=2 sw=2 et: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment