<?xml version="1.0"?>
<package name="httpd">
	<description>apache web server</description>
	<releases>
		<release version="2.4.66" revision="1">
			<deps>
				<dep name="apr"/>
				<dep name="apr-util"/>
				<dep name="libxml2"/>
				<dep name="logrotate"/>
				<dep name="mime-support"/>
				<dep name="openssl"/>
				<dep name="pcre"/>
			</deps>
			<preinst>
				<cmd>groupadd -f -g 24 httpd</cmd>
				<cmd check="no">useradd -u 24 -g httpd -d /home/www -c "Web Server" -s /bin/false httpd</cmd>
			</preinst>
			<build>
				<script>
					<archive name="httpd-$VERSION">
						<!-- fix build with libxml2 2.12, already upstream -->
						<cmd>sed -i -e 's/xmlChar\*/unsigned char*/' modules/filters/mod_xml2enc.c</cmd>

						<!-- use /run instead of /var/run -->
						<cmd>sed -i -e 's_/var/run_/run_g' config.layout</cmd>

						<!-- use UTF-8 for directory index pages -->
						<cmd>sed -i -e 's/ISO-8859-1/UTF-8/g' modules/generators/mod_autoindex.c</cmd>

						<cmd>./configure --enable-layout=Debian --enable-modules=all --enable-deflate --enable-ssl --enable-cgi --enable-so --enable-proxy --enable-proxy-http --disable-lua</cmd>
						<cmd>make</cmd>
						<cmd>make install</cmd>
						<cmd>mkdir -p /etc/apache2/conf.d</cmd>
						<cmd>mkdir -p $DOCDIR</cmd>
						<cmd>install -v /etc/apache2/original/extra/{httpd-*,proxy-html}.conf $DOCDIR</cmd>
						<cmd>rm -rf /etc/apache2/original</cmd>
						
						<cmd>install -d -o httpd -g httpd -m 0750 /home/www</cmd>

						<install name="modules-base.conf-20120608" dest="/usr/lib/apache2/conf.modules.d/00-base.conf"/>

						<install name="httpd.service-20101026" dest="/lib/systemd/system/httpd.service"/>
						<install name="tmpfiles-httpd-20120608" dest="/usr/lib/tmpfiles.d/httpd.conf"/>
					</archive>
				</script>
			</build>
			<config>
				<configfile name="httpd.conf-20120608" default="$DOCDIR/httpd.conf.paldo" dest="/etc/apache2/httpd.conf"/>
				<configfile default="$DOCDIR/httpd-autoindex.conf" dest="/etc/apache2/extra/httpd-autoindex.conf"/>
				<configfile default="$DOCDIR/httpd-dav.conf" dest="/etc/apache2/extra/httpd-dav.conf"/>
				<configfile default="$DOCDIR/httpd-default.conf" dest="/etc/apache2/extra/httpd-default.conf"/>
				<configfile default="$DOCDIR/httpd-info.conf" dest="/etc/apache2/extra/httpd-info.conf"/>
				<configfile default="$DOCDIR/httpd-languages.conf" dest="/etc/apache2/extra/httpd-languages.conf"/>
				<configfile default="$DOCDIR/httpd-manual.conf" dest="/etc/apache2/extra/httpd-manual.conf"/>
				<configfile default="$DOCDIR/httpd-mpm.conf" dest="/etc/apache2/extra/httpd-mpm.conf"/>
				<configfile default="$DOCDIR/httpd-multilang-errordoc.conf" dest="/etc/apache2/extra/httpd-multilang-errordoc.conf"/>
				<configfile default="$DOCDIR/httpd-ssl.conf" dest="/etc/apache2/extra/httpd-ssl.conf"/>
				<configfile default="$DOCDIR/httpd-userdir.conf" dest="/etc/apache2/extra/httpd-userdir.conf"/>
				<configfile default="$DOCDIR/httpd-vhosts.conf" dest="/etc/apache2/extra/httpd-vhosts.conf"/>
				<configfile default="$DOCDIR/proxy-html.conf" dest="/etc/apache2/extra/proxy-html.conf"/>
				<configfile name="httpd.logrotate-20050626" default="$DOCDIR/httpd.logrotate.paldo" dest="/etc/logrotate.d/httpd"/>
			</config>
		</release>
	</releases>
</package>
