Index: busybox-1.00_pre5.ebuild =================================================================== RCS file: /home/cvsroot/gentoo-x86/sys-apps/busybox/busybox-1.00_pre5.ebuild,v retrieving revision 1.1 diff -u -b -B -w -p -r1.1 busybox-1.00_pre5.ebuild --- busybox-1.00_pre5.ebuild 24 Dec 2003 08:13:54 -0000 1.1 +++ busybox-1.00_pre5.ebuild 3 Feb 2004 01:32:02 -0000 @@ -11,7 +11,7 @@ HOMEPAGE="http://www.busybox.net" SLOT="0" LICENSE="GPL-2" KEYWORDS="~x86" -IUSE="debug static uclibc" +IUSE="debug static uclibc savedconfig" # Forward anticipation of expected supported arches would include ~x86 # ~alpha ~mips ~ppc ~sparc @@ -37,15 +37,34 @@ src_unpack() { unpack ${A} cd ${S} + # check for a busybox config before making one of our own. + # if one exist lets return and use it. + # fine grained config control for user defined busybox configs. + # [package]-[version]-[revision].config + # [package]-[version].config + # [package].config + + if use savedconfig; then + [ -r .config ] && rm .config + for conf in ${PN}-${PV}-${PR},${PN}-${PV},${PN}.config; do + if [ -r /etc/${PN}/${CCHOST}/${conf} ]; then + cp /etc/${PN}/${CCHOST}/${conf} ${S}/.config + break; + fi + done + if [ -r "${S}/.config" ]; then + einfo "Found your /etc/${PN}/${CCHOST}/${conf} and using it." + return 0 + fi + fi + # busybox has changed quite a bit from 0.[5-6]* to 1.x so this # config might not be cd ready. - make allyesconfig + make allyesconfig > /dev/null busybox_config_option n DMALLOC busybox_config_option n FEATURE_SUID - #[ -f .config ] || die "No .config file found for ${PN}" - # setting the cross compiler from here would be somewhat of a # pain do to as we would need a multiline sed expression which # does not always seem to work so hot for me. @@ -56,8 +75,7 @@ src_unpack() { # 1.00-pre2 uses the old selinux api which is no longer # maintained. perhaps the next stable release will include # support. - # - + # 1.00-pre5 pebenito says busybox is still using the old se api. #[ `use selinux` ] && busybox_config_option y SELINUX || busybox_config_option n SELINUX @@ -82,10 +100,6 @@ src_unpack() { *) ;; esac - # This could almost work but might not be a good idea till we - # find a better sed expression for busybox_config_option() or - # per package use flags come into play. - # #busybox_features=`grep CONFIG_ .config | tr '#' '\n' | # awk '{print $1}' | cut -d = -f 1 | grep -v ^$ | cut -c 8- | # tr [A-Z] [a-z] | awk '{print "busybox_"$1}'` @@ -93,10 +107,11 @@ src_unpack() { # has $f ${FEATURES} && busybox_config_option y `echo ${f/busybox_/}|tr [a-z] [A-Z]` #done echo | make clean oldconfig > /dev/null + } src_compile() { - if [ `use uclibc` ]; then + if use uclibc; then case ${ARCH} in x86*) CROSS="/usr/i386-linux-uclibc/bin/i386-uclibc-";; *) ;; @@ -147,14 +162,21 @@ src_install() { tar --no-same-owner -jcvf \ ${WORKDIR}/${MY_P}-${ARCH}.bz2 . && cd .. fi + + if use savedconfig; then + einfo "Saving this build config to /etc/${PN}/${CCHOST}/${PN}-${PV}-${PR}.config" + einfo "Read this ebuild for more info on how to take advantage of this option" + mkdir -p ${D}/etc/${PN}/${CCHOST}/ + cp ${S}/.config ${D}/etc/${PN}/${CCHOST}/${PN}-${PV}-${PR}.config + fi } pkg_postinst() { - einfo "" - einfo "Edit /usr/portage/sys-apps/busybox/files/${MY_P}.config and" - einfo "re-emerge if you need to add/remove functionality in " - einfo "BusyBox." - einfo "" - [ `has buildpkg ${FEATURES}` -a `has keepwork ${FEATURES}` ] && - einfo "A ${PN} minipkg can be found at ${WORKDIR}/${MY_P}-${ARCH}.bz2" + echo + einfo "This ebuild has support for user defined configs" + einfo "Please read this ebuild for more details and re-emerge as needed" + einfo "if you want to add or remove functionality for ${PN}" + echo + #[ `has buildpkg ${FEATURES}` -a `has keepwork ${FEATURES}` ] && + # einfo "A ${PN} minipkg can be found at ${WORKDIR}/${MY_P}-${ARCH}.bz2" }