| 1 | TERMUX_PKG_HOMEPAGE=http://httpd.apache.org |
| 2 | TERMUX_PKG_DESCRIPTION="Apache Web Server" |
| 3 | TERMUX_PKG_VERSION=2.4.29 |
| 4 | TERMUX_PKG_SHA256=777753a5a25568a2a27428b2214980564bc1c38c1abf9ccc7630b639991f7f00 |
| 5 | TERMUX_PKG_SRCURL=https://www.apache.org/dist/httpd/httpd-$TERMUX_PKG_VERSION.tar.bz2 |
| 6 | TERMUX_PKG_DEPENDS="apr, apr-util, pcre, openssl, libcrypt, libandroid-support, libnghttp2, libexpat" |
| 7 | TERMUX_PKG_CONFFILES=" |
| 8 | etc/apache2/httpd.conf |
| 9 | etc/apache2/extra/httpd-autoindex.conf |
| 10 | etc/apache2/extra/httpd-dav.conf |
| 11 | etc/apache2/extra/httpd-default.conf |
| 12 | etc/apache2/extra/httpd-info.conf |
| 13 | etc/apache2/extra/httpd-languages.conf |
| 14 | etc/apache2/extra/httpd-manual.conf |
| 15 | etc/apache2/extra/httpd-mpm.conf |
| 16 | etc/apache2/extra/httpd-multilang-errordoc.conf |
| 17 | etc/apache2/extra/httpd-ssl.conf |
| 18 | etc/apache2/extra/httpd-userdir.conf |
| 19 | etc/apache2/extra/httpd-vhosts.conf |
| 20 | etc/apache2/extra/proxy-html.conf |
| 21 | etc/apache2/mime.types |
| 22 | etc/apache2/magic |
| 23 | " |
| 24 | TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas" |
| 25 | # providing manual paths to libs because it picks up host libs on some systems |
| 26 | TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" |
| 27 | --with-apr=$TERMUX_PREFIX |
| 28 | --with-apr-util=$TERMUX_PREFIX |
| 29 | --with-pcre=$TERMUX_PREFIX |
| 30 | --enable-suexec |
| 31 | --enable-layout=Termux |
| 32 | --enable-so |
| 33 | --enable-authnz-fcgi |
| 34 | --enable-cache |
| 35 | --enable-disk-cache |
| 36 | --enable-mem-cache |
| 37 | --enable-file-cache |
| 38 | --enable-ssl |
| 39 | --with-ssl |
| 40 | --enable-deflate |
| 41 | --enable-cgi |
| 42 | --enable-cgid |
| 43 | --enable-proxy |
| 44 | --enable-proxy-connect |
| 45 | --enable-proxy-http |
| 46 | --enable-proxy-ftp |
| 47 | --enable-dbd |
| 48 | --enable-imagemap |
| 49 | --enable-ident |
| 50 | --enable-cern-meta |
| 51 | --enable-http2 |
| 52 | --enable-mpms-shared=all |
| 53 | --enable-modules=all |
| 54 | --enable-mods-shared=all |
| 55 | --disable-mods-static |
| 56 | --with-port=8080 |
| 57 | --with-sslport=8443 |
| 58 | --enable-unixd |
| 59 | --without-libxml2 |
| 60 | --libexecdir=$TERMUX_PREFIX/libexec/apache2 |
| 61 | ac_cv_func_getpwnam=yes |
| 62 | ac_cv_have_threadsafe_pollset=no |
| 63 | " |
| 64 | TERMUX_PKG_BUILD_IN_SRC=true |
| 65 | TERMUX_PKG_RM_AFTER_INSTALL="share/apache2/manual etc/apache2/original share/man/man8/suexec.8 libexec/httpd.exp" |
| 66 | TERMUX_PKG_INCLUDE_IN_DEVPACKAGE="share/apache2/build" |
| 67 | TERMUX_PKG_EXTRA_MAKE_ARGS="-s" |
| 68 | |
| 69 | termux_step_pre_configure () { |
| 70 | # remove old files |
| 71 | rm -rf "$TERMUX_PREFIX"/{libexec,share,etc}/apache2 |
| 72 | rm -rf "$TERMUX_PREFIX"/lib/cgi-bin |
| 73 | |
| 74 | if [ $TERMUX_ARCH_BITS -eq 32 ]; then |
| 75 | export ap_cv_void_ptr_lt_long=4 |
| 76 | else |
| 77 | export ap_cv_void_ptr_lt_long=8 |
| 78 | fi |
| 79 | |
| 80 | LDFLAGS="$LDFLAGS -llog -lapr-1 -laprutil-1" |
| 81 | |
| 82 | # use custom layout |
| 83 | cat $TERMUX_PKG_BUILDER_DIR/Termux.layout > $TERMUX_PKG_SRCDIR/config.layout |
| 84 | } |
| 85 | |
| 86 | termux_step_post_configure () { |
| 87 | # thanks to @JetBalsa |
| 88 | gcc -O2 -DCROSS_COMPILE $TERMUX_PKG_SRCDIR/server/gen_test_char.c -o $TERMUX_PKG_BUILDDIR/server/gen_test_char |
| 89 | touch -d "1 hour" $TERMUX_PKG_BUILDDIR/server/gen_test_char |
| 90 | } |
| 91 | |
| 92 | termux_step_post_make_install () { |
| 93 | sed -e "s#/$TERMUX_PREFIX/libexec/apache2/#modules/#" \ |
| 94 | -e 's|#\(LoadModule negotiation_module \)|\1|' \ |
| 95 | -e 's|#\(LoadModule include_module \)|\1|' \ |
| 96 | -e 's|#\(LoadModule userdir_module \)|\1|' \ |
| 97 | -e 's|#\(LoadModule slotmem_shm_module \)|\1|' \ |
| 98 | -e 's|#\(Include extra/httpd-multilang-errordoc.conf\)|\1|' \ |
| 99 | -e 's|#\(Include extra/httpd-autoindex.conf\)|\1|' \ |
| 100 | -e 's|#\(Include extra/httpd-languages.conf\)|\1|' \ |
| 101 | -e 's|#\(Include extra/httpd-userdir.conf\)|\1|' \ |
| 102 | -e 's|#\(Include extra/httpd-default.conf\)|\1|' \ |
| 103 | -e 's|#\(Include extra/httpd-mpm.conf\)|\1|' \ |
| 104 | -e 's|User daemon|#User daemon|' \ |
| 105 | -e 's|Group daemon|#Group daemon|' \ |
| 106 | -i "$TERMUX_PREFIX/etc/apache2/httpd.conf" |
| 107 | } |
| 108 | |
| 109 | termux_step_post_massage () { |
| 110 | # sometimes it creates a $TERMUX_PREFIX/bin/sh -> /bin/sh |
| 111 | rm ${TERMUX_PKG_MASSAGEDIR}${TERMUX_PREFIX}/bin/sh || true |
| 112 | |
| 113 | mkdir -p ${TERMUX_PKG_MASSAGEDIR}${TERMUX_PREFIX}/var/run/apache2 |
| 114 | mkdir -p ${TERMUX_PKG_MASSAGEDIR}${TERMUX_PREFIX}/var/log/apache2 |
| 115 | } |