summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorCebtenzzre2018-11-29 21:51:27 -0500
committerCebtenzzre2018-11-29 21:51:27 -0500
commit01a57cdab131a2609b1a2d317583ac52b4d22fc5 (patch)
treec92448d5510e0851769b2b67496073c884ce037a /PKGBUILD
parent2d6d413af1c08c34eaa878b943221beb92113c38 (diff)
downloadaur-01a57cdab131a2609b1a2d317583ac52b4d22fc5.tar.gz
Complete rewrite
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD63
1 files changed, 35 insertions, 28 deletions
diff --git a/PKGBUILD b/PKGBUILD
index db2cfb6db8d0..9e32cec365df 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,35 +1,42 @@
# Submitter: voidptr <aur at voidptr dot net>
# Contributor: Andrew Hacking <ahacking at gmail>
# Maintainer: Tom Wasiluk <tomasz at wasil dot uk>
+# Co-maintainer: Cebtenzzre <cebtenzzre (at) gmail (dot) com>
-model="9340cdw"
-pkgname="brother-mfc-$model"
-pkgver="1.1.4"
-pkgrel=1
-_cupswrapper_verstr="1.1.4-0"
-_lpr_verstr="1.1.2-1"
-pkgdesc="LPR and CUPS driver for the Brother MFC-9340CDW"
-url="http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/index.html"
-arch=('i686' 'x86_64')
-license=('unknown')
-install="brother-mfc-${model}.install"
-depends=('tcsh' 'deb2targz' 'perl' 'a2ps' 'lib32-libcups')
+_model='9340cdw'
+pkgname=brother-mfc-${_model}
+pkgver=1.1.2_1
+pkgrel=2
+_cupswrapper_ver='1.1.4-0'
+pkgdesc='LPR and CUPS driver for the Brother MFC-9340CDW'
+url='http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/index.html'
+arch=(i686 x86_64)
+license=('custom:Brother commercial license' GPL2)
+install=brother-mfc-${_model}.install
+depends=(cups ghostscript a2ps)
+depends_x86_64=(lib32-glibc)
-source=("http://download.brother.com/welcome/dlf007027/mfc${model}lpr-${_lpr_verstr}.i386.deb"
- "http://download.brother.com/welcome/dlf007029/mfc${model}cupswrapper-${_cupswrapper_verstr}.i386.deb")
-sha256sums=('0591020f391dd904680e2a3beb9664e404cac144d5848f7091c9246b44bc8dfe'
- '7ba2bd88eec76e7f278a220e1a8e32a3f4404280723c299bcdc4613b2bbb9c36')
+source=("http://www.brother.com/pub/bsc/linux/dlf/mfc${_model}lpr-${pkgver//_/-}.i386.rpm"
+ "https://download.brother.com/welcome/dlf007028/mfc9340cdwcupswrapper-${_cupswrapper_ver}.i386.rpm"
+ 'lpr-license.txt')
+sha256sums=('f0ef7debe2ce49624c9fed63f5338267195430577afe1e97bdfb14bb35a325b1'
+ '4290e37fa83cf2ad31e83fdf1a44e22fd7df4149fbda994bc930f201c1457e05'
+ '9d85a8aafdaac8fac80e04234ad2acf5642bbf0b91ee582d2a89519a55f6dd67')
+
+prepare() {
+ install -d usr/share/cups/model usr/lib/cups/filter
+ wrapper=opt/brother/Printers/mfc${_model}/cupswrapper/cupswrappermfc${_model}
+ perl -i -0777spe 's/^sleep(?s:.)*//gm;s#/(usr|opt)#$srcdir/$1#g;s#/model/Brother#/model#g;s/^lpadmin//gm' -- -srcdir="$srcdir" "$wrapper"
+ ./"$wrapper"
+ rm "$wrapper"
+ perl -i -spe 's/$srcdir//' -- -srcdir="$srcdir" usr/lib/cups/filter/*lpdwrapper*
+
+ rm opt/brother/Printers/mfc${_model}/cupswrapper/brother_mfc9340cdw_printer_en.ppd
+ # /etc/printcap is managed by cups
+ rm opt/brother/Printers/mfc9340cdw/inf/setupPrintcap*
+}
package() {
- deb2targz *.deb >/dev/null || return 1
- rm -f *.deb || return 1
- cd $srcdir || return 1
- [ -d "mfc${model}" ] || (mkdir mfc${model} || return 1)
- for i in *.tar.gz;do tar xfz $i -C mfc${model};done || return 1
- cd mfc${model} || return 1
- cd opt/brother/Printers/mfc${model} || return 1
- perl -i -pe 's#/etc/init.d#/etc/rc.d#g' ./cupswrapper/cupswrappermfc${model} || return 1
- perl -i -pe 's#printcap\.local#printcap#g' $srcdir/mfc${model}/opt/brother/Printers/mfc${model}/inf/setupPrintcapij || return 1
- cp -rf $srcdir/mfc${model}/usr/ $pkgdir/ || return 1
- cp -rf $srcdir/mfc${model}/opt/ $pkgdir/ || return 1
-} \ No newline at end of file
+ cp -R usr/ opt/ "${pkgdir}/"
+ install -Dm644 lpr-license.txt "${pkgdir}/usr/share/licenses/${pkgname}/lpr-license.txt"
+}