2022-02-22 17:13:10 +01:00
|
|
|
TERMUX_PKG_HOMEPAGE=https://termux.org/
|
2016-04-19 16:28:08 +02:00
|
|
|
TERMUX_PKG_DESCRIPTION="Basic system tools for Termux"
|
2019-01-21 15:39:22 +01:00
|
|
|
TERMUX_PKG_LICENSE="GPL-3.0"
|
2020-12-20 14:16:34 +01:00
|
|
|
TERMUX_PKG_MAINTAINER="@termux"
|
2022-03-06 03:59:12 +01:00
|
|
|
TERMUX_PKG_VERSION=0.167
|
2019-08-14 13:27:16 +02:00
|
|
|
TERMUX_PKG_SKIP_SRC_EXTRACT=true
|
2019-08-12 17:28:41 +02:00
|
|
|
TERMUX_PKG_PLATFORM_INDEPENDENT=true
|
|
|
|
TERMUX_PKG_ESSENTIAL=true
|
2021-05-18 14:57:16 +02:00
|
|
|
TERMUX_PKG_BREAKS="termux-keyring (<< 1.9)"
|
2019-08-05 12:46:51 +02:00
|
|
|
TERMUX_PKG_CONFLICTS="procps (<< 3.3.15-2)"
|
2019-11-13 15:38:40 +01:00
|
|
|
TERMUX_PKG_SUGGESTS="termux-api"
|
2021-10-13 13:09:24 +02:00
|
|
|
TERMUX_PKG_CONFFILES="
|
|
|
|
etc/motd
|
|
|
|
etc/motd-playstore
|
|
|
|
etc/termux-login.sh
|
|
|
|
"
|
2019-08-05 12:46:51 +02:00
|
|
|
|
|
|
|
# Some of these packages are not dependencies and used only to ensure
|
|
|
|
# that core packages are installed after upgrading (we removed busybox
|
|
|
|
# from essentials).
|
2021-12-25 22:50:14 +01:00
|
|
|
TERMUX_PKG_DEPENDS="bzip2, coreutils, curl, dash, diffutils, findutils, gawk, grep, gzip, less, procps, psmisc, sed, tar, termux-am, termux-am-socket, termux-exec, util-linux, xz-utils, dialog"
|
2019-08-05 12:46:51 +02:00
|
|
|
|
|
|
|
# Optional packages that are distributed as part of bootstrap archives.
|
2020-03-30 14:19:14 +02:00
|
|
|
TERMUX_PKG_RECOMMENDS="ed, dos2unix, inetutils, net-tools, patch, unzip"
|
2015-06-13 01:03:31 +02:00
|
|
|
|
2019-02-08 10:37:29 +01:00
|
|
|
termux_step_make_install() {
|
2016-03-22 02:34:26 +01:00
|
|
|
# Remove LD_LIBRARY_PATH from environment to avoid conflicting
|
2017-01-08 10:53:36 +01:00
|
|
|
# with system libraries that system binaries may link against:
|
2022-01-05 06:05:55 +01:00
|
|
|
for tool in df getprop logcat mount ping ping6 pm settings top umount cmd; do
|
2016-03-22 03:42:11 +01:00
|
|
|
WRAPPER_FILE=$TERMUX_PREFIX/bin/$tool
|
|
|
|
echo '#!/bin/sh' > $WRAPPER_FILE
|
2018-01-24 17:20:25 +01:00
|
|
|
echo 'unset LD_LIBRARY_PATH LD_PRELOAD' >> $WRAPPER_FILE
|
2016-04-11 02:20:17 +02:00
|
|
|
# Some tools require having /system/bin/app_process in the PATH,
|
|
|
|
# at least am&pm on a Nexus 6p running Android 6.0:
|
|
|
|
echo -n 'PATH=$PATH:/system/bin ' >> $WRAPPER_FILE
|
2016-04-19 16:28:08 +02:00
|
|
|
echo "exec /system/bin/$tool \"\$@\"" >> $WRAPPER_FILE
|
2018-02-03 17:13:18 +01:00
|
|
|
chmod +x $WRAPPER_FILE
|
2016-03-22 02:34:26 +01:00
|
|
|
done
|
|
|
|
|
2021-09-25 13:26:10 +02:00
|
|
|
for script in chsh dalvikvm login pkg su termux-fix-shebang termux-backup \
|
|
|
|
termux-info termux-open termux-open-url termux-reload-settings \
|
|
|
|
termux-reset termux-restore termux-setup-storage termux-wake-lock \
|
|
|
|
termux-wake-unlock termux-change-repo; do
|
2019-09-19 22:57:17 +02:00
|
|
|
install -Dm700 $TERMUX_PKG_BUILDER_DIR/$script $TERMUX_PREFIX/bin/$script
|
2020-12-24 16:00:05 +01:00
|
|
|
sed -i -e "s%\@TERMUX_APP_PACKAGE\@%${TERMUX_APP_PACKAGE}%g" \
|
|
|
|
-e "s%\@TERMUX_BASE_DIR\@%${TERMUX_BASE_DIR}%g" \
|
|
|
|
-e "s%\@TERMUX_CACHE_DIR\@%${TERMUX_CACHE_DIR}%g" \
|
|
|
|
-e "s%\@TERMUX_HOME\@%${TERMUX_ANDROID_HOME}%g" \
|
|
|
|
-e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" \
|
|
|
|
-e "s%\@PACKAGE_VERSION\@%${TERMUX_PKG_VERSION}%g" \
|
2021-12-15 19:16:31 +01:00
|
|
|
-e "s%\@TERMUX_PACKAGE_FORMAT\@%${TERMUX_PACKAGE_FORMAT}%g" \
|
2020-06-07 19:05:11 +02:00
|
|
|
$TERMUX_PREFIX/bin/$script
|
2019-09-19 22:57:17 +02:00
|
|
|
done
|
2017-02-09 10:28:37 +01:00
|
|
|
|
2019-09-19 22:57:17 +02:00
|
|
|
install -Dm600 $TERMUX_PKG_BUILDER_DIR/motd $TERMUX_PREFIX/etc/motd
|
2021-09-09 01:25:48 +02:00
|
|
|
install -Dm600 $TERMUX_PKG_BUILDER_DIR/motd-playstore $TERMUX_PREFIX/etc/motd-playstore
|
2019-09-19 22:57:17 +02:00
|
|
|
ln -sfr $TERMUX_PREFIX/bin/termux-open $TERMUX_PREFIX/bin/xdg-open
|
2020-10-02 20:29:55 +02:00
|
|
|
|
|
|
|
mkdir -p $TERMUX_PREFIX/share/man/man1
|
2020-10-30 21:15:19 +01:00
|
|
|
sed -e "s|@TERMUX_PREFIX@|${TERMUX_PREFIX}|g" -e "s|@TERMUX_HOME@|${TERMUX_ANDROID_HOME}|g" \
|
|
|
|
$TERMUX_PKG_BUILDER_DIR/termux.1.md.in > $TERMUX_PKG_TMPDIR/termux.1.md
|
2020-10-02 20:29:55 +02:00
|
|
|
pandoc --standalone --to man --output $TERMUX_PREFIX/share/man/man1/termux.1 \
|
2020-10-30 21:15:19 +01:00
|
|
|
$TERMUX_PKG_TMPDIR/termux.1.md
|
2021-01-06 15:00:09 +01:00
|
|
|
|
|
|
|
mkdir -p $TERMUX_PREFIX/share/examples/termux
|
|
|
|
install -Dm600 $TERMUX_PKG_BUILDER_DIR/termux.properties $TERMUX_PREFIX/share/examples/termux/
|
|
|
|
|
2021-02-27 21:49:55 +01:00
|
|
|
mkdir -p $TERMUX_PREFIX/etc/profile.d
|
|
|
|
cat <<- EOF > $TERMUX_PREFIX/etc/profile.d/init-termux-properties.sh
|
2021-04-04 04:45:56 +02:00
|
|
|
if [ ! -f $TERMUX_ANDROID_HOME/.config/termux/termux.properties ] && [ ! -e $TERMUX_ANDROID_HOME/.termux/termux.properties ]; then
|
2021-02-27 21:49:55 +01:00
|
|
|
mkdir -p $TERMUX_ANDROID_HOME/.termux
|
|
|
|
cp $TERMUX_PREFIX/share/examples/termux/termux.properties $TERMUX_ANDROID_HOME/.termux/
|
2021-01-06 15:00:09 +01:00
|
|
|
fi
|
|
|
|
EOF
|
2021-10-13 13:09:24 +02:00
|
|
|
|
|
|
|
cat <<- EOF > $TERMUX_PREFIX/etc/termux-login.sh
|
|
|
|
##
|
|
|
|
## This script is sourced by $PREFIX/bin/login before executing shell.
|
|
|
|
##
|
|
|
|
EOF
|
2015-06-13 01:03:31 +02:00
|
|
|
}
|