# 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.3.6
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/http/$pkgname/config.inc.php")
source=("http://downloads.sourceforge.net/sourceforge/${pkgname}/phpMyAdmin-$pkgver-all-languages.tar.bz2")
md5sums=('34937c99ed5ef5706c8a862f29234688')

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

package() {
  _INSTDIR="srv/http/$pkgname"
  
  # Create destination directory
  mkdir -p -m755 $pkgdir/$_INSTDIR
  
  cp -ra $srcdir/phpMyAdmin-${pkgver}-all-languages/* $pkgdir/$_INSTDIR
  touch $pkgdir/$_INSTDIR/config.inc.php

  cat > $pkgdir/$_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:
