updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / php-xcache / PKGBUILD
blob43aa1b76020ee7b945a79815c776cf253c3e1eb4
1 # $Id$
2 # Maintainer: Thomas Martin Klein <kleintamasmarton@gmail.com> (Dino Krtanjek <krtanjekdino@gmail.com>)
3 pkgname=php-xcache
4 pkgver=1.3.2
5 pkgrel=1
6 pkgdesc="A fast and stable PHP opcode cacher"
7 arch=('i686' 'x86_64')
8 url="http://xcache.lighttpd.net/"
9 license=('BSD')
10 depends=('php')
11 install=$pkgname.install
12 backup=('etc/php/conf.d/xcache.ini')
13 source=(http://xcache.lighttpd.net/pub/Releases/$pkgver/xcache-$pkgver.tar.gz
14                 'xcache.ini')
15 md5sums=('205e2209f24e18a6b0844a4b6c52f2e4'
16                 '579d19aaef125c763b0e5b56de8378ed')
17 _admindir=/srv/http/xcache-admin
19 build() {
20         cd "$srcdir/xcache-$pkgver"
21         phpize || return 1
22         ./configure --prefix=/usr --enable-xcache --enable-xcache-optimizer \
23         --enable-xcache-coverager || return 1
24         make || return 1
25         make INSTALL_ROOT=$pkgdir install || return 1
26         echo -e "\n"
27         msg "XCache administration panel:"
28         echo "
29 XCache has a admin panel written in php. The administration panel displays
30 useful information about cached scripts and memory usage. If u choose to
31 install it, it will be installed in the $_admindir directory. If you keep
32 your web documents elsewhere, just make a symlink (ln -s) to the $_admindir
33 directory. You could also copy the content of $_admindir to
34 the desired location, but then remember to manually copy the content again
35 on a package update.
37 NOTE: the administration is protected with a builtin http authentication
38 that does't always work. If you can't access the admin panel, try to
39 disable the authentification by setting xcache.admin.enable_auth to Off in
40 xcache.ini. However, this is not recommended, because then anybody can
41 access you're XCache admin panel. Try to set up some alternative
42 authentication approach.
44         install_admin=""
45         while [[ "$install_admin" != "y" && "$install_admin" != "n" ]]; do
46                 read -p "Include XCache admin panel in the package? [y/n] " -n 1 install_admin
47                 echo -e "\n"
48         done
49         if [ "$install_admin" == "y" ]; then
50                 mkdir -p "$pkgdir$_admindir/"
51                 install -Dm644 admin/* "$pkgdir$_admindir/"
52                 msg "The administration will be installed in $_admindir."
53         fi
54         install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
55         install -Dm644 $srcdir/xcache.ini "$pkgdir/etc/php/conf.d/xcache.ini"