1 # Template file for 'apache'
5 wrksrc=httpd-${version}
6 build_style=gnu-configure
7 configure_args="--prefix= --sbindir=/usr/bin --enable-pie --enable-modules=all
8 --enable-mods-shared=all --enable-authn-dbm --enable-authn-anon
9 --enable-authn-dbd --enable-authn-alias --enable-authz-dbm --enable-http2
10 --enable-authz-owner --enable-authnz-ldap --enable-auth-digest -enable-isapi
11 --enable-file-cache --enable-cache --enable-disk-cache --enable-mem-cache
12 --enable-dbd --enable-bucketeer --enable-dumpio --enable-echo --enable-reqtimeout
13 --enable-ext-filter --enable-substitute --enable-deflate --enable-charset-lite
14 --enable-ldap --enable-log-forensic --enable-logio --enable-mime-magic
15 --enable-cern-meta --enable-expires --enable-headers --enable-ident
16 --enable-usertrack --enable-unique-id --enable-proxy --enable-proxy-connect
17 --enable-proxy-ftp --enable-proxy-http --enable-proxy-scgi --enable-proxy-ajp
18 --enable-proxy-balancer --enable-ssl --enable-http --enable-speling
19 --enable-dav --enable-info --enable-cgi --enable-cgid --enable-dav-fs
20 --enable-dav-lock --enable-vhost-alias --enable-imagemap --enable-so
21 --enable-rewrite --enable-layout=XBPS --sysconfdir=/etc/${pkgname}
22 --enable-mpms-shared=all --with-pcre=${XBPS_CROSS_BASE}/usr
23 --with-z=${XBPS_CROSS_BASE}/usr
24 --with-apr=${XBPS_CROSS_BASE}/usr/bin/apr-1-config
25 --with-apr-util=${XBPS_CROSS_BASE}/usr/bin/apu-1-config"
26 hostmakedepends="pkg-config perl apr-util-devel"
27 makedepends="zlib-devel libuuid-devel pcre-devel nghttp2-devel
28 libressl-devel db-devel gdbm-devel expat-devel libldap-devel apr-util-devel"
30 /etc/${pkgname}/extra/*.conf
31 /etc/${pkgname}/httpd.conf
33 /etc/${pkgname}/mime.types"
34 short_desc="The Number One HTTP Server On The Internet"
35 maintainer="Juan RP <xtraeme@voidlinux.eu>"
36 homepage="http://httpd.apache.org/"
38 distfiles="http://www.apache.org/dist/httpd/httpd-${version}.tar.bz2"
39 checksum=de02511859b00d17845b9abdd1f975d5ccb5d0b280c567da5bf2ad4b70846f05
41 system_accounts="_$pkgname"
42 _apache_homedir="/srv/www/$pkgname"
44 # Do not redefine struct iovec in include/apr_want.h
45 CFLAGS="-DAPR_IOVEC_DEFINED=1 -I${XBPS_CROSS_BASE}/usr/include/apr-1"
47 if [ -n "$CROSS_BUILD" ]; then
48 # FIXME: is sizeof(void*) ever less than sizeof(long)?
49 export ap_cv_void_ptr_lt_long=no
50 # This is missing in cross compiled apr-1-config (?)
56 sed -e 's#User daemon#User _apache#' \
57 -e 's#Group daemon#Group _apache#' \
58 -i docs/conf/httpd.conf.in
60 cat ${FILESDIR}/xbps.layout >> config.layout
64 if [ -n "$CROSS_BUILD" ]; then
65 # Build gen_test_char using $BUILD_CC
66 sed -i server/Makefile \
67 -e "s;\$(LINK) \$(EXTRA_LDFLAGS) \$(\(gen_test_char\).*;${BUILD_CC} -o \1 \1.c -I${XBPS_CROSS_BASE}/usr/include/apr-1;"
68 # More hacks to make cross compiling work
69 sed -i build/*.mk Makefile */Makefile \
70 -e "s;--mode=compile;& --tag=CC;" \
71 -e "s;--mode=link;& --tag=CC;" \
72 -e "s;-\(L|R\)/usr/lib;-\1${XBPS_CROSS_BASE}/usr/lib;" \
73 -e "s;^\(LIBTOOL =\) /usr/share/apr-1/build/libtool;\1 ${XBPS_CROSS_BASE}/usr/bin/libtool;"
78 # Set a working ServerRoot
82 # * mod_slotmem_shm.so
83 # * mod_negotiation.so
86 # Avoid loading modules:
89 # Set and enable ServerName to 127.0.0.1.
92 # * httpd-multilang-errordoc.conf
93 # * httpd-autoindex.conf
94 # * httpd-languages.conf
95 # * httpd-userdir.conf
96 # * httpd-default.conf
99 -e 's|ServerRoot ""|ServerRoot "/srv/www/apache"|' \
100 -e 's|#\(LoadModule include_module /usr/libexec/httpd/mod_include.so\)|\1|' \
101 -e 's|\(LoadModule unique_id_module /usr/libexec/httpd/mod_unique_id.so\)|#\1|' \
102 -e 's|#\(LoadModule slotmem_shm_module /usr/libexec/httpd/mod_slotmem_shm.so\)|\1|' \
103 -e 's|#\(LoadModule negotiation_module /usr/libexec/httpd/mod_negotiation.so\)|\1|' \
104 -e 's|#\(LoadModule userdir_module /usr/libexec/httpd/mod_userdir.so\)|\1|' \
105 -e 's|#ServerName www.example.com:80|ServerName 127.0.0.1:80|' \
106 -e 's|#\(Include /etc/apache/extra/httpd-multilang-errordoc.conf\)|\1|' \
107 -e 's|#\(Include /etc/apache/extra/httpd-autoindex.conf\)|\1|' \
108 -e 's|#\(Include /etc/apache/extra/httpd-languages.conf\)|\1|' \
109 -e 's|#\(Include /etc/apache/extra/httpd-userdir.conf\)|\1|' \
110 -e 's|#\(Include /etc/apache/extra/httpd-default.conf\)|\1|' \
111 -i "${DESTDIR}/etc/apache/httpd.conf"
113 # Remove references to hardening -specs.
114 sed -e "s|\(-specs=.*hardened-ld\)||g" -e "s|\(-specs=.*hardened-cc1\)||g" -i \
115 ${DESTDIR}/usr/share/apache/webroot/build/config{.nice,_vars.mk}
117 # Remove unused stuff.
118 vmkdir usr/share/apache/webroot
119 mv ${DESTDIR}/srv/www/$pkgname/cgi-bin ${DESTDIR}/usr/share/apache/webroot
120 rm -rf ${DESTDIR}/srv
121 rm -rf ${DESTDIR}/etc/$pkgname/original
123 vinstall ${FILESDIR}/apache.logrotate 644 etc/logrotate.d apache
127 apache-devel_package() {
128 depends="apr-devel apr-util-devel perl"
129 short_desc+=" - development files"
132 vmove usr/share/apache/webroot/build
134 vmove "usr/share/man/man1/apxs*"