pkgname=webcalendar
pkgver=1.2.b1
pkgrel=11
pkgdesc="Web based calendar"
license="GPL"
arch=('i686')

url="http://www.k5n.us/webcalendar.php"
source=(http://voxel.dl.sourceforge.net/sourceforge/webcalendar/WebCalendar-1.2.b1.tar.gz config.php settings.php send_reminders.patch createdb.sql sendreminders.sh posix.tab)
depends="local-website"
install=webcal.install

build() {
cd $startdir/src
mkdir -p  $startdir/pkg/data/srv/httpd/htdocs/webcal
mkdir -p $startdir/pkg/usr/bin
cp $startdir/src/sendreminders.sh $startdir/pkg/usr/bin/
chmod 755 $startdir/pkg/usr/bin/sendreminders.sh

cp -rp  WebCalendar-$pkgver/* $startdir/pkg/data/srv/httpd/htdocs/webcal

cp createdb.sql $startdir/pkg/data/srv/httpd/htdocs/webcal/
cp  config.php $startdir/pkg/data/srv/httpd/htdocs/webcal/includes
cp  settings.php $startdir/pkg/data/srv/httpd/htdocs/webcal/includes
cp -f posix.tab $startdir/pkg/data/srv/httpd/htdocs/webcal/includes/zone.tab

cd $startdir/pkg/data/srv/httpd/htdocs/webcal/tools

patch -p0 < $startdir/src/send_reminders.patch

chmod 755 $startdir/pkg/data/srv/httpd/htdocs/webcal/tools/send_reminders.php


}