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"
|
|
|
|
TERMUX_PKG_ESSENTIAL=yes
|
2017-09-06 00:13:52 +02:00
|
|
|
TERMUX_PKG_VERSION=1.27.2
|
|
|
|
TERMUX_PKG_SHA256=9d4be516b61e6480f156b11eb42577a13529f75d3383850bb75c50c285de63df
|
2017-01-23 09:58:04 +01:00
|
|
|
TERMUX_PKG_SRCURL=https://busybox.net/downloads/busybox-${TERMUX_PKG_VERSION}.tar.bz2
|
2015-06-13 01:03:31 +02:00
|
|
|
TERMUX_PKG_BUILD_IN_SRC=yes
|
2017-08-21 01:35:23 +02:00
|
|
|
TERMUX_PKG_CLANG=no
|
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
|
|
|
|
2016-09-03 23:48:41 +02:00
|
|
|
termux_step_pre_configure () {
|
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
|
|
|
|
|
|
|
termux_step_configure () {
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
termux_step_post_make_install () {
|
|
|
|
# Create symlinks in $PREFIX/bin/applets to $PREFIX/bin/busybox
|
|
|
|
rm -Rf $TERMUX_PREFIX/bin/applets
|
|
|
|
mkdir -p $TERMUX_PREFIX/bin/applets
|
|
|
|
cd $TERMUX_PREFIX/bin/applets
|
|
|
|
for f in `cat $TERMUX_PKG_SRCDIR/busybox.links`; do ln -s ../busybox `basename $f`; done
|
|
|
|
|
2017-01-13 13:09:56 +01:00
|
|
|
# The 'env' applet is special in that it go into $PREFIX/bin:
|
2015-06-13 01:03:31 +02:00
|
|
|
cd $TERMUX_PREFIX/bin
|
2016-05-03 00:40:17 +02:00
|
|
|
ln -f -s busybox env
|
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
|
|
|
|
mkdir -p ftpd telnetd
|
|
|
|
echo '#!/bin/sh' > ftpd/run
|
|
|
|
echo 'exec tcpsvd -vE 0.0.0.0 8021 ftpd /data/data/com.termux/files/home' >> ftpd/run
|
|
|
|
echo '#!/bin/sh' > telnetd/run
|
|
|
|
echo 'exec telnetd -F' >> telnetd/run
|
|
|
|
chmod +x */run
|
2015-06-13 01:03:31 +02:00
|
|
|
}
|
|
|
|
|