updated on Sun Jan 22 08:00:21 UTC 2012
[aur-mirror.git] / brother-hl2150n / PKGBUILD
blob49297c699f14f1ee23de0c23a7762fe462310091
1 # Contributor: Wael Nasreddine <wael.nasreddine@sabayonlinux.org>
3 pkgname=brother-hl2150n
4 pkgver=2.0.2
5 pkgrel=1
6 pkgdesc="Brother HL-2150n CUPS printer driver"
7 url="http://solutions.brother.com/linux/en_us/download_prn.html#HL-2150n"
8 license=('custom:Brother' 'GPL')
9 makedepends=('rpmextract')
10 install="${pkgname}.install"
11 arch=('i686' 'x86_64')
13 if [[ -z "$CARCH" ]]; then
14         echo ":: PKGBUILD could not detect your architecture. Some dependencies may be missing."
15 else
16         if [[ "$CARCH" == "x86_64" ]]; then
17                 depends=('lib32-glibc')
18         fi
21 source=(
22 ${pkgname}.patch
23 http://pub.brother.com/pub/com/bsc/linux/dlf/cupswrapperHL2150N-${pkgver}-1.i386.rpm
24 http://pub.brother.com/pub/com/bsc/linux/dlf/brhl2150nlpr-${pkgver}-1.i386.rpm
27 md5sums=('317e7833c15c3f8ca543b90ac6237494'
28          'e8be54c3226c61852957f19f6db2c279'
29          '26a354fad4423e2a90f1063de51ac563')
31 build()
33         cd "$srcdir" || return 1
34         for n in *.rpm; do
35                 rpmextract.sh "$n" || return 1
36         done 
38         cd "$srcdir/usr/" || return 1
39         patch -p1 < ../${pkgname}.patch
41         mkdir -p "$pkgdir/usr/share"
42         cp -R "$srcdir/usr/bin" "$pkgdir/usr"
43         cp -R "$srcdir/usr/lib" "$pkgdir/usr"
44         cp -R "$srcdir/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         cd "$srcdir" || return 1
50         DESTDIR=$pkgdir DRIVER_PREFIX=/usr/share/Brother \
51         "$srcdir/usr/local/Brother/cupswrapper/cupswrapperHL2150N-${pkgver}" -s
53         rm "$pkgdir/usr/share/Brother/cupswrapper/cupswrapperHL2150N-${pkgver}"
54         rm "$pkgdir/usr/share/Brother/inf/setupPrintcap"