# Maintainer: Phillip Smith <fukawi2@NOSPAM.gmail.com
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: tobias <tobias@archlinux.org>
# Contributor: Manolis Tzanidakis <manolis@archlinux.org>
# Contributor: Simon Lackerbauer <calypso "at"   strpg.org> 

pkgname=phpmyadmin
pkgver=3.2.5
pkgrel=1
pkgdesc="A PHP and hence web-based tool to administrate MySQL over the WWW"
arch=('any')
url="http://www.phpmyadmin.net"
license=('GPL')
depends=('mysql-clients' 'php')
optdepends=('libmcrypt: to use phpMyAdmin internal authentication')
backup=("srv/http/$pkgname/.htaccess" "srv/$pkgname/config.inc.php")
source=("http://downloads.sourceforge.net/sourceforge/${pkgname}/phpMyAdmin-$pkgver-all-languages.tar.bz2")
md5sums=('6083ea867a152f58f5c332d0c9b92ac1')

build() {
  msg "Nothing to compile for $pkgname"
}

package() {
  _INSTDIR="$pkgdir/srv/http/$pkgname"
  
  # Create destination directory
  mkdir -p -m755 $_INSTDIR
  
  cp -ra $srcdir/phpMyAdmin-${pkgver}-all-languages/* $_INSTDIR || return 1

  cat > $_INSTDIR/.htaccess <<EOF
deny from all
allow from 127.0.0.0/8
EOF
  
  # apache config
  mkdir -p $pkgdir/etc/httpd/conf/extra/
  cat > $pkgdir/etc/httpd/conf/extra/$pkgname.conf <<EOF
Alias /$pkgname "$_INSTDIR"
<Directory "$_INSTDIR">
  AllowOverride All
	Options FollowSymlinks
	Order allow,deny
	Allow from all
</Directory>
EOF
}

# vim:set ts=2 sw=2 et:
