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