1 # $Id: PKGBUILD 87481 2010-08-14 10:36:21Z andyrtr $
2 # Maintainer: Andreas Radke <andyrtr@archlinux.org>
5 pkgdesc="The CUPS Printing System - deamon package"
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
15 cups-no-export-ssllibs.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')
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"
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 \
44 --with-logdir=/var/log/cups \
45 --with-docdir=/usr/share/cups/doc \
46 --with-cups-user=daemon \
47 --with-cups-group=lp \
50 --enable-raw-printing \
51 --enable-dbus --with-dbusdir=/etc/dbus-1 \
52 --enable-ssl=yes --enable-gnutls \
55 --with-php=/usr/bin/php-cgi \
56 --with-pdftops=pdftops \
57 --with-optim="$CFLAGS" \
63 cd "$srcdir/cups-$pkgver"
64 #httpAddrGetList(workstation64): FAIL
66 #make[1]: *** [testhttp] Error 1
67 make -k check || /bin/true
71 pkgdesc="The CUPS Printing System - daemon package"
73 backup=(etc/cups/cupsd.conf
77 etc/cups/printers.conf
80 etc/cups/subscriptions.conf
81 etc/dbus-1/system.d/cups.conf
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
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
106 # fix perms on /var/spool and /etc
107 chmod 755 ${pkgdir}/var/spool
108 chmod 755 ${pkgdir}/etc
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}
129 sed -i 's|^Exec=htmlview http://localhost:631/|Exec=xdg-open http://localhost:631/|g' ${pkgdir}/usr/share/applications/cups.desktop
131 # compress some driver files, adopted from Fedora
132 find ${pkgdir}/usr/share/cups/model -name "*.ppd" | xargs gzip -n9f