# Maintainer: Kaarle Ritvanen # Contributor: Valery Kartel pkgname=apache2 _pkgreal=httpd pkgver=2.4.17 pkgrel=4 pkgdesc="A high performance Unix-based HTTP server" url="http://httpd.apache.org/" arch="all" license="ASL 2.0" depends="" install="$pkgname.pre-upgrade $pkgname.pre-install" pkgusers="apache" pkggroups="apache" makedepends="apr-dev apr-util-dev autoconf automake libxml2-dev lua-dev openssl-dev pcre-dev sed zlib-dev" subpackages="$pkgname-dev $pkgname-doc $pkgname-error:_error $pkgname-icons $pkgname-ldap $pkgname-lua:_lua $pkgname-proxy-html:proxy_html $pkgname-proxy $pkgname-ssl $pkgname-utils $pkgname-webdav" source="http://archive.apache.org/dist/$_pkgreal/$_pkgreal-$pkgver.tar.bz2 apache2.confd apache2.logrotate apache2.initd ldap.conf proxy.conf lua.conf alpine.layout conf/0001-httpd.conf-ServerRoot.patch conf/0002-httpd.conf-ServerTokens.patch conf/0003-httpd.conf-ServerSignature.patch conf/0004-httpd.conf-User-Group.patch conf/0005-httpd.conf-ErrorLog-CustomLog-TransferLog.patch conf/0006-httpd-dav.conf-DavLockDB.patch conf/0007-httpd-ssl.conf-SSLSessionCache.patch conf/0008-httpd-ssl.conf-SSLRandomSeed.patch conf/0009-httpd-ssl.conf-SSL-File.patch conf/0010-httpd-ssl.conf-SSL-CipherSuite.patch conf/0011-httpd.conf-IncludeOptional.patch conf/0012-httpd.conf-MIMEMagicFile.patch conf/0013-httpd-.conf-IfModule.patch conf/0014-httpd-.conf-LoadModule.patch " options="suid" _builddir="$srcdir"/$_pkgreal-$pkgver prepare() { cd "$_builddir" for i in $source; do case $i in *.patch) msg $i; patch -p1 -i "$srcdir"/$(basename $i) || return 1;; esac done cat "$srcdir/alpine.layout" >> config.layout } build() { cd "$_builddir" ./configure \ --prefix=/usr \ --enable-layout=Alpine \ --enable-so \ --enable-suexec \ --with-suexec-caller=http \ --with-suexec-docroot=/var/www/localhost/htdocs \ --with-suexec-logfile=/var/log/apache2/suexec.log \ --with-suexec-bin=/usr/sbin/suexec \ --with-suexec-uidmin=99 \ --with-suexec-gidmin=99 \ --with-apr=/usr/bin/apr-1-config \ --with-apr-util=/usr/bin/apu-1-config \ --with-pcre=/usr \ --enable-mods-shared=all \ --enable-mpms-shared=all \ --with-mpm=prefork \ --enable-ssl \ --with-ssl \ --enable-proxy \ --enable-cache \ --enable-disk-cache \ --enable-mem-cache \ --enable-file-cache \ --enable-ldap \ --enable-authnz-ldap \ --enable-cgid \ --enable-cgi \ --enable-authn-anon \ --enable-authn-alias \ --disable-imagemap \ --enable-proxy-connect \ --enable-proxy-http \ --enable-proxy-ftp \ --enable-deflate \ --enable-dbd \ --enable-exception-hook \ --enable-dav \ --enable-dav-fs \ --enable-dav-lock \ || return 1 make || return 1 } package() { cd "$_builddir" make -j1 DESTDIR="$pkgdir" install || return 1 # config rm -r "$pkgdir"/etc/apache2/extra/httpd-vhosts.conf \ "$pkgdir"/etc/apache2/original || return 1 mv "$pkgdir"/etc/apache2/extra "$pkgdir"/etc/apache2/conf.d || return 1 for file in "$pkgdir"/etc/apache2/conf.d/httpd-*; do mv "$file" \ "$(dirname $file)/${file#$pkgdir/etc/apache2/conf.d/httpd-}" || \ return 1 done sed -Ei \ 's:^(#?LoadModule .+ )lib/apache2/:\1modules/:;ta;b;:a;s/^#?LoadModule (dav.*|lbmethod_.+|.*ldap|lua|proxy.*|ssl|xml2enc)_module //;tb;b;:b;d' \ "$pkgdir"/etc/apache2/httpd.conf # init scripts and logrotate install -D -m755 "$srcdir"/apache2.initd \ "$pkgdir"/etc/init.d/apache2 || return 1 install -D -m644 "$srcdir"/apache2.logrotate \ "$pkgdir"/etc/logrotate.d/apache2 || return 1 install -D -m644 "$srcdir"/apache2.confd \ "$pkgdir"/etc/conf.d/apache2 || return 1 install -d "$pkgdir"/var/www || return 1 ln -fs /var/log/apache2 "$pkgdir"/var/www/logs ln -fs /run/apache2 "$pkgdir"/var/www/run ln -fs /usr/lib/apache2 "$pkgdir"/var/www/modules rm -fr "$pkgdir"/run # verify all MPMs are built # ref #2866 for i in prefork event worker; do if ! [ -e "$pkgdir"/usr/lib/apache2/mod_mpm_$i.so ]; then error "$i MPM was not built" return 1 fi done } _mv_conf() { install -d "$subpkgdir"/etc/apache2/conf.d && \ mv "$pkgdir"/etc/apache2/conf.d/$1.conf \ "$subpkgdir"/etc/apache2/conf.d } # include the builddir and apxs in -dev package dev() { local _mpm local _file default_dev depends="$depends perl apr-util-dev" arch="noarch" # install apxs utility install -d "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/apxs \ "$subpkgdir"/usr/bin/apxs || return 1 install -d "$subpkgdir"/usr/share/apache2 mv "$pkgdir"/usr/share/apache2/build \ "$subpkgdir"/usr/share/apache2/ || return 1 } doc() { default_doc && _mv_conf manual } _error() { arch="noarch" pkgdesc="Apache Multi Language Custom Error Documents" install -d "$subpkgdir"/usr/share/apache2 mv "$pkgdir"/usr/share/apache2/error \ "$subpkgdir"/usr/share/apache2/ || return 1 _mv_conf multilang-errordoc } icons() { arch="noarch" pkgdesc="Apache Public Domain Icons" install -d "$subpkgdir"/usr/share/apache2 mv "$pkgdir"/usr/share/apache2/icons \ "$subpkgdir"/usr/share/apache2/ || return 1 _mv_conf autoindex } utils() { local _bin pkgdesc="Apache utility programs for webservers" install -d "$subpkgdir"/usr/sbin || return 1 mv "$pkgdir"/usr/bin "$subpkgdir"/usr/ for i in checkgid htcacheclean rotatelogs apachectl envvars*; do mv "$pkgdir"/usr/sbin/$i "$subpkgdir"/usr/sbin/ || return 1 done } ssl() { pkgdesc="SSL/TLS module for the Apache HTTP Server" install="apache2-ssl.post-install" depends="apache2 openssl" install -d "$subpkgdir"/usr/lib/apache2 || return 1 mv "$pkgdir"/usr/lib/apache2/mod_ssl.so \ "$subpkgdir"/usr/lib/apache2/mod_ssl.so || return 1 _mv_conf ssl || return 1 install -d "$subpkgdir"/etc/ssl/apache2 || return 1 } ldap() { pkgdesc="LDAP authentication/authorization module for the Apache HTTP Server" url="http://httpd.apache.org/docs/2.4/mod/mod_authnz_ldap.html" depends="apache2 apr-util-ldap" install -d "$subpkgdir"/usr/lib/apache2 || return 1 mv "$pkgdir"/usr/lib/apache2/mod_*ldap.so \ "$subpkgdir"/usr/lib/apache2/ || return 1 install -D -m644 "$srcdir"/ldap.conf \ "$subpkgdir"/etc/apache2/conf.d/ldap.conf || return 1 } webdav() { pkgdesc="WebDAV support for the Apache HTTP Server" depends="apache2" replaces="apache2" install -d "$subpkgdir"/usr/lib/apache2 || return 1 mv "$pkgdir"/usr/lib/apache2/mod_dav*.so \ "$subpkgdir"/usr/lib/apache2/ || return 1 _mv_conf dav } proxy_html() { pkgdesc="HTML and XML content filters for the Apache HTTP Server" depends="apache2" install -d "$subpkgdir"/usr/lib/apache2 || return 1 mv "$pkgdir"/usr/lib/apache2/mod_proxy_html.so \ "$pkgdir"/usr/lib/apache2/mod_xml2enc.so \ "$subpkgdir"/usr/lib/apache2/ || return 1 _mv_conf proxy-html } proxy() { pkgdesc="Proxy modules for the Apache HTTP Server" depends="apache2" install -d "$subpkgdir"/usr/lib/apache2 || return 1 mv "$pkgdir"/usr/lib/apache2/mod_proxy*.so \ "$pkgdir"/usr/lib/apache2/mod_lbmethod_*.so \ "$subpkgdir"/usr/lib/apache2/ || return 1 install -D -m644 "$srcdir"/proxy.conf \ "$subpkgdir"/etc/apache2/conf.d/proxy.conf || return 1 } _lua() { pkgdesc="Lua support for the Apache HTTP server" depends="apache2" install -d "$subpkgdir"/usr/lib/apache2 || return 1 mv "$pkgdir"/usr/lib/apache2/mod_lua.so \ "$subpkgdir"/usr/lib/apache2/ || return 1 install -D -m644 "$srcdir"/lua.conf \ "$subpkgdir"/etc/apache2/conf.d/lua.conf || return 1 } md5sums="cf4dfee11132cde836022f196611a8b7 httpd-2.4.17.tar.bz2 257d2572921dd4506b0464441f88fab4 apache2.confd 8519af87c57b50441866ad4216e4d663 apache2.logrotate 11b2718d7a0550498aaddf41e940ad04 apache2.initd b70fe826486043e3953cfe21f9e6fa16 ldap.conf 96eddccfca1ec0349f844e2460cf655b proxy.conf 449a4aea60473ac4a16f025fca4463e3 lua.conf 699aec01d2f7c5a67c10d0fe280780b7 alpine.layout 619e6564f8f3d34e08e0b908b3e8858f 0001-httpd.conf-ServerRoot.patch c87199fbee0354d058b7d2ac4bcd80d5 0002-httpd.conf-ServerTokens.patch 483cbd360ce74aada662628a43c20ccd 0003-httpd.conf-ServerSignature.patch 3ba9f3744cc236d11f711721601c489f 0004-httpd.conf-User-Group.patch 02a693528319b50d6f778eeb4f8bff0e 0005-httpd.conf-ErrorLog-CustomLog-TransferLog.patch 60488b68b6cbfce717f8ddf975aae266 0006-httpd-dav.conf-DavLockDB.patch ff4260cb5868781d409bd44b7fae639b 0007-httpd-ssl.conf-SSLSessionCache.patch 71631c214e9ac4227710a354a464ffa5 0008-httpd-ssl.conf-SSLRandomSeed.patch f969c0eb55e63285e4e95bd48a475c15 0009-httpd-ssl.conf-SSL-File.patch 52232ad656627372d9ccc8da4dc258e0 0010-httpd-ssl.conf-SSL-CipherSuite.patch e13a95fb3cfbd3ae1fca538eacc4b815 0011-httpd.conf-IncludeOptional.patch 5c838af084c09d6f4eea1a2b3053b4f5 0012-httpd.conf-MIMEMagicFile.patch 1e100376e89febdd8d0d65b21df38367 0013-httpd-.conf-IfModule.patch 8bff0616512e22aea2cc98b40d141553 0014-httpd-.conf-LoadModule.patch" sha256sums="331e035dec81d3db95b048f036f4d7b1a97ec8daa5b377bde42d4ccf1f2eb798 httpd-2.4.17.tar.bz2 6ca904ad65c1a4122d8ea4a3303ea8184429a4a4d7fb81defc30f3e184258c0a apache2.confd 8e2a8870d51796cf04cc7d8985c43e36afe9ae79e2d6765050a0e72c0de8dce7 apache2.logrotate 8761faa68c2db7114b3f463f3b8ef1aec8f8373da9908d943cc765765914ab36 apache2.initd 25771023d7c921a13c792607d47bd716c92698b20af21c018f0922eaf79a9604 ldap.conf 00c42b7806eaa73e732be9d9e92c3e841b20c6d91a9920be47f19db8aee3513e proxy.conf edf701795137566c7cf4b9c0c95ecd5f8c58269f5600217a0a4d289d2bf15384 lua.conf c40668ae8384d0555488660b68eda16ad8ccb11fde16a8197d33bed739fed1e8 alpine.layout 69c717cdb99633c12797acdf9296288e0708687394915a8885e0cac7e794d9dc 0001-httpd.conf-ServerRoot.patch 3aacdf3d21bf5e73d8aa1d10d49c13adaca51a26ce9211d70829e7badc552f3e 0002-httpd.conf-ServerTokens.patch 4321b2eeec26d2d17806da8281acebc277ca0dd814cae47cf883bd2e949a35f9 0003-httpd.conf-ServerSignature.patch 34e105220bb88aec1cf53e5c77b32104f059911bee48a2c41b0dd4fe2c3078f7 0004-httpd.conf-User-Group.patch 32d76f092504162caa78c2397e4eb2c3be1525546840fb3e7710cec60f854961 0005-httpd.conf-ErrorLog-CustomLog-TransferLog.patch 403704866ade4984cf478101a597e4b2903859e728a17dbbdb9351d21950409b 0006-httpd-dav.conf-DavLockDB.patch 690decacf6d8229689e380be4323415d6c574ce027b65dd3b56c1d8ea0d7206b 0007-httpd-ssl.conf-SSLSessionCache.patch 875a0d71a0e447c2d856c03ca6b80123d556544dfe8d1a04c9d409b509502ab2 0008-httpd-ssl.conf-SSLRandomSeed.patch 8140c9e8dfa782deff8debbc9ce1b807768ab935100fb12d4f8f832f8f96d895 0009-httpd-ssl.conf-SSL-File.patch 637260187fd2642cd3d5a300665dbe578592c1cd260e56050d3a9d99ee77527f 0010-httpd-ssl.conf-SSL-CipherSuite.patch 0e3aa81eb70040f883c940090956ade949b5e420a360e07d24d95fc1662b16dd 0011-httpd.conf-IncludeOptional.patch 0904e780bbb08bb660b0a4385242f3837d35833b3305d6ea0a5dcb4c688ed3a7 0012-httpd.conf-MIMEMagicFile.patch e466a446f600831d5f46a317ac6108b812cec83320f034306f19366bd8d5a25c 0013-httpd-.conf-IfModule.patch 8111aa4fbddd21f9da2a8836b176935bcfba3e11d1067b42b8bd5001bd3bbd7f 0014-httpd-.conf-LoadModule.patch" sha512sums="d818dbd4b138db592a98fecdf5ae13dfadc19f9553e98bdafbdadd4693ae19bb44c96c8c279e9546978bbce55b9286ce3c4ae69cf701a9812be134a3a517b1f6 httpd-2.4.17.tar.bz2 8e62b101f90c67babe864bcb74f711656180b011df3fd4b541dc766b980b72aa409e86debf3559a55be359471c1cad81b8779ef3a55add8d368229fc7e9544fc apache2.confd 18e8859c7d99c4483792a5fd20127873aad8fa396cafbdb6f2c4253451ffe7a1093a3859ce719375e0769739c93704c88897bd087c63e1ef585e26dcc1f5dd9b apache2.logrotate 81a2d2a297d8049ba1b021b879ec863767149e056d9bdb2ac8acf63572b254935ec96c2e1580eba86639ea56433eec5c41341e4f1501f9072745dccdb3602701 apache2.initd fbdc28ea4b94af91640794945ac4e1f45e4200e54d5bdf64c0c03fc8bdb589e444cc4f7dd0b70b696c0e5e033c8489b8bd8f8fd090906c4379651c7d032c2449 ldap.conf aabbe171219f15efe47f8e972fc1a43f98b48977aae91b597b65bb447027992bf81757bde68b26a67e5e3b9f2e748d94b3c85d5c07433627b6048d60a51d400b proxy.conf f2950005ac0d8c7a5e34958f1274c9ed0f5f634a5bc766e12834917937df9db901c5fc2460da70e1a62f17440d4719163cd4213496dbf579c80a789b8e18f65c lua.conf 177c58d049fc4476fd9b9b36b67725145777c84cf81948105c9314cb09312dff6c1931fe21aaa243597abaefded6c6dfd80d83839e45a23950b50de615d73b06 alpine.layout 21cf156127b8f568326f8a1a90c34f380910ecdad592efe35d165bedc9ef1e7e3a570b613c8a7c6c095e6b3203b5346b11e71d4031eb35a52955417720e2ae0c 0001-httpd.conf-ServerRoot.patch 253cf44fa48d16e34855a6ec7598a0cddcc6f64abdabf49f40a040c52a584558e42e24bc3ac806b965732f02358a84a1d832a598a2bdc328d7635187cea66e2c 0002-httpd.conf-ServerTokens.patch b8f7bf67608e61839c191ebedc64c1bf84b16553406bb2e05be0f6e2f508f5748b038a9858e173a151e5d25334e115beaae324583395465500cd1aefc7f224a6 0003-httpd.conf-ServerSignature.patch b84a4b8693ceb00c298704c8cfeea906ef51567a117ebbb9f5d76b2ecdad8003abf2020afb6dd2030b1671dbb86332e5a818b941de9d8d042dd7e3696c0ba1fe 0004-httpd.conf-User-Group.patch 8a6b29b802c109ded61d3474080e38c06f961e46c99304d36152f75da5d1f08808d3d7c4b1a2b9018ea9d361e92443d0958f38d8733186a84a525a4d744c83a8 0005-httpd.conf-ErrorLog-CustomLog-TransferLog.patch d343b98f7fbdb85e3a98002a99500149249aeba0ffd89a80c542d9fb94409278d4a6b2a1c23750fcd44c0a22ea98eca4ef11da84eb5f0031db6b42887ca94eb4 0006-httpd-dav.conf-DavLockDB.patch 9429fdc1ca5df8a7c635b61f24fa4b39fa19af98fc90a10e3f896ff12549e0ed5b9a9e8a44ffde1275f9ad9e9239f43afb1027c72438bf682b7b75efaea8dcf7 0007-httpd-ssl.conf-SSLSessionCache.patch 65e518b4901450085e49c91cfe0ca32e90053d580c4545f9c1e5e4dc943d9cb33d4f524827afbd9e0677760a8728f3e3d7fef6bf669b82f3266cd9907c5922c8 0008-httpd-ssl.conf-SSLRandomSeed.patch 99b1c04b2f1f09de59e23c58634a199bc51cd982c9f3adc078010916c394cc77dee1da3d5ed3860bef4ee0f4cd7a603e11a10ea657dfd0b422a52f7ffa46ca05 0009-httpd-ssl.conf-SSL-File.patch 052783619ba130ce583ab2156a48853a5827e643c9fbabb5031232002f6423feb0806a429e44c499134a15a83e28364790df2184c27b38bff3afeee5e7ea4c9e 0010-httpd-ssl.conf-SSL-CipherSuite.patch ebbb702aa0d789eb69abe0784de7d5ede651d8be2fc6eeb1be62dc337af1aa027921f324a959895b15af8c5744fb2d37e063cd659744a13d655237772c4ccf5a 0011-httpd.conf-IncludeOptional.patch f6b333723fc5fdcd8447586766762baf9e28f21f2fdecff1e10779d8c50be84408d32bad2f9d8f03083846c04967b821c44038f6fd3a57053b157e0c5c0fcce4 0012-httpd.conf-MIMEMagicFile.patch 4af68fb9330657a7b5fa24ee25176ae28603e1a6e9c642966f7f4e7817717b18597f7582a75f18f483be21f1ecc9feef7423aee0482faeef6016d6a5a957fd52 0013-httpd-.conf-IfModule.patch b6be7576981c13f70e7532a8f6718ad4e156556932e985560e8b39ed64ee225fca3a7d4c95561c452da85722045d0049871c21f748d76837d324d9fa46aa0899 0014-httpd-.conf-LoadModule.patch"