Browse Source

Merge pull request #4749 from termux/service-scripts

termux-services: add service scripts for more packages
build-on-device
Henrik Grimler 5 years ago
committed by GitHub
parent
commit
231b9fb70d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      packages/lighttpd/build.sh
  2. 3
      packages/mariadb/build.sh
  3. 7
      packages/nginx/build.sh
  4. 3
      packages/php/build.sh
  5. 2
      packages/php/php-fpm.subpackage.sh
  6. 2
      packages/postgresql/build.sh
  7. 9
      packages/privoxy/build.sh

8
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/
}

3
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)

7
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
}

3
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

2
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"

2
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

9
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
}

Loading…
Cancel
Save