From b09a6a5fcc5ddbc694feb02994461a92bcf457cd Mon Sep 17 00:00:00 2001 From: Tee KOBAYASHI Date: Fri, 4 Mar 2022 11:49:07 +0900 Subject: [PATCH] new package: tenki-php --- packages/tenki-php/build.sh | 34 +++++++++++++++++++++++++++++++ packages/tenki-php/tenki-php.conf | 16 +++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 packages/tenki-php/build.sh create mode 100644 packages/tenki-php/tenki-php.conf diff --git a/packages/tenki-php/build.sh b/packages/tenki-php/build.sh new file mode 100644 index 000000000..a94fa1331 --- /dev/null +++ b/packages/tenki-php/build.sh @@ -0,0 +1,34 @@ +TERMUX_PKG_HOMEPAGE=https://github.com/dmpop/tenki +TERMUX_PKG_DESCRIPTION="A simple PHP application for logging current weather conditions, notes, and waypoints" +TERMUX_PKG_LICENSE="GPL-3.0" +TERMUX_PKG_MAINTAINER="@termux" +_COMMIT=e59f7f97804fa0c4e6fcc9368cccf4379ad92d6e +TERMUX_PKG_VERSION=2022.01.08 +TERMUX_PKG_SRCURL=https://github.com/dmpop/tenki.git +TERMUX_PKG_GIT_BRANCH=main +TERMUX_PKG_DEPENDS="apache2, php" +TERMUX_PKG_PLATFORM_INDEPENDENT=true + +termux_step_post_get_source() { + git fetch --unshallow + git checkout $_COMMIT + + local version="$(git log -1 --format=%cs | sed 's/-/./g')" + if [ "$version" != "$TERMUX_PKG_VERSION" ]; then + echo -n "ERROR: The specified version \"$TERMUX_PKG_VERSION\"" + echo " is different from what is expected to be: \"$version\"" + return 1 + fi +} + +termux_step_make_install() { + local _TENKI_ROOT=$TERMUX_PREFIX/share/tenki-php + rm -rf ${_TENKI_ROOT} + mkdir -p ${_TENKI_ROOT} + cp -a $TERMUX_PKG_SRCDIR/* ${_TENKI_ROOT}/ + local _APACHE_CONF_DIR=$TERMUX_PREFIX/etc/apache2/conf.d + mkdir -p ${_APACHE_CONF_DIR} + sed -e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" \ + $TERMUX_PKG_BUILDER_DIR/tenki-php.conf \ + > ${_APACHE_CONF_DIR}/tenki-php.conf +} diff --git a/packages/tenki-php/tenki-php.conf b/packages/tenki-php/tenki-php.conf new file mode 100644 index 000000000..b42d4c79e --- /dev/null +++ b/packages/tenki-php/tenki-php.conf @@ -0,0 +1,16 @@ +Alias /tenki @TERMUX_PREFIX@/share/tenki-php + + + Options Indexes FollowSymLinks + DirectoryIndex index.php + + + AddType application/x-httpd-php .php + + php_flag magic_quotes_gpc Off + php_flag track_vars On + php_flag register_globals Off + php_value include_path . + + +