# $Id$ PNAME="ccache" PVER="3.1.5" PBUILD="r2" PCAT="dev-util" DESCRIPTION="ccache is a caching pre-processor for C/C++ compilers." HOMEPAGE="http://ccache.samba.org/" DEPEND=">= virtual/glibc >= sys-libs/zlib-1.2.5" SRCFILE="${PNAME}-${PVER}.tar.bz2" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" CCC_REV=1.2 sminclude mbuild mtools SRC_URI=( http://samba.org/ftp/${PNAME}/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/ccache-config-${CCC_REV} ) UP2DATE="updatecmd ${HOMEPAGE} | grep latest | sed 's/.* \(.*\)\./\1/;q'" src_install() { cd ${SRCDIR} mmake DESTDIR=${BINDIR} install || die # bins minstallexec -s ccache-config-${CCC_REV} /usr/bin/ccache-config || die # fix hardcoded libdir sed -i "/^LIBDIR=/s:lib:$(mlibdir):" ${BINDIR}/usr/bin/ccache-config || die # special needed directories mkeepdir /root/.ccache || die mchmod 0700 /root/.ccache || die } postinstall() { if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] then echo "Setting up ccache with system compiler ..." /usr/bin/ccache-config --install-links /usr/bin/ccache-config --install-links ${CHOST} else echo "Please enter chroot of ${MROOT} and run:" echo " /usr/bin/ccache-config --install-links" echo " /usr/bin/ccache-config --install-links ${CHOST}" echo "to complete the installation." fi echo echo "Please setup your maximum compiler cache." echo "This sets up a cache with 2GB space:" echo " 'ccache -M 2G'" echo echo "To use ccache with smage, edit your /etc/mage.conf" echo "and add 'SMAGE_USE_CCACHE=true'." echo "Be sure that your mage version is not prior >= mage-0.3.6-r6." echo echo "If you are upgrading from an older version than 3.x you should clear" echo "all of your caches:" echo " 'ccache -C'" echo }