# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: Exp $ inherit eutils MY_PV=$(echo ${PV} | sed -r "s/([0-9]+\.[0-9]+)\.([0-9])/\\1\-\\2/") MY_PV2=$(echo ${PV} | sed -r "s/([0-9]+\.[0-9]+)\.([0-9])/\\1/") DESCRIPTION="High quality printer drivers for Linux - Free Edition" HOMEPAGE="http://turboprint.de/" SRC_URI="http://www.turboprint.de/${PN}-${MY_PV}.tgz" LICENSE="TurboPrint" SLOT="0" KEYWORDS="~x86" IUSE="cups gtk" RDEPEND="cups? ( net-print/cups ) !cups? ( virtual/lpr ) !cups? ( sys-apps/file ) !cups? ( app-text/psutils ) !cups? ( app-arch/gzip ) !cups? ( app-text/tetex ) !cups? ( sys-apps/groff ) !cups? ( media-libs/netpbm ) !cups? ( media-libs/jpeg ) !cups? ( app-text/a2ps ) !cups? ( app-text/enscript ) gtk? ( =x11-libs/gtk+-1.2* )" S=${WORKDIR}/${PN}-${MY_PV2} pkg_setup() { if [[ -n "$(echo ${FEATURES} | egrep '[^-A-Za-z]sandbox')" ]]; then ewarn "" ewarn "This package cannot be compiled with the sandbox feature" ewarn "turned on. Please merge this package by typing..." ewarn "" ewarn "FEATURES=\"-sandbox\" emerge turboprint" ewarn "" die "Please deactivate the sandbox feature!" fi } src_unpack() { unpack ${A} cd ${S} # Escape the slashes in ${D} ESC_D=$(echo ${D} | sed "s/\//\\\\\//g") # Most of the tweaks can be done with sed but for the others... epatch ${FILESDIR}/post-install.patch # Replace the RPM Build Root variable with our virtual root sed -i -r "s/[$]RBR/${ESC_D}/g" lib/install-* # Run the post-installation later sed -i -r "s/^lib\/install-post/#lib\/install-post/g" setup # Don't bother checking the dependencies sed -i -r "s/^lib\/install-info/#lib\/install-info/g" setup } src_install() { if use cups; then CUPS="--cups=1" else CUPS="--cups=0" fi ./setup --batch ${CUPS} --browser=mozilla --language=en --charset=C } pkg_postinst() { cd ${S} # Run the post-installation now lib/install-post --tgz ${CUPS} --browser=mozilla --language=en --charset=C einfo einfo " As a next step you will have to setup a printer with (x)tpsetup" einfo einfo " If you want the full functionality of this package you will have" einfo " to buy a keyfile from http://www.turboprint.de" einfo } #pkg_postrm() { # # Clean up the post-installation. This needs to be FIXED! # # rm -f /usr/lib/cups/filter/pstoturboprint # rm -f /usr/lib/cups/filter/rastertoturboprint # rm -f /usr/lib64/cups/filter/pstoturboprint # rm -f /usr/lib64/cups/filter/rastertoturboprint # # rm -rf /usr/share/turboprint # # rm -rf /usr/share/cups/model/turboprint #}