# Description: Apache HTTP server version 2.4.x
# Maintainer: Juergen Daubert, jue at crux dot nu
# URL: https://httpd.apache.org/
# Depends on: apr-util libnghttp2 libpcre2 libxml2 openssl

name=apache
version=2.4.59
release=1
source=(https://www.apache.org/dist/httpd/httpd-$version.tar.bz2 \
	crux.layout apache)

build(){
	cd httpd-$version

	cat $SRC/crux.layout >> config.layout
	sed -ri '/^(User|Group)/s/daemon/www/' docs/conf/httpd.conf.in

	./configure \
		--enable-layout=CRUX \
		--with-apr=/usr \
		--with-apr-util=/usr \
		--with-pcre=/usr \
		--enable-so \
		--enable-modules=all \
		--enable-mods-shared=all \
		--enable-mpms-shared=all \
		--disable-lua
	make 
	make -j1 DESTDIR=$PKG install

	install -D -m 755 $SRC/apache $PKG/etc/rc.d/apache

	rm -r $PKG/var/www/htdocs/*
	rm -r $PKG/run
	rm $PKG/var/www/{error,icons}/README*

	chmod -R g-s $PKG/var/www/
}
