2017-01-23 09:58:04 +01:00
|
|
|
TERMUX_PKG_HOMEPAGE=https://busybox.net/
|
2015-06-13 01:03:31 +02:00
|
|
|
TERMUX_PKG_DESCRIPTION="Tiny versions of many common UNIX utilities into a single small executable"
|
2019-01-20 22:39:59 +01:00
|
|
|
TERMUX_PKG_LICENSE="GPL-2.0"
|
2019-02-16 00:34:30 +01:00
|
|
|
TERMUX_PKG_VERSION=1.30.1
|
2019-03-06 01:20:43 +01:00
|
|
|
TERMUX_PKG_REVISION=8
|
2017-01-23 09:58:04 +01:00
|
|
|
TERMUX_PKG_SRCURL=https://busybox.net/downloads/busybox-${TERMUX_PKG_VERSION}.tar.bz2
|
2019-07-22 13:13:32 +02:00
|
|
|
TERMUX_PKG_SHA256=3d1d04a4dbd34048f4794815a5c48ebb9eb53c5277e09ffffc060323b95dfbdc
|
2019-08-12 17:28:41 +02:00
|
|
|
TERMUX_PKG_BUILD_IN_SRC=true
|
2018-05-27 14:55:20 +02:00
|
|
|
|
2016-05-03 00:40:17 +02:00
|
|
|
# We replace env in the old coreutils package:
|
2016-05-03 00:50:05 +02:00
|
|
|
TERMUX_PKG_CONFLICTS="coreutils (<< 8.25-4)"
|
2015-06-13 01:03:31 +02:00
|
|
|
|
2019-02-08 10:37:29 +01:00
|
|
|
termux_step_pre_configure() {
|
2019-08-08 14:25:54 +02:00
|
|
|
# Certain packages are not safe to build on device because their
|
|
|
|
# build.sh script deletes specific files in $TERMUX_PREFIX.
|
2019-08-12 17:28:41 +02:00
|
|
|
if $TERMUX_ON_DEVICE_BUILD; then
|
2019-08-08 14:25:54 +02:00
|
|
|
termux_error_exit "Package '$TERMUX_PKG_NAME' is not safe for on-device builds."
|
|
|
|
fi
|
|
|
|
|
2017-03-05 23:46:48 +01:00
|
|
|
CFLAGS+=" -llog" # Android system liblog.so for syslog
|
2016-09-03 23:48:41 +02:00
|
|
|
}
|
2015-06-13 01:03:31 +02:00
|
|
|
|
2019-02-08 10:37:29 +01:00
|
|
|
termux_step_configure() {
|
2015-06-13 01:03:31 +02:00
|
|
|
cp $TERMUX_PKG_BUILDER_DIR/busybox.config .config
|
|
|
|
echo "CONFIG_SYSROOT=\"$TERMUX_STANDALONE_TOOLCHAIN/sysroot\"" >> .config
|
|
|
|
echo "CONFIG_PREFIX=\"$TERMUX_PREFIX\"" >> .config
|
|
|
|
echo "CONFIG_CROSS_COMPILER_PREFIX=\"${TERMUX_HOST_PLATFORM}-\"" >> .config
|
|
|
|
echo "CONFIG_FEATURE_CROND_DIR=\"$TERMUX_PREFIX/var/spool/cron\"" >> .config
|
2016-08-30 18:25:57 +02:00
|
|
|
echo "CONFIG_SV_DEFAULT_SERVICE_DIR=\"$TERMUX_PREFIX/var/service\"" >> .config
|
2015-06-13 01:03:31 +02:00
|
|
|
make oldconfig
|
|
|
|
}
|
|
|
|
|
2019-02-08 10:37:29 +01:00
|
|
|
termux_step_post_make_install() {
|
2019-08-12 17:28:41 +02:00
|
|
|
if $TERMUX_DEBUG; then
|
|
|
|
install -Dm700 busybox_unstripped $PREFIX/bin/busybox
|
2018-06-07 22:19:36 +02:00
|
|
|
fi
|
2015-06-13 01:03:31 +02:00
|
|
|
|
2019-07-22 13:13:32 +02:00
|
|
|
# Utilities diff, mv, rm, rmdir are necessary to assist with package upgrading
|
|
|
|
# after https://github.com/termux/termux-packages/issues/4070.
|
|
|
|
#
|
|
|
|
# Other utilities (like crond/crontab) are useful but not available
|
|
|
|
# as standalone package in Termux.
|
|
|
|
#
|
|
|
|
# Few notes:
|
|
|
|
#
|
2019-07-22 13:23:56 +02:00
|
|
|
# * runsv, runsvdir, sv - for things like in https://github.com/termux/termux-packages/pull/3460.
|
2019-07-22 13:13:32 +02:00
|
|
|
# * tcpsvd - required for ftpd applet.
|
|
|
|
# * vi - replaced by vim, but it still good to have basic text editor in bootstrap.
|
2019-07-22 13:36:06 +02:00
|
|
|
# * which - replaced by debianutils, but still good to have in bootstrap.
|
2019-07-22 13:13:32 +02:00
|
|
|
#
|
2019-07-21 23:45:12 +02:00
|
|
|
rm -Rf $TERMUX_PREFIX/bin/applets
|
|
|
|
mkdir -p $TERMUX_PREFIX/bin/applets
|
|
|
|
cd $TERMUX_PREFIX/bin/applets
|
2019-07-22 13:13:32 +02:00
|
|
|
for f in crond crontab diff ftpd ftpget ftpput hostname inotifyd \
|
|
|
|
iostat lsof lsusb mpstat mv nmeter rm rmdir runsv runsvdir \
|
2019-07-22 13:36:06 +02:00
|
|
|
sendmail start-stop-daemon sv svlogd tcpsvd uptime usleep \
|
|
|
|
vi which; do
|
2019-07-22 13:13:32 +02:00
|
|
|
ln -s ../busybox $f
|
|
|
|
done
|
|
|
|
unset f
|
2019-07-21 23:45:12 +02:00
|
|
|
|
2015-06-13 01:03:31 +02:00
|
|
|
# Install busybox man page
|
|
|
|
mkdir -p $TERMUX_PREFIX/share/man/man1
|
|
|
|
cp $TERMUX_PKG_SRCDIR/docs/busybox.1 $TERMUX_PREFIX/share/man/man1
|
2015-07-26 14:59:22 +02:00
|
|
|
|
|
|
|
# Needed for 'crontab -e' to work out of the box:
|
|
|
|
local _CRONTABS=$TERMUX_PREFIX/var/spool/cron/crontabs
|
|
|
|
mkdir -p $_CRONTABS
|
|
|
|
echo "Used by the busybox crontab and crond tools" > $_CRONTABS/README.termux
|
2016-08-30 18:25:57 +02:00
|
|
|
|
|
|
|
# Setup some services
|
|
|
|
mkdir -p $TERMUX_PREFIX/var/service
|
|
|
|
cd $TERMUX_PREFIX/var/service
|
2019-03-06 01:19:28 +01:00
|
|
|
mkdir -p ftpd/log telnetd/log
|
2016-08-30 18:25:57 +02:00
|
|
|
echo '#!/bin/sh' > ftpd/run
|
2019-07-21 21:24:43 +02:00
|
|
|
echo 'exec busybox tcpsvd -vE 0.0.0.0 8021 ftpd /data/data/com.termux/files/home' >> ftpd/run
|
2016-08-30 18:25:57 +02:00
|
|
|
echo '#!/bin/sh' > telnetd/run
|
2019-07-21 21:24:43 +02:00
|
|
|
echo 'exec busybox telnetd -F' >> telnetd/run
|
2016-08-30 18:25:57 +02:00
|
|
|
chmod +x */run
|
2019-03-06 01:19:28 +01:00
|
|
|
touch telnetd/down ftpd/down
|
|
|
|
ln -sf $PREFIX/share/termux-services/svlogger telnetd/log/run
|
|
|
|
ln -sf $PREFIX/share/termux-services/svlogger ftpd/log/run
|
2015-06-13 01:03:31 +02:00
|
|
|
}
|
|
|
|
|