summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1eac929204d03999c6bdcb27a43047a10c97d18c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Maintainer: Frederik Schwan <frederik dot schwan at linux dot com>
# orphaned: Maintainer: Samuel Kesterson <arch@k-labs.com>

pkgname=brother-hl4150cdn
pkgver=1.1.1
pkgrel=5
pkgdesc="Brother HL-4150CDN CUPS printer driver"
url="http://support.brother.com/g/b/downloadlist.aspx?c=de&lang=de&prod=hl4150cdn_all&os=127&flang=English"
license=('custom:Brother' 'GPL')
depends=('a2ps' 'cups')
makedepends=('libarchive')
install="brother-hl4150cdn.install"
arch=('i686' 'x86_64')

if [[ "$CARCH" == "x86_64" ]]; then
	depends+=('lib32-glibc')
fi

source=(0001-brother-hl4150cdn.patch
        Brother.license
        http://download.brother.com/welcome/dlf005939/hl4150cdnlpr-${pkgver}-${pkgrel}.i386.rpm
        http://download.brother.com/welcome/dlf005941/hl4150cdncupswrapper-${pkgver}-${pkgrel}.i386.rpm)
md5sums=('7c21a135c11c7ac3e868e263a6807163'
         '58796468c65d77c835e5959970b91f36'
         '433c0a17c9d4ada74892072cc71bf042'
         '8f21d5054fb80bb148174a7a597b8fd0')


build() {
	cd $srcdir
	for n in *.rpm; do
		bsdtar xf "$n"
	done

	patch -p1 < 0001-brother-hl4150cdn.patch
}

package() {
	install -d "$pkgdir/usr/share"
	cp -R usr/bin "$pkgdir/usr";
	cp -R usr/local/Brother "$pkgdir/usr/share/Brother"

	echo Fixing paths...
	find $pkgdir -type f -exec sed -i s#/usr/local/Brother#/usr/share/Brother#g {} \;

	echo "Installing PPD."
	mkdir -p $pkgdir/usr/share/cups/model/

	PKGDIR=$pkgdir SRCDIR=$srcdir DESTDIR=$pkgdir DRIVER_PREFIX=/usr/share/Brother \
	usr/local/Brother/Printer/hl4150cdn/cupswrapper/cupswrapperhl4150cdn -s

	rm $pkgdir/usr/share/Brother/Printer/hl4150cdn/cupswrapper/cupswrapperhl4150cdn 
	rm $pkgdir/usr/share/Brother/Printer/hl4150cdn/inf/setupPrintcapij

	chown root:lp $pkgdir/usr/share/Brother/Printer/hl4150cdn/inf
	chmod 775 $pkgdir/usr/share/Brother/Printer/hl4150cdn/inf
	chown daemon:lp $pkgdir/usr/share/Brother/Printer/hl4150cdn/inf/brhl4150cdnrc
	chmod 664 $pkgdir/usr/share/Brother/Printer/hl4150cdn/inf/brhl4150cdnrc
	install -Dm644 Brother.license $pkgdir/usr/share/licenses/$pkgname/LICENSE
}