updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / brother-hl2170w / PKGBUILD
blob81d2ac4522d29fe2fe4d197efd749c645fc1e086
1 # Contributor: Liming Wang <lmwang+aur@gmail.com>
2 # Contributor: Loui Chang <louipc dot. ist at@ noSPAM gmail.com>
3 # Contributor: Jaroslaw Rosiek <jaroslaw.rosiek@interia.pl>
5 pkgname=brother-hl2170w
6 pkgver=2.0.2
7 _pkgrel=1
8 pkgrel=3
9 pkgdesc="Brother HL-2170W CUPS printer driver"
10 url="http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/download_prn.html#HL-2170W"
11 license=('custom:Brother' 'GPL')
12 makedepends=('rpmextract')
13 install="brother-hl2170w.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=(
25 brother-hl2170w.patch
26 http://www.brother.com/pub/bsc/linux/dlf/brhl2170wlpr-$pkgver-$_pkgrel.i386.rpm
27 http://www.brother.com/pub/bsc/linux/dlf/cupswrapperHL2170W-$pkgver-$_pkgrel.i386.rpm
30 md5sums=('eb0fb0c952d0594be471c66c4c12ff0e'
31          '2d7fe5114239b48dad38e08e24c9fca0'
32          '5d2b95b7c148eabf21866604e6e5cf3a')
34 build()
36         cd "$srcdir" || return 1
37         for n in *.rpm; do
38                 rpmextract.sh "$n" || return 1
39         done 
41         cd "$srcdir/usr/" || return 1
42         patch -p1 < ../brother-hl2170w.patch
44         mkdir -p "$pkgdir/usr/share"
45         cp -R "$srcdir/usr/bin" "$pkgdir/usr"
46         cp -R "$srcdir/usr/lib" "$pkgdir/usr"
47         cp -R "$srcdir/usr/local/Brother" "$pkgdir/usr/share/Brother"
49         echo Fixing paths...
50         find $pkgdir -type f -exec sed -i s#/usr/local/Brother#/usr/share/Brother#g {} \;
52         cd "$srcdir" || return 1
53         DESTDIR=$pkgdir DRIVER_PREFIX=/usr/share/Brother \
54         "$srcdir/usr/local/Brother/cupswrapper/cupswrapperHL2170W-2.0.2" -s
56         rm "$pkgdir/usr/share/Brother/cupswrapper/cupswrapperHL2170W-2.0.2"
57         rm "$pkgdir/usr/share/Brother/inf/setupPrintcap"