summaryrefslogtreecommitdiff
path: root/net-print
diff options
context:
space:
mode:
authorBlackNoxis <steven.darklight@gmail.com>2015-01-14 02:47:35 +0200
committerBlackNoxis <steven.darklight@gmail.com>2015-01-14 02:47:35 +0200
commitb67738b5b05ebbd70d12f04f1cfca92ab88ca14c (patch)
tree5904db19e6383060800bdb3db8618c904ad1d751 /net-print
parent32d8f640825082601f1a6181dea41601d2b2d922 (diff)
Added brother hl5340d drivers
Diffstat (limited to 'net-print')
-rw-r--r--net-print/brother-hl5340d-drivers/Manifest3
-rw-r--r--net-print/brother-hl5340d-drivers/brother-hl5340d-drivers-2.0.4-r1.ebuild73
-rw-r--r--net-print/brother-hl5340d-drivers/files/cupswrapper.patch255
3 files changed, 331 insertions, 0 deletions
diff --git a/net-print/brother-hl5340d-drivers/Manifest b/net-print/brother-hl5340d-drivers/Manifest
new file mode 100644
index 00000000..1ea18423
--- /dev/null
+++ b/net-print/brother-hl5340d-drivers/Manifest
@@ -0,0 +1,3 @@
+DIST BR5340_2_GPL.ppd.gz 5677 SHA256 e8b8bb0688c2a181c9ebbb597ca7f467513262420bbf9a3c9bc1e2cf6e0bf9ee SHA512 2cbbbd18cb298eb3ac67fe2cfdb637ecc48996520848142caee08b810edbb07a738dfee87e734f98c6310e2f6cf7e2bc782cb685f9eef43d163169002ba93fec WHIRLPOOL fce09d1281255c68a85facf76dd8a1dafb2a839df90a8d9a901fe5e4a54d3c41ad7daa8572a8ebcbdd4c46f7358f5ac2fb7495d74af80d2d9c45675473fef7ad
+DIST cupswrapperHL5340D-2.0.4-1.i386.rpm 14738 SHA256 d84fa72cfe3e41dfedae9bc47692d943487efbb512e5d78eaa73fe1a0a24064d SHA512 3807d98d992f5e82ebeff4ec7aadecc693fda1269515af517ba0d1006164266e4f64599701e1aaab66febea468a5b219cec5bca7f8773101d541aae9d1b89f1b WHIRLPOOL 04119de2254337e1158b8c217eeee2b980f0fb9f2769befeaf79a7626cd16944d5ba24a8f3f3b96ac168dafa1988fc19878cc1e8ae16c6b5e8720dd327c2af36
+DIST hl5340dlpr-2.0.3-1.i386.rpm 43247 SHA256 22d9bf3bb4dca33eb07d7fe6f60f51a85ebe5f288a73adf926434e0559df3abd SHA512 883e2e83a7a0843f22630e5a7af4b71e6a651f3ec8bc076d6856c4101bf4e0ca590592e5e5ca18eb50bcc4872eee7d0aade3504393d123a7ca9763cdb464cbff WHIRLPOOL d7d4e8dadb51dfffd04ad4149fe1db2bcedaf9c6cf40940fce8ae1a5d6523d77b2758ce80b4908067bca22c6ea1e12134b46690cfff98e64c71fce02cd428ec9
diff --git a/net-print/brother-hl5340d-drivers/brother-hl5340d-drivers-2.0.4-r1.ebuild b/net-print/brother-hl5340d-drivers/brother-hl5340d-drivers-2.0.4-r1.ebuild
new file mode 100644
index 00000000..4be6dccb
--- /dev/null
+++ b/net-print/brother-hl5340d-drivers/brother-hl5340d-drivers-2.0.4-r1.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2013 Sabayon
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+inherit eutils multilib rpm
+
+WRAPPER_VER="2.0.4-1"
+LPR_VER="2.0.3-1"
+
+DESCRIPTION="CUPS filters and drivers for Brother HL-5340D"
+HOMEPAGE="http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/download_prn.html"
+SRC_URI="http://www.brother.com/pub/bsc/linux/dlf/hl5340dlpr-${LPR_VER}.i386.rpm
+ http://www.brother.com/pub/bsc/linux/dlf/cupswrapperHL5340D-${WRAPPER_VER}.i386.rpm
+ http://www.brother.com/pub/bsc/linux/dlf/BR5340_2_GPL.ppd.gz"
+LICENSE="as-is"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND="${DEPEND}"
+RDEPEND="amd64? ( app-emulation/emul-linux-x86-baselibs )
+ app-text/ghostscript-gpl
+ net-print/cups"
+
+S="${WORKDIR}"
+RESTRICT="strip"
+
+src_prepare() {
+ default
+ epatch "${FILESDIR}/cupswrapper.patch"
+}
+
+src_install() {
+ # Thanks to the Arch folks!
+ mkdir -p usr/share || die
+ mv "${S}/usr/local/Brother" "${S}/usr/share/brother" || die
+
+ # Fix paths, move away from /usr/local
+ sed -i "s;/usr/local/Brother;/usr/share/brother;g" $(grep -rl "/usr/local/Brother" .) || die
+
+ # Create and install the file 'brPrintList'. This file must exist and contain the name
+ # of the printer in order to make CUPS settings work. Else, settings done in CUPS are
+ # not reflected in the file /usr/share/brother/inf/brHL5340Drc and thus are not considered
+ # by the LPR driver that's doing the actual printing.
+ mkdir -p "${S}/usr/share/brother/inf" || die
+ echo "HL5340D" > "${S}/usr/share/brother/inf/brPrintList" || die
+
+ # Generate the cups filter
+ cd "${S}" || die
+ ./usr/share/brother/cupswrapper/cupswrapperHL5340D-2.0.4 || die
+ insinto /usr/share/cups/model
+ newins "${WORKDIR}/BR5340_2_GPL.ppd" HL5340D.ppd
+ exeinto /usr/libexec/cups/filter
+ doexe brlpdwrapperHL5340D || die
+
+ # move /usr/local crap to /usr/share
+ dodir /usr/share
+ cd "${S}/usr/share" || die
+ insinto /usr/share
+ # preserve permissions
+ cp -rp brother "${D}/usr/share/" || die
+ fperms 0755 /usr/share/brother/inf/brHL5340Drc
+
+ dodir /usr/$(get_libdir)
+ exeinto /usr/$(get_libdir)
+ doexe "${S}"/usr/lib/*
+
+ dodir /usr/bin
+ exeinto /usr/bin
+ doexe "${S}"/usr/bin/*
+}
diff --git a/net-print/brother-hl5340d-drivers/files/cupswrapper.patch b/net-print/brother-hl5340d-drivers/files/cupswrapper.patch
new file mode 100644
index 00000000..b0a99663
--- /dev/null
+++ b/net-print/brother-hl5340d-drivers/files/cupswrapper.patch
@@ -0,0 +1,255 @@
+--- a/usr/local/Brother/cupswrapper/cupswrapperHL5340D-2.0.4
++++ b/usr/local/Brother/cupswrapper/cupswrapperHL5340D-2.0.4
+@@ -17,53 +17,56 @@
+ # this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ # Place, Suite 330, Boston, MA 02111-1307 USA
+ #
++#
++# if [ "$1" = '-e' ]; then
++# lpadmin -x HL5340D
++# rm -f /usr/share/cups/model/HL5340D.ppd
++# rm -f /usr/lib/cups/filter/brlpdwrapperHL5340D
++# rm -f /usr/lib64/cups/filter/brlpdwrapperHL5340D
++# rm -f /usr/local/Brother/cupswrapper/brcupsconfig3
++# if [ -f /usr/share/ppd/HL5340D.ppd ];then
++# rm -f /usr/share/ppd/HL5340D.ppd
++# fi
++# if [ -e /etc/init.d/cups ]; then
++# /etc/init.d/cups restart
++# fi
++# if [ -e /etc/init.d/cupsys ]; then
++# /etc/init.d/cupsys restart
++# fi
++# exit 0
++# fi
++# if [ "$1" = "-r" ]; then
++# lpadmin -x HL5340D
++# if [ -e /etc/init.d/cups ]; then
++# /etc/init.d/cups restart
++# fi
++# if [ -e /etc/init.d/cupsys ]; then
++# /etc/init.d/cupsys restart
++# fi
++# exit 0
++# fi
++# if [ "$1" = "help" ] || [ "$1" = "-h" ]; then
++# echo 'option -h : help'
++# echo ' -i : install'
++# echo ' -e : uninstall'
++# echo ' -r : remove printer'
++# exit 0
++# fi
++# mkdir -p /usr/lib/cups/filter
++#
++# if [ -e "/usr/local/Brother/lpd/filterHL5340D" ]; then
++# :
++# else
++# echo "ERROR : Brother LPD filter is not installed."
++# fi
++# rm -f /usr/share/cups/model/HL5340D.ppd
++# ppd_file_name=/usr/share/cups/model/HL5340D.ppd
++# if [ ! -e /usr/share/cups/model ]; then
++# ppd_file_name=/usr/share/ppd/HL5340D.ppd
++# fi
+
+-if [ "$1" = '-e' ]; then
+- lpadmin -x HL5340D
+- rm -f /usr/share/cups/model/HL5340D.ppd
+- rm -f /usr/lib/cups/filter/brlpdwrapperHL5340D
+- rm -f /usr/lib64/cups/filter/brlpdwrapperHL5340D
+- rm -f /usr/local/Brother/cupswrapper/brcupsconfig3
+- if [ -f /usr/share/ppd/HL5340D.ppd ];then
+- rm -f /usr/share/ppd/HL5340D.ppd
+- fi
+- if [ -e /etc/init.d/cups ]; then
+- /etc/init.d/cups restart
+- fi
+- if [ -e /etc/init.d/cupsys ]; then
+- /etc/init.d/cupsys restart
+- fi
+- exit 0
+-fi
+-if [ "$1" = "-r" ]; then
+- lpadmin -x HL5340D
+- if [ -e /etc/init.d/cups ]; then
+- /etc/init.d/cups restart
+- fi
+- if [ -e /etc/init.d/cupsys ]; then
+- /etc/init.d/cupsys restart
+- fi
+- exit 0
+-fi
+-if [ "$1" = "help" ] || [ "$1" = "-h" ]; then
+- echo 'option -h : help'
+- echo ' -i : install'
+- echo ' -e : uninstall'
+- echo ' -r : remove printer'
+- exit 0
+-fi
+-mkdir -p /usr/lib/cups/filter
+-
+-if [ -e "/usr/local/Brother/lpd/filterHL5340D" ]; then
+- :
+-else
+- echo "ERROR : Brother LPD filter is not installed."
+-fi
+-rm -f /usr/share/cups/model/HL5340D.ppd
+-ppd_file_name=/usr/share/cups/model/HL5340D.ppd
+-if [ ! -e /usr/share/cups/model ]; then
+- ppd_file_name=/usr/share/ppd/HL5340D.ppd
+-fi
++# Write PPD file into CWD
++ppd_file_name=HL5340D.ppd
+
+ cat <<ENDOFPPDFILE >$ppd_file_name
+ *PPD-Adobe: "4.3"
+@@ -370,23 +373,25 @@
+ *End
+
+ ENDOFPPDFILE
++#
++# chmod 755 $ppd_file_name
++# if [ -e '/usr/share/ppd' ];then
++# if [ -e '/usr/share/cups/model' ];then
++# cp $ppd_file_name /usr/share/ppd
++# fi
++# fi
++#
++# brotherlpdwrapper=/usr/lib/cups/filter/brlpdwrapperHL5340D
++# brotherlpdwrapper64=/usr/lib64/cups/filter/brlpdwrapperHL5340D
++# rm -f $brotherlpdwrapper
++# if [ ! -e /usr/lib/cups/filter ];then
++# if [ -e /usr/lib64/cups/filter ];then
++# brotherlpdwrapper=/usr/lib64/cups/filter/brlpdwrapperHL5340D
++# fi
++# fi
+
+-chmod 755 $ppd_file_name
+-if [ -e '/usr/share/ppd' ];then
+- if [ -e '/usr/share/cups/model' ];then
+- cp $ppd_file_name /usr/share/ppd
+- fi
+-fi
+-
+-brotherlpdwrapper=/usr/lib/cups/filter/brlpdwrapperHL5340D
+-brotherlpdwrapper64=/usr/lib64/cups/filter/brlpdwrapperHL5340D
+-rm -f $brotherlpdwrapper
+-if [ ! -e /usr/lib/cups/filter ];then
+- if [ -e /usr/lib64/cups/filter ];then
+- brotherlpdwrapper=/usr/lib64/cups/filter/brlpdwrapperHL5340D
+- fi
+-fi
+-
++# Write brlpdwrapper into CWD
++brotherlpdwrapper=brlpdwrapperHL5340D
+
+ cat <<!ENDOFWFILTER! >$brotherlpdwrapper
+ #! /bin/sh
+@@ -517,25 +522,25 @@
+ fi
+
+
+-if [ -e "/usr/local/Brother/lpd/filter\$PRINTER" ]; then
++if [ -e "/usr/share/brother/lpd/filter\$PRINTER" ]; then
+ :
+ else
+- echo "ERROR: /usr/local/Brother/lpd/filter\$PRINTER does not exist" >>\$LOGFILE
++ echo "ERROR: /usr/share/brother/lpd/filter\$PRINTER does not exist" >>\$LOGFILE
+ errorcode=30
+ exit $errorcode
+ fi
+
+-if [ -e "/usr/local/Brother/cupswrapper/brcupsconfig3" ]; then
++if [ -e "/usr/share/brother/cupswrapper/brcupsconfig3" ]; then
+ if [ \$DEBUG = 0 ]; then
+- /usr/local/Brother/cupswrapper/brcupsconfig3 \$PRINTER \$PPD 0 "\$options" >> /dev/null
++ /usr/share/brother/cupswrapper/brcupsconfig3 \$PRINTER \$PPD 0 "\$options" >> /dev/null
+ else
+- /usr/local/Brother/cupswrapper/brcupsconfig3 \$PRINTER \$PPD \$LOGCLEVEL "\$options" >>\$LOGFILE
++ /usr/share/brother/cupswrapper/brcupsconfig3 \$PRINTER \$PPD \$LOGCLEVEL "\$options" >>\$LOGFILE
+ fi
+ fi
+
+
+ if [ \$DEBUG -le 2 ]; then
+- cat \$INPUT_TEMP_PS | /usr/local/Brother/lpd/filter\$PRINTER
++ cat \$INPUT_TEMP_PS | /usr/share/brother/lpd/filter\$PRINTER
+ fi
+
+ if [ \$DEBUG -ge 2 ]; then
+@@ -551,39 +556,39 @@
+
+ !ENDOFWFILTER!
+
+-
+-chmod 755 $brotherlpdwrapper
+-if [ -e /usr/lib/cups/filter ]; then
+- if [ -e /usr/lib64/cups/filter ]; then
+- cp $brotherlpdwrapper $brotherlpdwrapper64
+- fi
+-fi
+-
+-chmod a+w /usr/local/Brother/inf/brHL5340Drc
+-chmod a+w /usr/local/Brother/inf
+-if [ -e /etc/init.d/lpd ]; then
+- /etc/init.d/lpd stop
+-fi
+-if [ -e /etc/init.d/lprng ]; then
+- /etc/init.d/lprng stop
+-fi
+- if [ -e /etc/init.d/cups ]; then
+- /etc/init.d/cups restart
+- fi
+- if [ -e /etc/init.d/cupsys ]; then
+- /etc/init.d/cupsys restart
+- fi
+-sleep 2s
+-port2=`lpinfo -v | grep -i 'usb://Brother/HL5340D' | head -1`
+-if [ "$port2" = '' ];then
+- port2=`lpinfo -v | grep -i 'usb://Brother/' | head -1`
+- if [ "$port2" = '' ];then
+- port2=`lpinfo -v | grep 'usb://' | head -1`
+- fi
+-fi
+-port=`echo $port2| sed s/direct//g`
+-if [ "$port" = '' ];then
+- port=usb:/dev/usb/lp0
+-fi
+-lpadmin -p HL5340D -E -v $port -P $ppd_file_name
+- exit 0
++#
++# chmod 755 $brotherlpdwrapper
++# if [ -e /usr/lib/cups/filter ]; then
++# if [ -e /usr/lib64/cups/filter ]; then
++# cp $brotherlpdwrapper $brotherlpdwrapper64
++# fi
++# fi
++#
++# chmod a+w /usr/share/brother/inf/brHL5340Drc
++# chmod a+w /usr/share/brother/inf
++# if [ -e /etc/init.d/lpd ]; then
++# /etc/init.d/lpd stop
++# fi
++# if [ -e /etc/init.d/lprng ]; then
++# /etc/init.d/lprng stop
++# fi
++# if [ -e /etc/init.d/cups ]; then
++# /etc/init.d/cups restart
++# fi
++# if [ -e /etc/init.d/cupsys ]; then
++# /etc/init.d/cupsys restart
++# fi
++# sleep 2s
++# port2=`lpinfo -v | grep -i 'usb://Brother/HL5340D' | head -1`
++# if [ "$port2" = '' ];then
++# port2=`lpinfo -v | grep -i 'usb://Brother/' | head -1`
++# if [ "$port2" = '' ];then
++# port2=`lpinfo -v | grep 'usb://' | head -1`
++# fi
++# fi
++# port=`echo $port2| sed s/direct//g`
++# if [ "$port" = '' ];then
++# port=usb:/dev/usb/lp0
++# fi
++# lpadmin -p HL5340D -E -v $port -P $ppd_file_name
++# exit 0