inherit eutils DESCRIPTION="CUPS backend to run LPR on a remote machine over SSH" HOMEPAGE="http://twofoos.org/content/labprinting/" SRC_URI="http://twofoos.org/content/labprinting/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="keybasedauth pitt" DEPEND="net-print/cups !keybasedauth? ( dev-perl/Expect ) pitt? ( net-print/foomatic-filters-ppds )" pkg_setup() { if use pitt && use keybasedauth; then eerror "Pitt printing does not work with key-based authentication." eerror "Disable one of the two USE flags and try again." die fi } src_unpack() { unpack ${A} cd "${S}" use keybasedauth && epatch "${S}/keybasedauthentication.patch" } src_compile() { true } src_install() { install -D sshlpd ${D}/usr/libexec/cups/backend/sshlpd || die "install failure" if use pitt; then install -D createpittprinters ${D}/usr/sbin/createpittprinters || die "install failure" fi dodoc README } pkg_postinst() { if use pitt; then einfo "After first installing sshlpd, you probably want to set up the" einfo "various Pitt printers. To do so most easily, run" einfo "/usr/sbin/createpittprinters as root and answer its questions." einfo "If you want to perform the setup manually, follow the" einfo "instructions at http://twofoos.org/content/labprinting/" else ewarn "You will probably have to edit /usr/libexec/cups/backend/sshlpd" ewarn "to change \$REMOTE_LPR to point to the lpr executable on the" ewarn "computer you will be ssh'ing into." ewarn "Yes, I should find a better way to handle that." ewarn "Sorry for the trouble." fi }