# $Id: tcl-8.5.7-r4.smage2 3422 2009-10-21 18:53:03Z niro $ PNAME="tcl" PVER="8.5.9" PBUILD="r1" PCATEGORIE="dev-lang" STATE="unstable" DESCRIPTION="The Tcl package contains the Tool Command Language, a robust general-purpose scripting language." HOMEPAGE="http://tcl.sourceforge.net/" DEPEND=">= virtual/glibc" SDEPEND=">= sys-apps/sed-4" SRCFILE="${PNAME}${PVER}-src.tar.gz" SRCDIR="${BUILDDIR}/${PNAME}${PVER}" sminclude mtools SRC_URI=( sourceforge://${PNAME}/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/${PNAME}-8.5.5-libdir.patch ) UP2DATE="updatecmd_sourceforge ${PNAME} Tcl" src_prepare() { munpack ${SRCFILE} || die cd ${SRCDIR} # support variable libdir mpatch ${PNAME}-8.5.5-libdir.patch || die } src_compile() { cd ${SRCDIR}/unix mconfigure || die mmake CFLAGS="${CFLAGS}" || die } src_install() { cd ${SRCDIR}/unix local V="$(echo ${PVER} | cut -d "." -f 1,2)" # removes the reference to the build directory # and replace them by saner system wide locations sed -i "s:${SRCDIR}/unix:/usr/$(mlibdir):" tclConfig.sh || die sed -i "s:${SRCDIR}:/usr/include/tcl${V}:" tclConfig.sh || die sed -i "s,^TCL_LIB_FILE='libtcl${V}..TCL_DBGX..so',TCL_LIB_FILE=\"libtcl${V}\$\{TCL_DBGX\}.so\"," tclConfig.sh || die # fixes a small doc issue cause Thread.3 maybe used by other packages # mv ../doc/{,Tcl_}Thread.3 || die # sed -i 's/ Thread.3/ Tcl_Thread.3/' mkLinks || die # installs tcl make INSTALL_ROOT=${BINDIR} \ MAN_INSTALL_DIR=${BINDIR}/usr/share/man \ install || die # installs the internal headers into a system-wide location. minstalldir /usr/include/tcl${V}/unix || die minstallfile \*.h /usr/include/tcl${V}/unix/ || die minstalldir /usr/include/tcl${V}/generic || die minstallfile ../generic/\*.h /usr/include/tcl${V}/generic/ || die rm -f ${BINDIR}/usr/include/tcl${V}/generic/{tcl,tclDecls,tclPlatDecls}.h || die # symlink unix private headers to generic (expect needs that) mlink ../unix/tclUnixPort.h /usr/include/tcl${V}/generic || die mlink ../unix/tclUnixThrd.h /usr/include/tcl${V}/generic || die # creates compatibility symbolic links for the libs mlink ../../include/tcl${V} /usr/$(mlibdir)/tcl${V}/include || die mlink libtcl${V}.so /usr/$(mlibdir)/libtcl.so || die mlink tclsh${V} /usr/bin/tclsh || die cd ${SRCDIR} minstalldocs ChangeLog* changes license.terms README || die }