summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3cfc053b499d4fe8211fff925e9cf773dc19095d (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
# Maintainer: wolftankk <wolftankk@gmail.com>
pkgname=zephir
pkgver=0.10.7
pkgrel=1
pkgdesc="Zephir is a compiled high level language aimed to the creation of C-extensions for PHP http://zephir-lang.com/"
url="https://github.com/phalcon/zephir"
arch=('x86_64' 'i686')
license=('MIT')
depends=('re2c' 'json-c' 'php-zephir-parser')
makedepends=('php' 'gcc' 'pcre')
backup=('etc/php/conf.d/zephir.ini')

if [[ $CARCH = "i686" ]]; then
  makedepends+=('lib32-pcre');
fi

source=(
	"https://github.com/phalcon/zephir/archive/$pkgver.tar.gz"
)

sha256sums=('b8402d971908e1e64b8b0e24bb5729bb142ea68824b8c754a6de9b91074693d3')

package() {
  ZEPHIRDIR=/opt/$pkgname
  cd "$srcdir/zephir-$pkgver"
  sed "s#%ZEPHIRDIR%#$ZEPHIRDIR#g" bin/zephir > bin/zephir-cmd

  #init
  install -d $pkgdir/{$ZEPHIRDIR,usr/bin}

  install -Dm777 bin/zephir-cmd "$pkgdir"/opt/zephir/bin/zephir
  install -Dm777 compiler.php "$pkgdir"/opt/zephir/compiler.php
  install -Dm777 bootstrap.php "$pkgdir"/opt/zephir/bootstrap.php
  cp -a kernels "$pkgdir"/opt/zephir/kernels
  cp -a Library "$pkgdir"/opt/zephir/Library
  cp -a prototypes "$pkgdir"/opt/zephir/prototypes
  cp -a runtime "$pkgdir"/opt/zephir/runtime
  cp -a templates "$pkgdir"/opt/zephir/templates

  ln -s /opt/zephir/bin/zephir $pkgdir/usr/bin/zephir

  echo open_basedir=$(php -r "echo ini_get('open_basedir');"):/opt/zephir > zephir.ini
  install -Dm644 zephir.ini "$pkgdir"/etc/php/conf.d/zephir.ini

  if [ -d "/usr/share/bash-completion/completions" ]; then
      install -Dm644 bin/bash_completion "$pkgdir"/usr/share/bash-completion/completions/zephir
  fi

  msg2 "Please add '/opt/zephir' into 'open_basedir' in 'php.ini'"
}