updated on Thu Jan 19 16:10:29 UTC 2012
[aur-mirror.git] / cups-usblp / PKGBUILD
blob44594ec1359944dc8882f29cf3ef062d27268ef7
1 # $Id: PKGBUILD 87481 2010-08-14 10:36:21Z andyrtr $
2 # Maintainer: Andreas Radke <andyrtr@archlinux.org>
4 pkgname=cups-usblp
5 pkgdesc="The CUPS Printing System - deamon package"
6 pkgver=1.5.0
7 pkgrel=1
8 arch=('i686' 'x86_64')
9 license=('GPL')
10 url="http://www.cups.org/"
11 makedepends=('libtiff>=3.9.2-2' 'libpng>=1.4.0'  'acl' 'openslp' 'pam' 'xdg-utils' 'krb5' 'gnutls>=2.8.3' 'poppler>=0.12.3'
12              'xinetd' 'gzip' 'autoconf' 'php' 'libusb-compat' 'dbus-core' 'avahi'  'hicolor-icon-theme')
13 source=(ftp://ftp.easysw.com/pub/cups/${pkgver}/cups-${pkgver}-source.tar.bz2
14         cups-avahi.patch
15         cups-no-export-ssllibs.patch
16         cups-no-gcrypt.patch
17         cups cups.logrotate cups.pam)
18 #options=('!emptydirs')
19 md5sums=('e54ed09ede2340fc3014913333520fe4'
20          'e0843e8d8c345792ac73a185260e69fe'
21          '9b8467a1e51d360096b70e2c3c081e6c'
22          '3733c23e77eb503bd94cc368e02830dc'
23          '9657daa21760bb0b5fa3d8b51d5e01a1'
24          'f861b18f4446c43918c8643dcbbd7f6d'
25          '96f82c38f3f540b53f3e5144900acf17')
26 provides=(cups=1.5.0)
28 build() {
29   cd ${srcdir}/cups-${pkgver}
30   # Avahi support in the dnssd backend. patch from Debian based on the Fedora work but brings it in a single file http://patch-tracker.debian.org/package/cups
31   patch -Np1 -i ${srcdir}/cups-avahi.patch
33   # Do not export SSL libs in cups-config
34   patch -Np1 -i "${srcdir}/cups-no-export-ssllibs.patch"
36   patch -Np1 -i "${srcdir}/cups-no-gcrypt.patch"
37   
38   # Rebuild configure script for --enable-avahi.
39   aclocal -I config-scripts
40   autoconf -I config-scripts
42   ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
43      --libdir=/usr/lib \
44      --with-logdir=/var/log/cups \
45      --with-docdir=/usr/share/cups/doc \
46      --with-cups-user=daemon \
47      --with-cups-group=lp \
48      --enable-pam=yes \
49      --disable-ldap \
50      --enable-raw-printing \
51      --enable-dbus --with-dbusdir=/etc/dbus-1 \
52      --enable-ssl=yes --enable-gnutls \
53      --enable-threads \
54      --enable-avahi\
55      --with-php=/usr/bin/php-cgi \
56      --with-pdftops=pdftops \
57      --with-optim="$CFLAGS" \
58      --disable-libusb
59   make
62 check() {
63   cd "$srcdir/cups-$pkgver"
64   #httpAddrGetList(workstation64): FAIL
65   #1 TESTS FAILED!
66   #make[1]: *** [testhttp] Error 1
67   make -k check || /bin/true
70 package() {
71 pkgdesc="The CUPS Printing System - daemon package"
72 install=cups.install
73 backup=(etc/cups/cupsd.conf
74         etc/cups/mime.convs
75         etc/cups/mime.types
76         etc/cups/snmp.conf
77         etc/cups/printers.conf
78         etc/cups/classes.conf
79         etc/cups/client.conf
80         etc/cups/subscriptions.conf
81         etc/dbus-1/system.d/cups.conf
82         etc/logrotate.d/cups
83         etc/pam.d/cups
84         etc/xinetd.d/cups-lpd)
85 depends=('acl' 'openslp' 'pam' "libcups>=${pkgver}" 'poppler>=0.12.3' 'libusb-compat' 'dbus-core' 'hicolor-icon-theme')
86 optdepends=('php: for included phpcups.so module'
87             'ghostscript: for non-PostScript printers to print with CUPS to convert PostScript to raster images'
88             'foomatic-db: drivers use Ghostscript to convert PostScript to a printable form directly'
89             'foomatic-db-engine: drivers use Ghostscript to convert PostScript to a printable form directly'
90             'foomatic-db-nonfree: drivers use Ghostscript to convert PostScript to a printable form directly'
91             'xdg-utils: xdg .desktop file support')
93   cd ${srcdir}/cups-${pkgver}
94   make BUILDROOT=${pkgdir} install-data install-exec
96   # this one we ship in the libcups pkg
97   rm -f ${pkgdir}/usr/bin/cups-config
99   # kill the sysv stuff
100   rm -rf ${pkgdir}/etc/rc*.d
101   rm -rf ${pkgdir}/etc/init.d
102   install -D -m755 ../cups ${pkgdir}/etc/rc.d/cupsd
103   install -D -m644 ../cups.logrotate ${pkgdir}/etc/logrotate.d/cups
104   install -D -m644 ../cups.pam ${pkgdir}/etc/pam.d/cups
105   
106   # fix perms on /var/spool and /etc
107   chmod 755 ${pkgdir}/var/spool
108   chmod 755 ${pkgdir}/etc
109   
110   # serial backend needs to run as root (http://bugs.archlinux.org/task/20396)
111   chmod 700 ${pkgdir}/usr/lib/cups/backend/serial
113   # install ssl directory where to store the certs, solves some samba issues
114   install -dm700 -g lp ${pkgdir}/etc/cups/ssl
115   # remove directory from package, we create it in cups rc.d file
116   rm -rf ${pkgdir}/var/run
117 #  install -dm511 -g lp ${pkgdir}/var/run/cups/certs 
119   # install some more configuration files that will get filled by cupsd
120   touch ${pkgdir}/etc/cups/printers.conf
121   touch ${pkgdir}/etc/cups/classes.conf
122   touch ${pkgdir}/etc/cups/client.conf
123   echo "# see 'man client.conf'" >> ${pkgdir}/etc/cups/client.conf
124   echo "ServerName /var/run/cups/cups.sock #  alternative: ServerName hostname-or-ip-address[:port] of a remote server" >> ${pkgdir}/etc/cups/client.conf
125   touch ${pkgdir}/etc/cups/subscriptions.conf 
126   chgrp lp ${pkgdir}/etc/cups/{printers.conf,classes.conf,client.conf,subscriptions.conf}
127   
128   # fix .desktop file
129   sed -i 's|^Exec=htmlview http://localhost:631/|Exec=xdg-open http://localhost:631/|g' ${pkgdir}/usr/share/applications/cups.desktop
130   
131   # compress some driver files, adopted from Fedora
132   find ${pkgdir}/usr/share/cups/model -name "*.ppd" | xargs gzip -n9f