updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / brother-mfc440cn-cupswrapper / PKGBUILD
blob645374af2040fad4d3a1b3234103f64ff9f2684e
1 # Maintainer: Enrico Carlesso <enrico (at) ecarlesso (dot) org>
2 pkgname=brother-mfc440cn-cupswrapper
3 _printer=mfc440cn
4 pkgver=1.0.1_1
5 pkgrel=1
6 pkgdesc="LPR-to-CUPS wrapper for Brother MFC-440CN multifunction network printer"
7 arch=('i686' 'x86_64')
8 url="http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/index.html"
9 license=('gpl')
10 optdepends=('cups: useless otherwise' 'brother-mfc440cn-lpr>=1.0.1_1: needed to print')
11 makedepends=('binutils')
12 provides=("$pkgname=${pkgver%_*}")
13 conflicts=("$pkgname")
14 replaces=("$pkgname")
15 install="$pkgname.install"
16 source=("http://www.brother.com/pub/bsc/linux/dlf/${_printer}cupswrapper-1.0.1-1.i386.deb")
17 md5sums=('7a2a9172d441dd19032d4c20209e7ccb')
19 build() {
20   cd $srcdir
21   # Extract the archive
22   ar x ${_printer}cupswrapper-${pkgver/_/-}.i386.deb || return 1
23   mkdir data
24   tar -xzvf data.tar.gz -C data || return 1
25   # Fix the directory structure. Moves /usr/local/Brother to /usr/share/brother and fix links
26   mkdir -p data/usr/share
27   mv data/usr/local/Brother data/usr/share/brother
28   rm -r data/usr/local
29   sed -i 's|/usr/local/Brother|/usr/share/brother|g' `grep -lr '/usr/local/Brother' data/` || return 1
30   sed -i 's|/etc/init.d|/etc/rc.d|' "data/usr/share/brother/Printer/${_printer}/cupswrapper/cupswrapper${_printer}" || return 1
31   # copy into place
32   cp -r data/usr $pkgdir || return 1