SUMMARY="an open-source web server for speed-critical environments"
DESCRIPTION="Security, speed, compliance, and flexibility -- all of these \
describe lighttpd (pron. lighty) which is rapidly redefining efficiency of a \
webserver; as it is designed and optimized for high performance environments. \
With a small memory footprint compared to other web-servers, effective \
management of the cpu-load, and advanced feature set (FastCGI, SCGI, Auth, \
Output-Compression, URL-Rewriting and many more) lighttpd is the perfect \
solution for every server that is suffering load problems.
"
HOMEPAGE="http://www.lighttpd.net/"
COPYRIGHT="2003-2014 Jan Kneschke"
REVISION="2"
ARCHITECTURES="x86_gcc2"
LICENSE="BSD (3-clause)"

SOURCE_URI="http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.35.tar.gz"
CHECKSUM_SHA256="62c23de053fd82e1bf64f204cb6c6e44ba3c16c01ff1e09da680d982802ef1cc"
PATCHES="lighttpd-1.4.35.patchset"

PROVIDES="
	lighttpd = $portVersion
	cmd:lighttpd
	cmd:lighttpd_angel
	lib:mod_access
	lib:mod_accesslog
	lib:mod_alias
	lib:mod_auth
	lib:mod_cgi
	lib:mod_cml
	lib:mod_compress
	lib:mod_dirlisting
	lib:mod_evasive
	lib:mod_evhost
	lib:mod_expire
	lib:mod_extforward
	lib:mod_fastcgi
	lib:mod_flv_streaming
	lib:mod_indexfile
	lib:mod_magnet
	lib:mod_mysql_vhost
	lib:mod_proxy
	lib:mod_redirect
	lib:mod_rewrite
	lib:mod_rrdtool
	lib:mod_scgi
	lib:mod_secdownload
	lib:mod_setenv
	lib:mod_simple_vhost
	lib:mod_ssi
	lib:mod_staticfile
	lib:mod_status
	lib:mod_trigger_b4_dl
	lib:mod_userdir
	lib:mod_usertrack
	lib:mod_webdav
"

REQUIRES="
	haiku
	lib:libbz2
	lib:libcrypto
	lib:libpcre
	lib:libssl
	lib:libz
"

BUILD_REQUIRES="
	devel:libbz2
	devel:libpcre
	devel:libssl
	devel:libz
"

BUILD_PREREQUIRES="
	haiku_devel
	cmd:aclocal
	cmd:autom4te
	cmd:automake
	cmd:awk
	cmd:gcc
	cmd:git
	cmd:make
	cmd:perl
	cmd:pkg_config
	cmd:which
"

BUILD()
{
	aclocal
	automake
	runConfigure ./configure --with-openssl
	make $jobArgs
}

INSTALL()
{
	make install

	prepareInstalledDevelLibs mod_access mod_accesslog mod_alias mod_auth \
		mod_cgi mod_cml mod_compress mod_dirlisting mod_evasive mod_evhost \
		mod_expire mod_extforward mod_fastcgi mod_flv_streaming mod_indexfile \
		mod_magnet mod_mysql_vhost mod_proxy mod_redirect mod_rewrite \
		mod_rrdtool mod_scgi mod_secdownload mod_setenv mod_simple_vhost \
		mod_ssi mod_staticfile mod_status mod_trigger_b4_dl mod_userdir \
		mod_usertrack mod_webdav
	
	packageEntries devel $developDir
}

TEST()
{
	make check
}

PROVIDES_devel="
	lighttpd_devel = $portVersion
	devel:mod_access
	devel:mod_accesslog
	devel:mod_alias
	devel:mod_auth
	devel:mod_cgi
	devel:mod_cml
	devel:mod_compress
	devel:mod_dirlisting
	devel:mod_evasive
	devel:mod_evhost
	devel:mod_expire
	devel:mod_extforward
	devel:mod_fastcgi
	devel:mod_flv_streaming
	devel:mod_indexfile
	devel:mod_magnet
	devel:mod_mysql_vhost
	devel:mod_proxy
	devel:mod_redirect
	devel:mod_rewrite
	devel:mod_rrdtool
	devel:mod_scgi
	devel:mod_secdownload
	devel:mod_setenv
	devel:mod_simple_vhost
	devel:mod_ssi
	devel:mod_staticfile
	devel:mod_status
	devel:mod_trigger_b4_dl
	devel:mod_userdir
	devel:mod_usertrack
	devel:mod_webdav
"

REQUIRES_devel="
	lighttpd == $portVersion base
"
