updated on Sun Jan 22 16:00:49 UTC 2012
[aur-mirror.git] / brother-hl2140 / PKGBUILD
blob13b617e01649874d35481d18052c05583857b1b2
1 #Maintainer: David Campbell <davekong@archlinux.us>
2 #Contributor: Loui Chang <louipc dot ist at noSPAM gmail company>
3 #Contributor: Jaroslaw Rosiek <jaroslaw.rosiek@interia.pl>
5 pkgname=brother-hl2140
6 pkgver=2.0.2
7 pkgrel=7
8 pkgdesc="Brother HL-2140 CUPS printer driver"
9 url="http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/download_prn.html#HL-2140"
10 license=('custom:Brother' 'GPL')
11 depends=('a2ps' 'cups')
12 makedepends=('libarchive')
13 install="brother-hl2140.install"
14 arch=('i686' 'x86_64')
16 if [[ -z "$CARCH" ]]; then
17         echo ":: PKGBUILD could not detect your architecture. Some dependencies may be missing."
18 else
19         if [[ "$CARCH" == "x86_64" ]]; then
20                 depends+=('lib32-glibc')
21         fi
24 source=(0001-brother-hl2140.patch
25         Brother.license
26         http://www.brother.com/pub/bsc/linux/dlf/cupswrapperHL2140-2.0.2-1.i386.rpm
27         http://www.brother.com/pub/bsc/linux/dlf/brhl2140lpr-2.0.2-1.i386.rpm)
28 md5sums=('79056da6a35147e6714937d73d736856'
29          '58796468c65d77c835e5959970b91f36'
30          '931035c9b7a8e7ee667efefba4bba168'
31          '0c4bbdc943c987c101266c832d6c8b7a')
33 build() {
34         cd "$srcdir"
35         for n in *.rpm; do
36                 bsdtar xf "$n"
37         done
39         patch -p1 < 0001-brother-hl2140.patch
41         install -d "$pkgdir/usr/share"
42         cp -R usr/bin "$pkgdir/usr"
43         cp -R usr/lib "$pkgdir/usr"
44         cp -R usr/local/Brother "$pkgdir/usr/share/Brother"
46         echo Fixing paths...
47         find $pkgdir -type f -exec sed -i s#/usr/local/Brother#/usr/share/Brother#g {} \;
49         # Install ppd.
50         DESTDIR=$pkgdir DRIVER_PREFIX=/usr/share/Brother \
51         'usr/local/Brother/cupswrapper/cupswrapperHL2140-2.0.2' -s
53         rm "$pkgdir/usr/share/Brother/cupswrapper/cupswrapperHL2140-2.0.2"
54         rm "$pkgdir/usr/share/Brother/inf/setupPrintcap"
55         # Unset world writable bit.
56         chmod 755 "$pkgdir/usr/share/Brother/inf"
57         chmod 644 "$pkgdir/usr/share/Brother/inf/brHL2140rc"
58         install -Dm644 Brother.license $pkgdir/usr/share/licenses/$pkgname/LICENSE