python-texttable: update to 1.3.1
[void-packages.git] / srcpkgs / apache / template
blob9a13ed3b9a4732f8a1936c25846b77dc03077742
1 # Template file for 'apache'
2 pkgname=apache
3 version=2.4.33
4 revision=1
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"
29 conf_files="
30         /etc/${pkgname}/extra/*.conf
31         /etc/${pkgname}/httpd.conf
32         /etc/${pkgname}/magic
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/"
37 license="Apache-2.0"
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 (?)
51         LDFLAGS="-pthread"
54 pre_configure() {
55         # set default user
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
63 post_configure() {
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;"
74         fi
77 post_install() {
78         # Set a working ServerRoot
79         #
80         # Load modules:
81         #  * mod_include.so
82         #  * mod_slotmem_shm.so
83         #  * mod_negotiation.so
84         #  * mod_userdir.so
85         #
86         # Avoid loading modules:
87         #  * mod_unique_id.so
88         #
89         # Set and enable ServerName to 127.0.0.1.
90         #
91         # include extras:
92         #  * httpd-multilang-errordoc.conf
93         #  * httpd-autoindex.conf
94         #  * httpd-languages.conf
95         #  * httpd-userdir.conf
96         #  * httpd-default.conf
97         #
98         sed \
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
124         vsv apache
127 apache-devel_package() {
128         depends="apr-devel apr-util-devel perl"
129         short_desc+=" - development files"
130         pkg_install() {
131                 vmove usr/include
132                 vmove usr/share/apache/webroot/build
133                 vmove usr/bin/apxs
134                 vmove "usr/share/man/man1/apxs*"
135         }