updated on Thu Jan 12 08:01:00 UTC 2012
[aur-mirror.git] / brother-mfc5490cn-cupswrapper / PKGBUILD
blob07dcf6536590aa443358c6202b2ba36d9605e691
1 # Contributor: Adam Hani Schakaki (krzd) <krzd@krzd.net>
2 pkgname=brother-mfc5490cn-cupswrapper
3 _printer=mfc5490cn
4 pkgver=1.1.2_2
5 pkgrel=2
6 pkgdesc="LPR-to-CUPS wrapper for Brother MFC-5490CN 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-mfc5490cn-lpr>=1.1.2_2: 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-${pkgver/_/-}.i386.deb")
17 md5sums=('285c81c3e86fd1217f53cc908c0d8bcf')
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