# $Id$ PNAME="coreutils" PVER="7.6" PBUILD="r3" PCATEGORIE="sys-apps" STATE="unstable" DESCRIPTION="Standard GNU file utilities (chmod, cp, dd, dir, ls, etc)." HOMEPAGE="http://www.gnu.org/software/coreutils/coreutils.html" DEPEND=">= virtual/glibc >= sys-libs/ncurses-5.7 >= dev-libs/gmp-4.3 >= sys-dev/gettext-0.17" SDEPEND=">= sys-dev/automake-3 >= sys-dev/autoconf-4 >= sys-dev/m4-1.4 >= virtual/glibc >= sys-libs/ncurses-5.7 >= dev-libs/gmp-4.3 >= sys-dev/gettext-0.17" SRCFILE="${PNAME}-${PVER}.tar.gz" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" sminclude mtools mcore-split SRC_URI=( gnu://${PNAME}/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/patches-${PVER}/${PNAME}-5.3.0-dumbterm.patch mirror://${PNAME}/patches-${PVER}/${PNAME}-5.3.0-mem.patch mirror://${PNAME}/patches-${PVER}/${PNAME}-5.3.0-uname.patch mirror://${PNAME}/patches-${PVER}/${PNAME}-5.94-more-dir-colors.patch ) UP2DATE="updatecmd_gnu ${PNAME} gz" src_prepare() { munpack ${SRCFILE} || die cd ${SRCDIR} # mandrake patches mpatch ${PNAME}-5.3.0-dumbterm.patch || die mpatch ${PNAME}-5.3.0-mem.patch || die # generic patches mpatch ${PNAME}-5.3.0-uname.patch || die mpatch ${PNAME}-5.94-more-dir-colors.patch || die # fix compilation with newer versions of glibc sed -i "s/futimens/gl_&/" $(grep -lr futimens *) || die if [[ -z $(which cvs 2>/dev/null) ]] then # fix issues with gettext's autopoint if cvs is not installed export AUTOPOINT="/bin/true" fi export WANT_AUTOMAKE=1.11 export WANT_AUTOCONF=2.5 aclocal -I m4 &>/dev/null || die autoconf || die automake || die } src_compile() { cd ${SRCDIR} mconfigure --enable-largefile --enable-nls --disable-acl --disable-xattr || die mmake || die } generic_src_install() { cd ${SRCDIR} # some needed directories minstalldir /usr/bin || die minstalldir /usr/sbin || die minstalldir /bin || die minstalldir /sbin || die make DESTDIR=${BINDIR} install-root || die make DESTDIR=${BINDIR} install || die mv ${BINDIR}/usr/bin/{basename,cat,chgrp,chmod,chown,cp,dd,df} ${BINDIR}/bin || die mv ${BINDIR}/usr/bin/{dir,dircolors,du,date,echo,false,head} ${BINDIR}/bin || die mv ${BINDIR}/usr/bin/{install,ln,ls,mkdir,mkfifo,mknod,mv,pwd} ${BINDIR}/bin || die # small dirty fix, after move 'mv' will not be found anymore mlink /bin/mv /usr/bin/mv || die mv ${BINDIR}/usr/bin/{rm,rmdir,shred,sync,sleep,stty,test} ${BINDIR}/bin || die mv ${BINDIR}/usr/bin/{touch,true,uname,vdir} ${BINDIR}/bin || die mv ${BINDIR}/usr/bin/chroot ${BINDIR}/sbin || die mlink test /bin/[ || die mlink ../../bin/install /usr/bin || die minstalldocs ABOUT-NLS AUTHORS COPYING ChangeLog NEWS README THANKS TODO || die } src_install_coreutils() { generic_src_install # cleanup zapmost ${BINDIR} bin/dircolors bin/install bin/ls usr/bin/mktemp bin/touch || die } src_install_coreutils_dev() { generic_src_install # cleanup rm ${BINDIR}/bin/dircolors || die rm ${BINDIR}/bin/install || die rm ${BINDIR}/bin/ls || die rm ${BINDIR}/usr/bin/mktemp || die rm ${BINDIR}/bin/touch || die } preinstall() { if [[ ! -z $(magequery -n mktemp) ]] then echo -e ${COLRED} echo -e "Error: sys-apps/mktemp is installed!!" echo -e "mktemp is now provided by coreutils and doesn't need an extra package anymore." echo -e "Please uninstall sys-apps/mktemp first!" echo -e ${COLDEFAULT} die "sys-apps/mktemp found!" fi }