privoxy: add termux-services script

This commit is contained in:
Henrik Grimler 2020-01-05 21:06:06 +01:00
parent 8507e290d2
commit cf856bcae4

View File

@ -2,16 +2,19 @@ TERMUX_PKG_HOMEPAGE=https://www.privoxy.org
TERMUX_PKG_DESCRIPTION="Non-caching web proxy with advanced filtering capabilities"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_VERSION=3.0.28
TERMUX_PKG_REVISION=2
TERMUX_PKG_REVISION=3
TERMUX_PKG_SHA256=b5d78cc036aaadb3b7cf860e9d598d7332af468926a26e2d56167f1cb6f2824a
TERMUX_PKG_SRCURL=https://www.privoxy.org/sf-download-mirror/Sources/$TERMUX_PKG_VERSION%20%28stable%29/privoxy-$TERMUX_PKG_VERSION-stable-src.tar.gz
TERMUX_PKG_CONFFILES='etc/privoxy/config etc/privoxy/match-all.action etc/privoxy/trust etc/privoxy/user.action etc/privoxy/user.filter etc/privoxy/default.action etc/privoxy/default.filter'
# Termux-services adds the run scripts to TERMUX_PKG_CONFFILES. Those ones can not be copied in termux_step_post_massage so setup special variable for that
DEFAULT_CONFFILES='etc/privoxy/config etc/privoxy/match-all.action etc/privoxy/trust etc/privoxy/user.action etc/privoxy/user.filter etc/privoxy/default.action etc/privoxy/default.filter'
TERMUX_PKG_CONFFILES=$DEFAULT_CONFFILES
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
ac_cv_lib_pcreposix_regcomp=no
--sysconfdir=$TERMUX_PREFIX/etc/privoxy
"
TERMUX_PKG_DEPENDS="pcre, libpcreposix, zlib"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_SERVICE_SCRIPT=("privoxy" 'if [ -f "$HOME/.config/privoxy/config" ]; then CONFIG="$HOME/.config/privoxy/config"; else CONFIG="$PREFIX/etc/privoxy/config"; fi\nexec privoxy --no-daemon $CONFIG 2>&1')
termux_step_pre_configure() {
# Certain packages are not safe to build on device because their
@ -34,7 +37,7 @@ termux_step_post_make_install() {
termux_step_post_massage() {
# copy default config files
for f in $TERMUX_PKG_CONFFILES; do
for f in $DEFAULT_CONFFILES; do
cp "$TERMUX_PKG_SRCDIR/$(basename $f)" "$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/$f"
done
}