# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit multilib eutils rpm DESCRIPTION="Canon CUPS Capt driver" HOMEPAGE="http://www.canon.com/" SRC_URI="Source.tar.gz" LICENSE="CANON" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="" RESTRICT="fetch" DEPEND="=net-print/cndrvcups-common-1.30 >=net-print/cups-1.1.17 =x11-libs/gtk+-1.2*" RDEPEND="${DEPEND} app-text/ghostscript-esp >=sys-apps/portage-2.1.1_pre1 amd64? ( >=app-emulation/emul-linux-x86-gtklibs-2.0 >=app-emulation/emul-linux-x86-baselibs-10.0 ) !amd64? ( dev-libs/popt dev-libs/libxml2 )" pkg_setup() { if use amd64 && ( [ ! -e /usr/lib32/libpopt.so.0 ] ); then eerror "The file libpopt.so.0 need to be in /usr/lib32" eerror "Since there aren't any emul-linux-x86 package for these you need" eerror "to manually copy these files from a another machine" die fi } pkg_nofetch() { einfo "Please download Source.tar.gz from" einfo "http://software.canon-europe.com/software/0023675.asp" einfo einfo "Then put the file in ${DISTDIR}" } pkg_postinst() { einfo "To get your printer working you need to restart cupsd" einfo einfo "/etc/init.d/cupsd restart" einfo einfo "Now you can add your printer with either the webinterface or lpadmin" einfo einfo "/usr/sbin/lpadmin -p LBP1120 -m CNCUPSLBP1120CAPTK.ppd -v ccp:/var/ccpd/fifo0 -E" einfo einfo "Replace 1120 with either on of the following printers:" einfo "1120 1210 2900 3000 3200 3210 3300 5000" einfo einfo "Now you must register the printer in ccpd, if connected with usb" einfo einfo "/usr/sbin/ccpdadmin -p LBP1120 -o /dev/usb/lp0" einfo einfo "Notice that you can't use LPT port with this driver." einfo "If you have a network connection to your printer use -o net:" einfo "instead of -o /dev/usb/lp0" einfo "See manual for more information, guide-capt-1.3xE.tar.gz at " einfo "http://software.canon-europe.com/software/canon_capt_printer_driver_for_linuxs23675.asp" einfo einfo "Now you can go ahead and start the ccpd daemon" einfo einfo "/etc/init.d/ccpd start" einfo einfo "If you have more then one printer just create more fifos in" einfo "/var/ccpd/ , increase the fifo number for more printers" einfo einfo "mkfifo -m 600 /var/ccpd/fifo1; chown lp:lp /var/ccpd/fifo1" einfo einfo einfo "There is a statusgui that comes with the driver, captstatusgui" einfo ewarn "If you reinstall make sure the fifo is created in /var/ccpd, if not" ewarn "just reinstall again. This is due to bug #136199" } src_unpack() { unpack ${A} rpm_unpack Source/${P}-1.src.rpm OLD_DISTDIR=${DISTDIR} DISTDIR=${WORKDIR} unpack ${P}-1.tar.gz DISTDIR=${OLD_DISTDIR} } src_compile() { for i in driver backend pstocapt pstocapt2 ppd statusui; do cd ${i} NOCONFIGURE=1 ./autogen.sh econf emake cd .. done } src_install() { for i in driver backend pstocapt pstocapt2 ppd statusui; do cd ${i} make install DESTDIR=${D} || die "make install failed for ${i}" cd .. done # Install the libs OABI=${ABI} has_multilib_profile && ABI="x86" for i in `cd libs; ls *.so.?.?.?; cd ..`; do # Hmm.. Shouldn't these go to lib32 instead? dolib.so libs/${i} dosym ${i} /usr/$(get_libdir)/${i%.?.?} # Fix the version stuff of libs dosym ${i} /usr/$(get_libdir)/${i%.?.?.?} done # Install bin dobin libs/captmon/captmon \ libs/captmon2/captmon2 \ libs/captfilter \ libs/captemon/captmonlbp5000 \ libs/captemon/captmonlbp3300 \ libs/captdrv # Install sbin dosbin libs/ccpd libs/ccpdadmin ABI=${OABI} # Install the data insinto /usr/share/ccpd doins libs/ccpddata/CNAB1CL.BIN libs/ccpddata/CNAC4CL.BIN insinto /usr/share/captmon doins libs/captmon/msgtable.xml insinto /usr/share/captmon2 doins libs/captmon2/msgtable2.xml insinto /usr/share/captemon doins libs/captemon/msgtablelbp5000.xml libs/captemon/msgtablelbp3300.xml insinto /usr/local/canon/lib/profiles doins data/CNL7* insinto /usr/local/share/cnaccm doins data/CnA* # Install doc dodoc LICENSE* README* COPYING for i in driver backend pstocapt pstocapt2 ppd statusui; do docinto ${i} dodoc ${i}/NEWS ${i}/README ${i}/AUTHORS ${i}/ChangeLog ${i}/LICENSE* done docinto statusui dodoc statusui/COPYING statusui/INSTALL # Because hardcoded in provided libs # Is this correct? dosym /usr/share/locale/ja/LC_MESSAGES/captstatusui.mo \ /usr/local/share/locale/ja/LC_MESSAGES/captstatusui.mo dosym /usr/bin/captstatusui /usr/local/bin/captstatusui # Fix the fifos dodir /var/ccpd mkfifo -m 600 ${D}/var/ccpd/fifo0 fowners lp:lp /var/ccpd/fifo0 # fix captmon dodir /var/captmon fowners lp:lp /var/captmon keepdir /var/captmon # Install startupscripts newinitd ${FILESDIR}/${PN}-init.d ccpd insinto /etc doins samples/ccpd.conf }