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