From 4a63415235c9d5b01e3c421c690951338eb9f84b Mon Sep 17 00:00:00 2001
From: Monkey 7 <monkeyseven@fblog.ch>
Date: Wed, 10 Jul 2019 07:02:55 +0200
Subject: [PATCH 1/3] New package: brother-hl5340d-lpr-2.0.3

---
 srcpkgs/brother-hl5340d-lpr/template | 40 ++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 srcpkgs/brother-hl5340d-lpr/template

diff --git a/srcpkgs/brother-hl5340d-lpr/template b/srcpkgs/brother-hl5340d-lpr/template
new file mode 100644
index 00000000000..f8287b2238b
--- /dev/null
+++ b/srcpkgs/brother-hl5340d-lpr/template
@@ -0,0 +1,40 @@
+# Template file for 'brother-hl5340d-lpr'
+pkgname=brother-hl5340d-lpr
+_br_version=2.0.3
+_br_revision=1
+version=${_br_version}
+revision=1
+archs="i686 x86_64"
+create_wrksrc=yes
+make_dirs="/var/spool/lpd 0775 root lp"
+depends="a2ps ghostscript"
+short_desc="LPR driver for the brother HL5340D printer"
+maintainer="Monkey 7<monkeyseven@fblog.ch>"
+license="brother-eula GPL-2"
+homepage="http://support.brother.com"
+distfiles="http://www.brother.com/pub/bsc/linux/dlf/hl5340dlpr-${version}-${_br_revision}.i386.deb"
+checksum="32f2d3e0297bbbcc4aab70f911fab3ba3cc6a0eb98c3569dfcb22beef6e32c19"
+nopie=yes
+patch_args="-Np1"
+
+
+if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+	depends+=" glibc-32bit"
+fi
+
+do_extract() {
+	ar x ${XBPS_SRCDISTDIR}/${pkgname}-${version}/hl5340dlpr-${_br_version}-${_br_revision}.i386.deb
+	tar xzpvf data.tar.gz -C ${wrksrc}
+}
+
+do_install() {
+	mkdir -p ${DESTDIR}
+	cp -a ${wrksrc}/usr ${DESTDIR}/
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+	  mkdir -p ${DESTDIR}/usr/lib32/
+ 	  mv ${DESTDIR}/usr/lib/* ${DESTDIR}/usr/lib32/
+	fi
+	mv ${DESTDIR}/usr/local/Brother ${DESTDIR}/usr/lib/brother
+	rm -rf ${DESTDIR}/usr/local
+}
+

From f12f3bf9cbf1975651dc94fa9f759136920fb9d5 Mon Sep 17 00:00:00 2001
From: Monkey 7 <monkeyseven@fblog.ch>
Date: Thu, 11 Jul 2019 07:10:04 +0200
Subject: [PATCH 2/3] version, license and repository changed

---
 srcpkgs/brother-hl5340d-lpr/template | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/brother-hl5340d-lpr/template b/srcpkgs/brother-hl5340d-lpr/template
index f8287b2238b..9e0071d5a7e 100644
--- a/srcpkgs/brother-hl5340d-lpr/template
+++ b/srcpkgs/brother-hl5340d-lpr/template
@@ -1,8 +1,6 @@
 # Template file for 'brother-hl5340d-lpr'
 pkgname=brother-hl5340d-lpr
-_br_version=2.0.3
-_br_revision=1
-version=${_br_version}
+version=2.0.3
 revision=1
 archs="i686 x86_64"
 create_wrksrc=yes
@@ -10,9 +8,10 @@ make_dirs="/var/spool/lpd 0775 root lp"
 depends="a2ps ghostscript"
 short_desc="LPR driver for the brother HL5340D printer"
 maintainer="Monkey 7<monkeyseven@fblog.ch>"
-license="brother-eula GPL-2"
+license="proprietary"
+repository=nonfree
 homepage="http://support.brother.com"
-distfiles="http://www.brother.com/pub/bsc/linux/dlf/hl5340dlpr-${version}-${_br_revision}.i386.deb"
+distfiles="http://www.brother.com/pub/bsc/linux/dlf/hl5340dlpr-${version}-1.i386.deb"
 checksum="32f2d3e0297bbbcc4aab70f911fab3ba3cc6a0eb98c3569dfcb22beef6e32c19"
 nopie=yes
 patch_args="-Np1"
@@ -23,7 +22,7 @@ if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
 fi
 
 do_extract() {
-	ar x ${XBPS_SRCDISTDIR}/${pkgname}-${version}/hl5340dlpr-${_br_version}-${_br_revision}.i386.deb
+	ar x ${XBPS_SRCDISTDIR}/${pkgname}-${version}/hl5340dlpr-${version}-1.i386.deb
 	tar xzpvf data.tar.gz -C ${wrksrc}
 }
 

From 1bcfe0e486d58bd3f1376ab63495c7e795a6f572 Mon Sep 17 00:00:00 2001
From: Monkey 7 <monkeyseven@fblog.ch>
Date: Thu, 11 Jul 2019 07:11:27 +0200
Subject: [PATCH 3/3] version, license and repository changed

---
 srcpkgs/brother-hl5340d-lpr/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/brother-hl5340d-lpr/template b/srcpkgs/brother-hl5340d-lpr/template
index 9e0071d5a7e..42c232e688a 100644
--- a/srcpkgs/brother-hl5340d-lpr/template
+++ b/srcpkgs/brother-hl5340d-lpr/template
@@ -9,10 +9,10 @@ depends="a2ps ghostscript"
 short_desc="LPR driver for the brother HL5340D printer"
 maintainer="Monkey 7<monkeyseven@fblog.ch>"
 license="proprietary"
-repository=nonfree
 homepage="http://support.brother.com"
 distfiles="http://www.brother.com/pub/bsc/linux/dlf/hl5340dlpr-${version}-1.i386.deb"
 checksum="32f2d3e0297bbbcc4aab70f911fab3ba3cc6a0eb98c3569dfcb22beef6e32c19"
+repository=nonfree
 nopie=yes
 patch_args="-Np1"
 
