Commit | Line | Data |
---|---|---|
676cec13 | 1 | TERMUX_PKG_HOMEPAGE=https://busybox.net/ |
59f0d218 FF |
2 | TERMUX_PKG_DESCRIPTION="Tiny versions of many common UNIX utilities into a single small executable" |
3 | TERMUX_PKG_ESSENTIAL=yes | |
3bae08c7 | 4 | TERMUX_PKG_VERSION=1.26.2 |
676cec13 FF |
5 | TERMUX_PKG_REVISION=1 |
6 | TERMUX_PKG_SRCURL=https://busybox.net/downloads/busybox-${TERMUX_PKG_VERSION}.tar.bz2 | |
3bae08c7 | 7 | TERMUX_PKG_SHA256=da3e44913fc1a9c9b7c5337ea5292da518683cbff32be630777f565d6036af16 |
59f0d218 | 8 | TERMUX_PKG_BUILD_IN_SRC=yes |
e4ba46a8 | 9 | # We replace env in the old coreutils package: |
324ea7ac | 10 | TERMUX_PKG_CONFLICTS="coreutils (<< 8.25-4)" |
59f0d218 | 11 | |
ed021630 FF |
12 | # NOTE: sed on mac does not work for building busybox, install gnu-sed with |
13 | # homebrew using the --with-default-names option. | |
59f0d218 | 14 | |
385c8aef FF |
15 | termux_step_pre_configure () { |
16 | CFLAGS+=" -llog -DTERMUX_EXPOSE_MEMPCPY=1" # Android system liblog.so for syslog | |
17 | } | |
59f0d218 FF |
18 | |
19 | termux_step_configure () { | |
59f0d218 FF |
20 | cp $TERMUX_PKG_BUILDER_DIR/busybox.config .config |
21 | echo "CONFIG_SYSROOT=\"$TERMUX_STANDALONE_TOOLCHAIN/sysroot\"" >> .config | |
22 | echo "CONFIG_PREFIX=\"$TERMUX_PREFIX\"" >> .config | |
23 | echo "CONFIG_CROSS_COMPILER_PREFIX=\"${TERMUX_HOST_PLATFORM}-\"" >> .config | |
24 | echo "CONFIG_FEATURE_CROND_DIR=\"$TERMUX_PREFIX/var/spool/cron\"" >> .config | |
6b14aeb8 | 25 | echo "CONFIG_SV_DEFAULT_SERVICE_DIR=\"$TERMUX_PREFIX/var/service\"" >> .config |
59f0d218 FF |
26 | make oldconfig |
27 | } | |
28 | ||
29 | termux_step_post_make_install () { | |
30 | # Create symlinks in $PREFIX/bin/applets to $PREFIX/bin/busybox | |
31 | rm -Rf $TERMUX_PREFIX/bin/applets | |
32 | mkdir -p $TERMUX_PREFIX/bin/applets | |
33 | cd $TERMUX_PREFIX/bin/applets | |
34 | for f in `cat $TERMUX_PKG_SRCDIR/busybox.links`; do ln -s ../busybox `basename $f`; done | |
35 | ||
3bae08c7 | 36 | # The 'env' applet is special in that it go into $PREFIX/bin: |
59f0d218 | 37 | cd $TERMUX_PREFIX/bin |
e4ba46a8 | 38 | ln -f -s busybox env |
59f0d218 FF |
39 | |
40 | # Install busybox man page | |
41 | mkdir -p $TERMUX_PREFIX/share/man/man1 | |
42 | cp $TERMUX_PKG_SRCDIR/docs/busybox.1 $TERMUX_PREFIX/share/man/man1 | |
f6b57934 FF |
43 | |
44 | # Needed for 'crontab -e' to work out of the box: | |
45 | local _CRONTABS=$TERMUX_PREFIX/var/spool/cron/crontabs | |
46 | mkdir -p $_CRONTABS | |
47 | echo "Used by the busybox crontab and crond tools" > $_CRONTABS/README.termux | |
6b14aeb8 FF |
48 | |
49 | # Setup some services | |
50 | mkdir -p $TERMUX_PREFIX/var/service | |
51 | cd $TERMUX_PREFIX/var/service | |
52 | mkdir -p ftpd telnetd | |
53 | echo '#!/bin/sh' > ftpd/run | |
54 | echo 'exec tcpsvd -vE 0.0.0.0 8021 ftpd /data/data/com.termux/files/home' >> ftpd/run | |
55 | echo '#!/bin/sh' > telnetd/run | |
56 | echo 'exec telnetd -F' >> telnetd/run | |
57 | chmod +x */run | |
59f0d218 FF |
58 | } |
59 |