#Maintainer: Thorsten Muehlfelder <thenktor@gmx.de>

pkgname=cherokee
pkgver=0.99.29
pkgrel=1tm
arch=i486
source=("http://www.cherokee-project.com/download/0.99/$pkgver/cherokee-$pkgver.tar.gz" "rc.cherokee" "README.Slackware")
docs=('AUTHORS' 'COPYING' 'README' 'README.Slackware' 'TODO' 'NEWS' 'ChangeLog')
url="http://www.cherokee-project.com/"
dotnew=('etc/cherokee/cherokee.conf' 'var/www/htdocs/index.html')
options=('noautodotnew')

# deps: cyrus-sasl,mysql,openldap-client,openssl|openssl-solibs,pcre,zlib
# sugs (needed for streaming plugin): bzip2,cxxlibs|gcc-g++,ffmpeg,gcc,lame,libX11,libXau,libXdmcp,libogg,liboil,libtheora,libvorbis,libxcb,schroedinger,speex,x264,xvidcore


slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"$pkgname (a very fast HTTP server)"
"Cherokee is a very fast, flexible and easy to configure Web Server. It"
"supports the widespread technologies nowadays: FastCGI, SCGI, PHP,"
"CGI, TLS and SSL encrypted connections, Virtual hosts, Authentication,"
"on the fly encoding, Apache compatible log files, and much more."
""
"Make sure you read the documentation about how to set this up,"
"especially the info about creating $pkgname user and groups in"
"/usr/doc/$pkgname-$pkgver/README.Slackware"
)

build() {
	cd $startdir/src/${pkgname}-$pkgver
	./configure --prefix=/usr  --libdir=/usr/lib${LIBDIRSUFFIX} --sysconfdir=/etc \
		--localstatedir=/var \
		--docdir=/usr/doc/cherokee-$pkgver \
		--with-gnu-ld \
		--with-wwwroot=/var/www/htdocs \
		--disable-static \
		--enable-os-string="Salix OS" || return 1
	make -j3 || return 1
	make DESTDIR=$startdir/pkg install || return 1

	# create ssl dir
	mkdir -p $startdir/pkg/etc/cherokee/ssl/

	# rc script
	cd $startdir/src/
	mkdir -p $startdir/pkg/etc/rc.d/
	install -m 755 rc.cherokee $startdir/pkg/etc/rc.d/
}