summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fcd52a39ddc8ddb89923f8eafd4d4eb0e65937fe (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
# Maintainer: Raphaƫl Doursenaud <rdoursenaud@gpcsolutions.fr>

pkgname=php55-appengine-git
_pkgbase="${pkgname#php55-}"
_phpbase="${pkgname#-appengine}"
_gitname="appengine-php-extension"
pkgver=r6.b40aa29
_PKGVER="$(echo "${pkgver}" | tr '[:lower:]' '[:upper:]')"
pkgrel=1
pkgdesc="php55 Google App Engine Extension"
arch=('i686' 'x86_64')
url="https://github.com/GoogleCloudPlatform/appengine-php-extension"
license=('Apache')
depends=('php55>=5.5' 'protobuf')
options=('!makeflags')
provides=("${_pkgbase}=${pkgver}-${pkgrel}" "php-${_pkgbase}=${pkgver}-${pkgrel}")
source=('git+https://github.com/GoogleCloudPlatform/appengine-php-extension.git')
sha512sums=('SKIP')

build() {
  cd "$srcdir"
  msg "Connecting to GIT server...."

  if [[ -d "$_gitname" ]]; then
    cd "$_gitname" && git pull origin master
    msg "The local files are updated."
  else
    git clone "$_gitroot" "$_gitname"
  fi

  msg "GIT checkout done or server timeout"
  msg "Starting build..."

  rm -rf "$srcdir/$_gitname-build"
  git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
  cd "$srcdir/$_gitname-build"

  protoc --cpp_out=. remote_api.proto
  protoc --cpp_out=. urlfetch_service.proto
  phpize55
  ./configure --prefix=/usr --enable-gae --with-protobuf_inc=/usr/include --with-protobuf_lib=/usr/lib
  make
}

pkgver() {
  cd "$srcdir/$_gitname"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package() {
  cd "$srcdir/$_gitname-build"
  make INSTALL_ROOT=$pkgdir install
}

check() {
  cd "$srcdir/$_gitname-build"
  make test
}