new package: tenki-php

This commit is contained in:
Tee KOBAYASHI 2022-03-04 11:49:07 +09:00 committed by xtkoba
parent d1a5f64726
commit b09a6a5fcc
2 changed files with 50 additions and 0 deletions

View File

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

View File

@ -0,0 +1,16 @@
Alias /tenki @TERMUX_PREFIX@/share/tenki-php
<Directory @TERMUX_PREFIX@/share/tenki-php>
Options Indexes FollowSymLinks
DirectoryIndex index.php
<IfModule mod_php7.c>
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 .
</IfModule>
</Directory>