updated on Sun Jan 22 16:00:49 UTC 2012
[aur-mirror.git] / brother-mfc7440n / PKGBUILD
blob32adbfb8a4bc6c2740dc4d06593285a4893ed1ff
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-mfc7440n
6 pkgver=2.0.2
7 _pkgrel=1
8 pkgrel=1
9 pkgdesc="Brother MFC-7440N CUPS printer driver"
10 url="http://solutions.brother.com/linux/en_us/download_prn.html#MFC-7440N"
11 license=('custom:Brother' 'GPL')
12 makedepends=('rpmextract')
13 install="brother-mfc7440n.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-mfc7440n.patch
26 http://pub.brother.com/pub/com/bsc/linux/dlf/brmfc7440nlpr-$pkgver-$_pkgrel.i386.rpm
27 http://pub.brother.com/pub/com/bsc/linux/dlf/cupswrapperMFC7440N-$pkgver-$_pkgrel.i386.rpm
30 md5sums=('a89aa430959a19c13d2ee064d23e7bd0'
31          '573d1bc7d632541a6718b6ab933f7a8d'
32          '66c762b0d5d7a09dbd5a814b56892257')
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-mfc7440n.patch || return 1
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/cupswrapperMFC7440N-2.0.2" -s
56         rm "$pkgdir/usr/share/Brother/cupswrapper/cupswrapperMFC7440N-2.0.2"
57         rm "$pkgdir/usr/share/Brother/inf/setupPrintcap"