# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit rpm multilib eutils DESCRIPTION="Brother HL-5250DN LPR print drivers with CUPS wrapper." HOMEPAGE="http://solutions.brother.com/linux/en_us/index.html" SRC_URI="http://solutions.brother.com/Library/sol/printer/linux/dlf/pt9500pccupswrapper-1.0.0-5.redhat.i386.rpm" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="" RESTRICT="strip" DEPEND="net-print/cups app-arch/rpm >=net-print/brother-pt9500pc-lpr-1.0.0" RDEPEND="${DEPEND}" src_unpack() { CUPSD="pt9500pccupswrapper-1.0.0-5.redhat.i386.rpm" rpm_unpack "${DISTDIR}/${A}" || die "Error unpacking ${CUPSD}." } src_install() { has_multilib_profile && ABI=x86 INSTDIR="/opt/Brother" dobin usr/local/Brother/PTouch/pt9500pc/cupswrapper/brcupsconfpt1 dodir /usr/lib/cups/filter dodir "${INSTDIR}/PTouch/pt9500pc/cupswrapper" sed -ne '/ENDOFPPDFILE/,/ENDOFPPDFILE/{/ENDOFPPDFILE/!p}' usr/local/Brother/PTouch/pt9500pc/cupswrapper/cupswrapperpt9500pc > "${D}${INSTDIR}/PTouch/pt9500pc/cupswrapper/brpt9500pc.ppd" #Extracting PPD file from cupswrapper bash script sed -ne '/!ENDOFWFILTER!/,/!ENDOFWFILTER!/{/!ENDOFWFILTER!/!p}' usr/local/Brother/PTouch/pt9500pc/cupswrapper/cupswrapperpt9500pc > "${D}${INSTDIR}/PTouch/pt9500pc/cupswrapper/brlpdwrapperpt9500pc" #Extracting CUPS Filter from cupswrapper bash script chmod 755 "${D}${INSTDIR}/PTouch/pt9500pc/cupswrapper/brlpdwrapperpt9500pc" sed -i 's/\\//g' "${D}${INSTDIR}/PTouch/pt9500pc/cupswrapper/brlpdwrapperpt9500pc" # Remove all \ Characters from the file which break it mv usr/local/Brother/PTouch/pt9500pc/cupswrapper/{brcupsconfpt1,cupswrapperpt9500pc} "${D}${INSTDIR}/PTouch/pt9500pc/cupswrapper" dosym /opt/Brother/PTouch/pt9500pc/cupswrapper/brpt9500pc.ppd /usr/share/cups/model/ dosym /opt/Brother/PTouch/pt9500pc/cupswrapper/brlpdwrapperpt9500pc /usr/libexec/cups/filter/ dosym /opt/Brother/PTouch/pt9500pc/cupswrapper/brlpdwrapperpt9500pc /usr/lib/cups/filter/ } pkg_postinst() { einfo "It is recommended to use the PT-9500PC Printer" einfo "with the Brother delivered OpenOffice Templates" einfo "The Brother Linux Page is at:" einfo "http://solutions.brother.com/linux/en_us/index.html" einfo "The Templates can be downloaded from:" einfo "http://solutions.brother.com/linux/en_us/download_esp.html#PT-9500" einfo "Reading the Brother Manual is recommened (eg. adding Media Sizes:" einfo "http://www.brother.com/pub/ptouch-su/linux/LinuxDriverManual_PT9500PC_ENG.pdf" }