# $Id$ PNAME="expect" PVER="5.43.0" PBUILD="r5" PCATEGORIE="dev-util" STATE="unstable" DESCRIPTION="A tool for automating interactive applications." HOMEPAGE="http://expect.nist.gov/" DEPEND=">= dev-lang/tcl-8.5 >= dev-lang/tk-8.5" SDEPEND=">= sys-dev/autoconf-5" SRCFILE="${PNAME}-${PVER}.tar.gz" SRCDIR="${BUILDDIR}/${PNAME}-${PVER%.[0-9]}" sminclude gnuconfig mtools SRC_URI=( http://expect.nist.gov/src/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/${PNAME}-${PVER}-multilib.patch mirror://${PNAME}/${PNAME}-${PVER}-libdir.patch mirror://${PNAME}/${PNAME}-${PVER}-tcl8.5.patch mirror://${PNAME}/${PNAME}-${PVER}-tcl8.5.6.patch mirror://${PNAME}/${PNAME}-${PVER}-pkgpath.patch mirror://${PNAME}/${PNAME}-${PVER}-pkgIndex-x.patch ) UP2DATE="updatecmd ${HOMEPAGE}/src | grep ${PNAME}- | lasttarball gz" src_prepare() { munpack ${SRCFILE} cd ${SRCDIR} mpatch ${PNAME}-${PVER}-multilib.patch || die mpatch ${PNAME}-${PVER}-libdir.patch || die # fix build with tcl-8.5 (missing includes) mpatch ${PNAME}-${PVER}-tcl8.5.patch || die # fix build with >=tcl-8.5.6 mpatch ${PNAME}-${PVER}-tcl8.5.6.patch || die # fix tcl-8.5 pkg-pathes mpatch ${PNAME}-${PVER}-pkgpath.patch || die # pkgIndex.tcl should not be an executable mpatch ${PNAME}-${PVER}-pkgIndex-x.patch || die sed -i "s:/usr/local/bin:/usr/bin:" expect.man || die sed -i "s:/usr/local/bin:/usr/bin:" expectk.man || die # stops any example scripts being installed by default sed -i -e '/^install:/s/install-libraries //' \ -e 's/^SCRIPTS_MANPAGES = /_&/' \ Makefile.in || die gnuconfig-update || die export WANT_AUTOCONF=2.1 aclocal || die autoconf || die cd testsuite autoconf -I.. || die } src_compile() { cd ${SRCDIR} local ver=$(grep TCL_VER /usr/include/tcl.h | sed 's/^.*"\(.*\)".*/\1/') mconfigure \ --enable-shared \ --with-tcl=/usr/$(mlibdir) \ --with-tclinclude=/usr/$(mlibdir)/tcl${ver}/include/generic \ --with-tk=/usr/$(mlibdir) \ || die mmake || die } src_install() { cd ${SRCDIR} # needed directories minstalldir /usr/$(mlibdir) || die mmake INSTALL_ROOT="${BINDIR}" install || die # remove static lib rm ${BINDIR}/usr/$(mlibdir)/${PNAME}${PVER%.[0-9]}/lib${PNAME}${PVER%.[0-9]}.a || die minstalldocs ChangeLog FAQ HISTORY NEWS README || die }