From d34270b56a0116f6f7705017bbc7f1c074f3ac17 Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Sun, 5 Jan 2020 21:06:06 +0100 Subject: [PATCH 1/6] privoxy: add termux-services script --- packages/privoxy/build.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/privoxy/build.sh b/packages/privoxy/build.sh index 16f2d7091..6d872b2e3 100644 --- a/packages/privoxy/build.sh +++ b/packages/privoxy/build.sh @@ -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 } From 51e8ff49707960e64ffff1194c90294272701bf8 Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Sun, 5 Jan 2020 21:26:18 +0100 Subject: [PATCH 2/6] nginx: add termux-services script --- packages/nginx/build.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/nginx/build.sh b/packages/nginx/build.sh index 6ff1030e1..86cf42fb2 100644 --- a/packages/nginx/build.sh +++ b/packages/nginx/build.sh @@ -3,11 +3,12 @@ TERMUX_PKG_DESCRIPTION="Lightweight HTTP server" TERMUX_PKG_LICENSE="BSD 2-Clause" TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas" TERMUX_PKG_VERSION=1.17.7 +TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=http://nginx.org/download/nginx-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=b62756842807e5693b794e5d0ae289bd8ae5b098e66538b2a91eb80f25c591ff TERMUX_PKG_DEPENDS="libandroid-glob, libcrypt, pcre, openssl, zlib" TERMUX_PKG_BUILD_IN_SRC=true - +TERMUX_PKG_SERVICE_SCRIPT=("nginx" 'mkdir -p ~/.nginx\nif [ -f "$HOME/.nginx/nginx.conf" ]; then CONFIG="$HOME/.nginx/nginx.conf"; else CONFIG="$PREFIX/etc/nginx/nginx.conf"; fi\nexec nginx -p ~/.nginx -c $CONFIG 2>&1') TERMUX_PKG_CONFFILES=" etc/nginx/fastcgi.conf etc/nginx/fastcgi_params @@ -19,7 +20,6 @@ etc/nginx/scgi_params etc/nginx/uwsgi_params etc/nginx/win-utf" - termux_step_pre_configure() { # Certain packages are not safe to build on device because their # build.sh script deletes specific files in $TERMUX_PREFIX. @@ -30,7 +30,7 @@ termux_step_pre_configure() { CPPFLAGS="$CPPFLAGS -DIOV_MAX=1024" LDFLAGS="$LDFLAGS -landroid-glob" - # remove config from previouse installs + # remove config from previous installs rm -rf "$TERMUX_PREFIX/etc/nginx" } @@ -103,4 +103,3 @@ termux_step_post_massage() { mkdir -p "$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/var/lib/nginx/$dir" done } - From 2a0d404de49243954942d8091f8c19132bc143f3 Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Sun, 5 Jan 2020 21:49:48 +0100 Subject: [PATCH 3/6] postgresql: add termux-services script for postgres --- packages/postgresql/build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/postgresql/build.sh b/packages/postgresql/build.sh index b620f917f..420c8a359 100644 --- a/packages/postgresql/build.sh +++ b/packages/postgresql/build.sh @@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Object-relational SQL database" TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_MAINTAINER='Vishal Biswas @vishalbiswas' TERMUX_PKG_VERSION=12.1 +TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://ftp.postgresql.org/pub/source/v$TERMUX_PKG_VERSION/postgresql-$TERMUX_PKG_VERSION.tar.bz2 TERMUX_PKG_SHA256=a09bf3abbaf6763980d0f8acbb943b7629a8b20073de18d867aecdb7988483ed TERMUX_PKG_DEPENDS="openssl, libcrypt, readline, libandroid-shmem, libuuid, libxml2, libicu, zlib" @@ -28,6 +29,7 @@ TERMUX_PKG_RM_AFTER_INSTALL="lib/libecpg* bin/ecpg share/man/man1/ecpg.1" TERMUX_PKG_HOSTBUILD=true TERMUX_PKG_BREAKS="postgresql-contrib (<= 10.3-1), postgresql-dev" TERMUX_PKG_REPLACES="postgresql-contrib (<= 10.3-1), postgresql-dev" +TERMUX_PKG_SERVICE_SCRIPT=("postgres" 'mkdir -p ~/.postgres\nexec postgres -D ~/.postgres/ 2>&1') termux_step_host_build() { # Build a native zic binary which we have patched to From e61ba6c324a50e92f9164c81fc0b40b9356ae2a3 Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Sun, 5 Jan 2020 21:55:00 +0100 Subject: [PATCH 4/6] php-fpm: add termux-services script --- packages/php/build.sh | 3 ++- packages/php/php-fpm.subpackage.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/php/build.sh b/packages/php/build.sh index 7d4842a01..ee7084d2a 100644 --- a/packages/php/build.sh +++ b/packages/php/build.sh @@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://php.net TERMUX_PKG_DESCRIPTION="Server-side, HTML-embedded scripting language" TERMUX_PKG_LICENSE="PHP-3.0" TERMUX_PKG_VERSION=7.4.1 -TERMUX_PKG_REVISION=6 +TERMUX_PKG_REVISION=7 TERMUX_PKG_SRCURL=https://secure.php.net/distributions/php-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=561bb866bdd509094be00f4ece7c3543ec971c4d878645ee81437e291cffc762 # Build native php for phar to build (see pear-Makefile.frag.patch): @@ -13,6 +13,7 @@ TERMUX_PKG_DEPENDS="freetype, libandroid-glob, libandroid-support, libbz2, libcr TERMUX_PKG_CONFLICTS="php-mysql, php-dev" TERMUX_PKG_REPLACES="php-mysql, php-dev" TERMUX_PKG_RM_AFTER_INSTALL="php/php/fpm" +TERMUX_PKG_SERVICE_SCRIPT=("php-fpm" 'mkdir -p ~/.php\nif [ -f "$HOME/.php/php-fpm.conf" ]; then CONFIG="$HOME/.php/php-fpm.conf"; else CONFIG="$PREFIX/etc/php-fpm.conf"; fi\nexec php-fpm -F -y $CONFIG -c ~/.php/php.ini 2>&1') TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" ac_cv_func_res_nsearch=no diff --git a/packages/php/php-fpm.subpackage.sh b/packages/php/php-fpm.subpackage.sh index 7f5159abc..bdceb05e1 100644 --- a/packages/php/php-fpm.subpackage.sh +++ b/packages/php/php-fpm.subpackage.sh @@ -1,3 +1,3 @@ -TERMUX_SUBPKG_INCLUDE="bin/php-fpm etc/php-fpm.conf etc/php-fpm.d/www.conf share/man/man8/php-fpm.8.gz" +TERMUX_SUBPKG_INCLUDE="bin/php-fpm etc/php-fpm.conf etc/php-fpm.d/www.conf share/man/man8/php-fpm.8.gz var/service/php-fpm" TERMUX_SUBPKG_CONFFILES="etc/php-fpm.conf etc/php-fpm.d/www.conf" TERMUX_SUBPKG_DESCRIPTION="FastCGI Process Manager for PHP" From 1ff471659197b82ef070e945f1c3b13930492076 Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Sun, 5 Jan 2020 22:36:49 +0100 Subject: [PATCH 5/6] lighttpd: add termux-services script Also install example config file --- packages/lighttpd/build.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/lighttpd/build.sh b/packages/lighttpd/build.sh index 67153477f..77d413c16 100644 --- a/packages/lighttpd/build.sh +++ b/packages/lighttpd/build.sh @@ -2,14 +2,20 @@ TERMUX_PKG_HOMEPAGE=https://www.lighttpd.net TERMUX_PKG_DESCRIPTION="Fast webserver with minimal memory footprint" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_VERSION=1.4.54 -TERMUX_PKG_REVISION=1 +TERMUX_PKG_REVISION=2 TERMUX_PKG_SHA256=cf14cce2254a96d8fcb6d3181e1a3c29a8f832531c3e86ff6f2524ecda9a8721 TERMUX_PKG_SRCURL=https://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-bzip2 --with-openssl --with-pcre --with-zlib" TERMUX_PKG_DEPENDS="libbz2, openssl, pcre, libcrypt, libandroid-glob, zlib" TERMUX_PKG_RM_AFTER_INSTALL="bin/lighttpd-angel" +TERMUX_PKG_SERVICE_SCRIPT=("lighttpd" 'if [ -f "$HOME/.lighttpd/lighttpd.conf" ]; then CONFIG="$HOME/.lighttpd/lighttpd.conf"; else CONFIG="$PREFIX/etc/lighttpd/lighttpd.conf"; fi\nexec lighttpd -D -f $CONFIG 2>&1') termux_step_pre_configure() { LDFLAGS="$LDFLAGS -landroid-glob" } +termux_step_post_make_install() { + # Install example config file + mkdir -p $TERMUX_PREFIX/etc/lighttpd + install -Dm600 $TERMUX_PKG_SRCDIR/doc/config/lighttpd.conf $TERMUX_PREFIX/etc/lighttpd/ +} From 7184c26b6162f78427d4d73651f1b0689911d45f Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Sun, 5 Jan 2020 23:27:57 +0100 Subject: [PATCH 6/6] mariadb: add termux-services script for mysqld --- packages/mariadb/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/mariadb/build.sh b/packages/mariadb/build.sh index e64f7e7fb..e91a4dda3 100644 --- a/packages/mariadb/build.sh +++ b/packages/mariadb/build.sh @@ -4,12 +4,13 @@ TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas" _VERSION=10.4.6 TERMUX_PKG_VERSION=1:${_VERSION} -TERMUX_PKG_REVISION=1 +TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=http://ftp.hosteurope.de/mirror/archive.mariadb.org/mariadb-${_VERSION}/source/mariadb-${_VERSION}.tar.gz TERMUX_PKG_SHA256=a270fe6169a1aaf6f2cbbc945de2c954d818c48e1a0fc02fbed92ecb94678e70 TERMUX_PKG_DEPENDS="libc++, libiconv, liblzma, ncurses, libedit, openssl, pcre, libcrypt, libandroid-support, libandroid-glob, zlib" TERMUX_PKG_BREAKS="mariadb-dev" TERMUX_PKG_REPLACES="mariadb-dev" +TERMUX_PKG_SERVICE_SCRIPT=("mysqld" 'exec mysqld --basedir=$PREFIX --datadir=$PREFIX/var/lib/mysql 2>&1') TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DBISON_EXECUTABLE=$(which bison)