termux-tools: use profile script to generate a sample termux.properties

Avoid use of postinst or preinst scripts in bootstrap packages. They will not
be executed.
This commit is contained in:
Leonid Pliushch 2021-02-27 22:49:55 +02:00
parent f3d42fca99
commit 7b5a67d416
No known key found for this signature in database
GPG Key ID: 45F2964132545795

View File

@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://termux.com/
TERMUX_PKG_DESCRIPTION="Basic system tools for Termux"
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=0.111
TERMUX_PKG_VERSION=0.112
TERMUX_PKG_SKIP_SRC_EXTRACT=true
TERMUX_PKG_PLATFORM_INDEPENDENT=true
TERMUX_PKG_ESSENTIAL=true
@ -56,17 +56,12 @@ termux_step_make_install() {
mkdir -p $TERMUX_PREFIX/share/examples/termux
install -Dm600 $TERMUX_PKG_BUILDER_DIR/termux.properties $TERMUX_PREFIX/share/examples/termux/
}
termux_step_create_debscripts() {
cat <<- EOF > ./postinst
#!${TERMUX_PREFIX}/bin/bash
if [ -f "${TERMUX_ANDROID_HOME}/.termux/termux.properties" ]; then
exit 0
mkdir -p $TERMUX_PREFIX/etc/profile.d
cat <<- EOF > $TERMUX_PREFIX/etc/profile.d/init-termux-properties.sh
if [ ! -e $TERMUX_ANDROID_HOME/.termux/termux.properties ]; then
mkdir -p $TERMUX_ANDROID_HOME/.termux
cp $TERMUX_PREFIX/share/examples/termux/termux.properties $TERMUX_ANDROID_HOME/.termux/
fi
echo "Installing default termux.properties to ~/.termux/"
mkdir -p ~/.termux
cp ${TERMUX_PREFIX}/share/examples/termux/termux.properties ~/.termux/
exit 0
EOF
}