# $Id$ PNAME="busybox" PVER="1.19.2" PBUILD="r2" PCATEGORIE="sys-apps" DESCRIPTION="BusyBox combines tiny versions of many common UNIX utilities into a single small executable." HOMEPAGE="http://www.busybox.net/" # shared busybox needs glibc DEPEND=">= virtual/glibc" PROVIDE="virtual/sed virtual/tar virtual/usbutils virtual/pciutils virtual/debianutils virtual/which virtual/wget virtual/grep virtual/bzip2 virtual/gzip virtual/syslog virtual/less virtual/net-tools virtual/inetutils virtual/kbd virtual/procps virtual/psmisc virtual/dhcp virtual/cron virtual/xz-utils" # busbox config CVS revision CFG_CVS_REV=1.14 # udhcpc client script CVS revision UDHCPC_CVS_REV=1.1 # mdev.r cvs revision MDEVRC_CVS_REV=1.3 # mdev.conf cvs revision MDEVCONF_CVS_REV=1.2 # syslogd.rc cvs revision SYSLOGD_CVS_REV=1.4 # splash.conf cvs revision SPLASHCONF_CVS_REV=1.3 # splash-functions.rc cvs revision SPLASHRC_CVS_REV=1.3 SRCFILE="${PNAME}-${PVER}.tar.bz2" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" MISC_PVER="0.1.8" MISC_SRCFILE="miscsplashutils-${MISC_PVER}.tar.bz2" MISC_SRCDIR="${BUILDDIR}/miscsplashutils-${MISC_PVER}" SPLASHTHEME_PVER="1.1" SPLASHTHEME_SRCFILE="mcore-theme-busybox-${SPLASHTHEME_PVER}.tar.bz2" SPLASHTHEME_SRCDIR="${BUILDDIR}/mcore-theme-busybox-${SPLASHTHEME_PVER}" sminclude mtools mcore SRC_URI=( http://www.busybox.net/downloads/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/config-${CFG_CVS_REV} mirror://${PNAME}/udhcpc.sh-${UDHCPC_CVS_REV} mirror://${PNAME}/de.kmap.gz mirror://${PNAME}/mdev.rc-${MDEVRC_CVS_REV} mirror://${PNAME}/mdev.conf-${MDEVCONF_CVS_REV} mirror://${PNAME}/dvbdev.sh mirror://${PNAME}/ide_links.sh mirror://${PNAME}/usbdev.sh mirror://${PNAME}/usbdisk_link.sh mirror://${PNAME}/syslogd.rc-${SYSLOGD_CVS_REV} mirror://${PNAME}/syslog.conf mirror://${PNAME}/crond.rc mirror://${PNAME}/splash-functions.rc-${SPLASHRC_CVS_REV} mirror://${PNAME}/splash.conf-${SPLASHCONF_CVS_REV} mirror://${PNAME}/${PNAME}-1.15.3-flags.patch mirror://${PNAME}/${PNAME}-1.19.2-crond.patch mirror://${PNAME}/${PNAME}-1.19.2-android.patch mirror://${PNAME}/${PNAME}-1.19.2-buildsys.patch mirror://${PNAME}/${PNAME}-1.19.2-chpasswd.patch mirror://${PNAME}/${PNAME}-1.19.2-inetd.patch mirror://${PNAME}/${PNAME}-1.19.2-syslogd.patch mirror://${PNAME}/${PNAME}-1.19.2-tail.patch mirror://${PNAME}/${PNAME}-1.19.2-tar-seamless-xz.patch mirror://${PNAME}/${PNAME}-1.19.0-fbsplash-tykef-1.0.patch http://dev.gentoo.org/~spock/projects/gensplash/current/${MISC_SRCFILE} mirror://${PNAME}/${MISC_SRCFILE} mirror://${PNAME}/${SPLASHTHEME_SRCFILE} ) src_prepare() { munpack ${SRCFILE} || die munpack de.kmap.gz ${SRCDIR} || die munpack ${MISC_SRCFILE} || die munpack ${SPLASHTHEME_SRCFILE} || die cd ${SRCDIR} # official patches mpatch ${PNAME}-1.19.2-crond.patch || die mpatch ${PNAME}-1.19.2-android.patch || die mpatch ${PNAME}-1.19.2-buildsys.patch || die mpatch ${PNAME}-1.19.2-chpasswd.patch || die mpatch ${PNAME}-1.19.2-inetd.patch || die mpatch ${PNAME}-1.19.2-syslogd.patch || die mpatch ${PNAME}-1.19.2-tail.patch || die # magellan patches # remove broken cflags mpatch ${PNAME}-1.15.3-flags.patch || die # seamless xz uncompression support in tar (tar -J) mpatch ${PNAME}-1.19.2-tar-seamless-xz.patch || die # enhanced fbsplash from tykef # http://tykef.havlinda.net/programovani/fbsplash/ mpatch ${PNAME}-1.19.0-fbsplash-tykef-1.0.patch || die # using a custom config cp ${SOURCEDIR}/${PNAME}/config-${CFG_CVS_REV} .config || die # hotfix for glibc-2.14, rpc interface not supported anymore sed -i 's/.*\(CONFIG_FEATURE_MOUNT_NFS\).*/#\ \1 is not set/' .config || die } src_compile() { cd ${SRCDIR} make oldconfig || die mmake || die # create a busybox.links file HOSTCC=gcc sh applets/busybox.mkll | sort > busybox.links || die # fix missing applet symlinks echo "/bin/du" >> busybox.links || die # do not use ash as default sh, we want bin/bash sed -i '/bin\/sh/d' busybox.links || die # use poweroff as default halt command sed -i '/sbin\/halt/d' busybox.links || die echo -e '#!/bin/sh\n/sbin/poweroff $*' > halt.sh || die # remove some applet symlinks which are provided by other packages ### umount (use from util-linux, need -t option) sed -i '/bin\/umount/d' busybox.links || die cd ${MISC_SRCDIR} mmake fbres || die } src_install() { cd ${SRCDIR} minstalldir /bin || die minstallexec busybox /bin || die # set suid bit for suid applets like su mchmod +s /bin/busybox || die minstalldir /sbin || die minstallexec halt.sh /sbin/halt || die minstalldir /usr/share/busybox || die minstallfile busybox.links /usr/share/busybox || die minstalldir /usr/share/busybox/keymaps || die minstallfile de.kmap /usr/share/busybox/keymaps || die minstalldir /usr/share/udhcpc || die minstallexec -s udhcpc.sh-${UDHCPC_CVS_REV} /usr/share/udhcpc/default.script || die minstallrc mdev.rc-${MDEVRC_CVS_REV} mdev || die minstalldir /etc || die minstallfile -s mdev.conf-${MDEVCONF_CVS_REV} /etc/mdev.conf || die # install mdev-helpers minstalldir /lib/mdev || die minstallexec -s dvbdev.sh /lib/mdev/devbdev || die minstallexec -s ide_links.sh /lib/mdev/ide_links || die minstallexec -s usbdev.sh /lib/mdev/usbdev || die minstallexec -s usbdisk_link.sh /lib/mdev/usbdisk_link || die # install syslogd rc script and config minstallrc syslogd.rc-${SYSLOGD_CVS_REV} syslogd || die minstallfile -s syslog.conf /etc/syslog.conf || die # install crond rc script and keep needed directories minstallrc crond.rc crond || die mkeepdir /var/spool/cron/crontabs || die # install splash-functions minstallrc splash-functions.rc-${SPLASHRC_CVS_REV} splash-functions || die minstalldir /etc/splash || die minstallfile -s splash.conf-${SPLASHCONF_CVS_REV} /etc/splash/splash.conf || die minstalldir /dev || die mkfifo ${BINDIR}/dev/splashfifo || die # install fbres for splash minstallexec ${MISC_SRCDIR}/fbres || die # install fbsplash theme cd ${SPLASHTHEME_SRCDIR} make DESTDIR=${BINDIR} install || die # set alx theme as default mlink alx /etc/splash/themes/default || die # disable config_protection for themes minstalldir /etc/env.d || die echo "CONFIG_PROTECT_MASK=/etc/splash/themes" > ${BINDIR}/etc/env.d/15splash || die # enable SPLASH_X11_TTY to supress flickers sed -i 's:#SPLASH_X11_TTY=:SPLASH_X11_TTY=:' ${BINDIR}/etc/splash/splash.conf || die } preinstall() { add_conf_prot_mask /etc/rc.d/init.d /etc/splash/themes /etc/splash/splash.conf /etc/env.d } postinstall() { if [ -x ${MROOT}/bin/busybox ] then echo "Setting suid bit for ${MROOT}/bin/busybox" chmod +s ${MROOT}/bin/busybox fi if [ -f ${MROOT}/usr/share/busybox/busybox.links ] then echo "Setting up busybox links ... " local i for i in $(< ${MROOT}/usr/share/busybox/busybox.links) do ln -snf /bin/busybox ${MROOT}/${i} done fi if [[ ! -p ${MROOT}/dev/splashfifo ]] then mkfifo ${MROOT}/dev/splashfifo fi # run syslogd *after* creating the busybox symlinks! mstartservice syslogd } postremove() { mstopservice syslogd }