1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Maintainer: webjdm <[email protected]>

pkgname=lexmarkz-cups
pkgver=1
pkgrel=10
pkgdesc="Lexmark Z35, Z55, Z65, Z600 and Z700 Printer Drivers for CUPS"
arch=('i686' 'x86_64')
url="http://www.lexmark.com/"
license=('custom')
if [ "$CARCH" = "x86_64" ]; then
	depends=('cups' 'lib32-krb5' 'lib32-libcups' 'lib32-gnutls' 'lib32-libstdc++5' 'lib32-sqlite3')
else
	depends=('cups') # 'libstdc++5' 'sqlite3'
fi
makedepends=('rpmextract')
conflicts=('z600' 'cjlz35le-cups' 'cups-lexmark-700')
install=lexmarkz-cups.install
source=(http://webjdm.free.fr/archlinux/${pkgname}/${pkgname}-RPM.tar.gz \
	'lexmark-eula.txt')
md5sums=('711821c160e81ddf58d33f204c12e0dc'
         '1cafb6e6ba400142ae23bfaff1009e3f')

build() {
  cd $srcdir/
  mkdir -p $pkgname
  mv -v *.rpm $pkgname
  cd $pkgname

  # To reduce the number of drivers replace *.rpm with
  # the explicit version/versions you need
  for i in *.rpm; do
       rpmextract.sh $i
  done
}

package() {
  cd $srcdir/${pkgname}
  
  mv usr/ $pkgdir

  cd $pkgdir
  # Finally: removing useless folders and files
  rm -Rf usr/local/z700cups
  rm -Rf usr/include
  rm -Rf usr/lib/cups/backend
  find . -name '*.la' -exec rm {} \;
  
  # Fix 32-Bit drivers for 64-Bit users
  if [ "$CARCH" = "x86_64" ]; then
	mkdir -p opt/lib32/usr/lib
	cp usr/lib/*.* opt/lib32/usr/lib
  fi
 
  # Install license
  install -D -m644 $srcdir/lexmark-eula.txt $pkgdir/usr/share/licenses/${pkgname}/LICENSE
}