2018-03-07 10:49:32 +01:00
|
|
|
TERMUX_PKG_HOMEPAGE=https://httpd.apache.org
|
2017-06-06 10:20:51 +02:00
|
|
|
TERMUX_PKG_DESCRIPTION="Apache Web Server"
|
2019-01-20 22:39:59 +01:00
|
|
|
TERMUX_PKG_LICENSE="Apache-2.0"
|
2020-12-20 14:16:34 +01:00
|
|
|
TERMUX_PKG_MAINTAINER="@termux"
|
2021-10-14 10:45:21 +02:00
|
|
|
TERMUX_PKG_VERSION=1:2.4.51
|
2021-05-25 02:54:41 +02:00
|
|
|
TERMUX_PKG_SRCURL=https://www.apache.org/dist/httpd/httpd-${TERMUX_PKG_VERSION:2}.tar.bz2
|
2021-10-14 10:45:21 +02:00
|
|
|
TERMUX_PKG_SHA256=20e01d81fecf077690a4439e3969a9b22a09a8d43c525356e863407741b838f4
|
2019-04-14 14:51:46 +02:00
|
|
|
TERMUX_PKG_DEPENDS="apr, apr-util, pcre, openssl, libcrypt, libandroid-support, libnghttp2, libexpat, libuuid, zlib"
|
2019-07-20 10:42:33 +02:00
|
|
|
TERMUX_PKG_BREAKS="apache2-dev"
|
|
|
|
TERMUX_PKG_REPLACES="apache2-dev"
|
2017-06-06 10:20:51 +02:00
|
|
|
TERMUX_PKG_CONFFILES="
|
|
|
|
etc/apache2/httpd.conf
|
|
|
|
etc/apache2/extra/httpd-autoindex.conf
|
|
|
|
etc/apache2/extra/httpd-dav.conf
|
|
|
|
etc/apache2/extra/httpd-default.conf
|
|
|
|
etc/apache2/extra/httpd-info.conf
|
|
|
|
etc/apache2/extra/httpd-languages.conf
|
|
|
|
etc/apache2/extra/httpd-manual.conf
|
|
|
|
etc/apache2/extra/httpd-mpm.conf
|
|
|
|
etc/apache2/extra/httpd-multilang-errordoc.conf
|
|
|
|
etc/apache2/extra/httpd-ssl.conf
|
|
|
|
etc/apache2/extra/httpd-userdir.conf
|
|
|
|
etc/apache2/extra/httpd-vhosts.conf
|
|
|
|
etc/apache2/extra/proxy-html.conf
|
|
|
|
etc/apache2/mime.types
|
|
|
|
etc/apache2/magic
|
|
|
|
"
|
2020-03-16 15:39:29 +01:00
|
|
|
|
2017-06-06 10:20:51 +02:00
|
|
|
# providing manual paths to libs because it picks up host libs on some systems
|
|
|
|
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
|
|
|
|
--with-apr=$TERMUX_PREFIX
|
|
|
|
--with-apr-util=$TERMUX_PREFIX
|
|
|
|
--with-pcre=$TERMUX_PREFIX
|
|
|
|
--enable-suexec
|
|
|
|
--enable-layout=Termux
|
|
|
|
--enable-so
|
|
|
|
--enable-authnz-fcgi
|
|
|
|
--enable-cache
|
|
|
|
--enable-disk-cache
|
|
|
|
--enable-mem-cache
|
|
|
|
--enable-file-cache
|
|
|
|
--enable-ssl
|
|
|
|
--with-ssl
|
|
|
|
--enable-deflate
|
|
|
|
--enable-cgi
|
|
|
|
--enable-cgid
|
|
|
|
--enable-proxy
|
|
|
|
--enable-proxy-connect
|
|
|
|
--enable-proxy-http
|
|
|
|
--enable-proxy-ftp
|
|
|
|
--enable-dbd
|
|
|
|
--enable-imagemap
|
|
|
|
--enable-ident
|
|
|
|
--enable-cern-meta
|
|
|
|
--enable-http2
|
|
|
|
--enable-mpms-shared=all
|
|
|
|
--enable-modules=all
|
|
|
|
--enable-mods-shared=all
|
2018-10-29 01:12:16 +01:00
|
|
|
--disable-brotli
|
2018-07-15 17:58:03 +02:00
|
|
|
--disable-lua
|
2017-06-06 10:20:51 +02:00
|
|
|
--disable-mods-static
|
2018-03-22 23:32:00 +01:00
|
|
|
--disable-md
|
2017-06-06 10:20:51 +02:00
|
|
|
--with-port=8080
|
|
|
|
--with-sslport=8443
|
|
|
|
--enable-unixd
|
2017-06-13 13:33:42 +02:00
|
|
|
--without-libxml2
|
2017-06-06 10:20:51 +02:00
|
|
|
--libexecdir=$TERMUX_PREFIX/libexec/apache2
|
|
|
|
ac_cv_func_getpwnam=yes
|
|
|
|
ac_cv_have_threadsafe_pollset=no
|
|
|
|
"
|
|
|
|
TERMUX_PKG_BUILD_IN_SRC=true
|
|
|
|
TERMUX_PKG_RM_AFTER_INSTALL="share/apache2/manual etc/apache2/original share/man/man8/suexec.8 libexec/httpd.exp"
|
|
|
|
TERMUX_PKG_EXTRA_MAKE_ARGS="-s"
|
2020-01-08 21:32:26 +01:00
|
|
|
TERMUX_PKG_SERVICE_SCRIPT=("httpd" 'exec httpd -DNO_DETACH 2>&1')
|
2017-06-06 10:20:51 +02:00
|
|
|
|
2021-10-04 18:50:11 +02:00
|
|
|
|
2019-02-08 10:37:29 +01:00
|
|
|
termux_step_pre_configure() {
|
2019-08-08 14:25:54 +02:00
|
|
|
# Certain packages are not safe to build on device because their
|
|
|
|
# build.sh script deletes specific files in $TERMUX_PREFIX.
|
2019-08-12 17:28:41 +02:00
|
|
|
if $TERMUX_ON_DEVICE_BUILD; then
|
2019-08-08 14:25:54 +02:00
|
|
|
termux_error_exit "Package '$TERMUX_PKG_NAME' is not safe for on-device builds."
|
|
|
|
fi
|
|
|
|
|
2017-06-06 10:20:51 +02:00
|
|
|
# remove old files
|
|
|
|
rm -rf "$TERMUX_PREFIX"/{libexec,share,etc}/apache2
|
|
|
|
rm -rf "$TERMUX_PREFIX"/lib/cgi-bin
|
|
|
|
|
|
|
|
if [ $TERMUX_ARCH_BITS -eq 32 ]; then
|
|
|
|
export ap_cv_void_ptr_lt_long=4
|
|
|
|
else
|
|
|
|
export ap_cv_void_ptr_lt_long=8
|
|
|
|
fi
|
|
|
|
|
2019-12-30 01:05:41 +01:00
|
|
|
LDFLAGS="$LDFLAGS -lapr-1 -laprutil-1"
|
2017-06-06 10:20:51 +02:00
|
|
|
|
|
|
|
# use custom layout
|
|
|
|
cat $TERMUX_PKG_BUILDER_DIR/Termux.layout > $TERMUX_PKG_SRCDIR/config.layout
|
|
|
|
}
|
|
|
|
|
2019-02-08 10:37:29 +01:00
|
|
|
termux_step_post_configure() {
|
2017-06-06 10:20:51 +02:00
|
|
|
# thanks to @JetBalsa
|
|
|
|
gcc -O2 -DCROSS_COMPILE $TERMUX_PKG_SRCDIR/server/gen_test_char.c -o $TERMUX_PKG_BUILDDIR/server/gen_test_char
|
|
|
|
touch -d "1 hour" $TERMUX_PKG_BUILDDIR/server/gen_test_char
|
|
|
|
}
|
|
|
|
|
2019-02-08 10:37:29 +01:00
|
|
|
termux_step_post_make_install() {
|
2017-06-06 10:20:51 +02:00
|
|
|
sed -e "s#/$TERMUX_PREFIX/libexec/apache2/#modules/#" \
|
|
|
|
-e 's|#\(LoadModule negotiation_module \)|\1|' \
|
|
|
|
-e 's|#\(LoadModule include_module \)|\1|' \
|
|
|
|
-e 's|#\(LoadModule userdir_module \)|\1|' \
|
|
|
|
-e 's|#\(LoadModule slotmem_shm_module \)|\1|' \
|
|
|
|
-e 's|#\(Include extra/httpd-multilang-errordoc.conf\)|\1|' \
|
|
|
|
-e 's|#\(Include extra/httpd-autoindex.conf\)|\1|' \
|
|
|
|
-e 's|#\(Include extra/httpd-languages.conf\)|\1|' \
|
|
|
|
-e 's|#\(Include extra/httpd-userdir.conf\)|\1|' \
|
|
|
|
-e 's|#\(Include extra/httpd-default.conf\)|\1|' \
|
|
|
|
-e 's|#\(Include extra/httpd-mpm.conf\)|\1|' \
|
|
|
|
-e 's|User daemon|#User daemon|' \
|
|
|
|
-e 's|Group daemon|#Group daemon|' \
|
|
|
|
-i "$TERMUX_PREFIX/etc/apache2/httpd.conf"
|
2020-09-02 14:39:57 +02:00
|
|
|
echo -e "#\n# Load config files from the config directory 'conf.d'.\n#\nInclude etc/apache2/conf.d/*.conf" >> $TERMUX_PREFIX/etc/apache2/httpd.conf
|
2017-06-06 10:20:51 +02:00
|
|
|
}
|
|
|
|
|
2019-02-08 10:37:29 +01:00
|
|
|
termux_step_post_massage() {
|
2017-06-06 10:20:51 +02:00
|
|
|
# sometimes it creates a $TERMUX_PREFIX/bin/sh -> /bin/sh
|
2020-04-03 17:30:41 +02:00
|
|
|
rm -f ${TERMUX_PKG_MASSAGEDIR}${TERMUX_PREFIX}/bin/sh
|
2017-06-06 10:20:51 +02:00
|
|
|
|
2020-08-31 13:41:55 +02:00
|
|
|
mkdir -p ${TERMUX_PKG_MASSAGEDIR}${TERMUX_PREFIX}/etc/apache2/conf.d
|
2020-09-26 14:10:34 +02:00
|
|
|
touch ${TERMUX_PKG_MASSAGEDIR}${TERMUX_PREFIX}/etc/apache2/conf.d/placeholder.conf
|
2017-06-06 10:20:51 +02:00
|
|
|
mkdir -p ${TERMUX_PKG_MASSAGEDIR}${TERMUX_PREFIX}/var/run/apache2
|
|
|
|
mkdir -p ${TERMUX_PKG_MASSAGEDIR}${TERMUX_PREFIX}/var/log/apache2
|
|
|
|
}
|