1 # Maintainer: Andreas Radke <andyrtr@archlinux.org>
4 pkgname=('libcups' 'cups')
9 license=('Apache' 'custom')
10 url="https://openprinting.github.io/cups/"
11 makedepends=('acl' 'pam' 'gnutls' 'cups-filters' 'colord'
12 'libusb' 'avahi' 'systemd' 'libpaper')
13 #checkdepends=('valgrind')
14 source=(https://github.com/OpenPrinting/cups/releases/download/v${pkgver}/cups-${pkgver}-source.tar.gz{,.sig}
18 cups-2.4.0-statedir.patch
22 0001_Fix_OpenSSL_crash_bug.patch
23 0002_do_not_set_RGB_default_on_monochrome_printers.patch
25 sha256sums=('f03ccb40b087d1e30940a40e0141dcbba263f39974c20eb9f2521066c9c6c908'
27 'd87fa0f0b5ec677aae34668f260333db17ce303aa1a752cba5f8e72623d9acf9'
28 '57dfd072fd7ef0018c6b0a798367aac1abb5979060ff3f9df22d1048bb71c0d5'
29 '06173dfaea37bdd9b39b3e09aba98c34ae7112a2f521db45a688907d8848caa2'
30 'f0b15192952c151b1843742c87850ff3a7d0f3ba5dd236ed16623ef908472ad7'
31 '3385047b9ac8a7b13aeb8f0ca55d15f793ce7283516db0155fe28a67923c592d'
32 '0bf6a75ba1b051771f155d9a5d36b307a6d40c6857d645b250fe93f3fb713474'
33 '632faf08bfd1863e9ad6807aff766983e84030a0e4df441167f17de7266ca152'
34 'f7e2c6dfcdf882f0f54c95728a3e2c63309ee73f9d2efc8e5b8a758fb2c7f429')
35 #validpgpkeys=('3737FD0D0E63B30172440D2DDBA3A7AB08D76223') # CUPS.org (CUPS.org PGP key) <security@cups.org>
36 #validpgpkeys+=('45D083946E3035282B3CCA9AF434104235DA97EB') # "CUPS.org <security@cups.org>"
37 #validpgpkeys+=('845464660B686AAB36540B6F999559A027815955') # "Michael R Sweet <michael.r.sweet@gmail.com>"
38 #validpgpkeys=('7ADB58203CA5F046F28025B215AA6A7F4D4227D7') # "Zdenek Dohnal (Associate Software Engineer) <zdohnal@redhat.com>"
39 validpgpkeys=('7082A0A50A2E92640F3880E0E4522DCC9B246FF7') # Zdenek Dohnal (The old 4D4227D7 key revoked) <zdohnal@redhat.com>
43 cd "${pkgbase}"-${pkgver}
45 # move /var/run -> /run for pid file
46 patch -Np1 -i "${srcdir}"/cups-2.4.0-statedir.patch
50 # https://github.com/OpenPrinting/cups/issues/53
51 # use IP_FREEBIND, because cupsd cannot bind to not yet existing IP address
52 patch -Np1 -i "${srcdir}"/cups-freebind.patch
54 # FS#56818 - https://github.com/apple/cups/issues/5236
55 patch -Np1 -i "${srcdir}"/guid.patch
57 # FS#75005 - Fix OpenSSL crash bug - "tls" pointer wasn't cleared after
58 # Fix OpenSSL crash bug - "tls" pointer wasn't cleared after
59 patch -Np1 -i "${srcdir}"/0001_Fix_OpenSSL_crash_bug.patch
61 # In auto-generated PPDs do not set RGB default on mono printers - FS#78150
62 # https://github.com/OpenPrinting/cups/commit/ebf3bb82593e5f49093ed7b9e52452333240d225
63 patch -Np1 -i "${srcdir}"/0002_do_not_set_RGB_default_on_monochrome_printers.patch
65 # Rebuild configure script
66 aclocal -I config-scripts
67 autoconf -I config-scripts
71 cd "${pkgbase}"-${pkgver}
73 # The build system uses only DSOFLAGS but not LDFLAGS to build some libraries.
74 export DSOFLAGS=${LDFLAGS}
76 # use fixed cups user (id 209) since systemd adds "lp" group without a fixed id
77 ./configure --prefix=/usr \
79 --localstatedir=/var \
82 --with-logdir=/var/log/cups \
83 --with-docdir=/usr/share/cups/doc \
84 --with-exe-file-perm=0755 \
85 --with-cups-user=209 \
86 --with-cups-group=209 \
87 --with-max-log-size=0 \
89 --enable-raw-printing \
92 --with-dbusdir=/usr/share/dbus-1 \
95 --with-optim="$CFLAGS" #--help
99 # don't run tests - they take ages
101 # cd "${pkgbase}"-${pkgver}
102 ## make -k check || /bin/true
107 pkgdesc="OpenPrinting CUPS - client libraries and headers"
108 depends=('gnutls' 'avahi')
110 cd ${pkgbase}-${pkgver}
111 make BUILDROOT="${pkgdir}" install-headers install-libs
112 # put this into the libs pkg to make other software find the libs(no pkg-config file included)
113 mkdir -p "${pkgdir}"/usr/bin
114 install -m755 "${srcdir}"/"${pkgbase}"-${pkgver}/cups-config "${pkgdir}"/usr/bin/cups-config
116 # add license + exception
117 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" {LICENSE,NOTICE}
121 pkgdesc="OpenPrinting CUPS - daemon package"
123 backup=(etc/cups/cupsd.conf
125 etc/cups/printers.conf
126 etc/cups/classes.conf
127 etc/cups/cups-files.conf
128 etc/cups/subscriptions.conf
131 depends=('acl' 'pam' "libcups>=${pkgver}" 'cups-filters'
132 'dbus' 'systemd' 'libpaper' 'hicolor-icon-theme')
133 optdepends=('libusb: for usb printer backend'
134 'ipp-usb: allows to send HTTP requests via a USB connection on devices without Ethernet or WiFi connections'
135 'xdg-utils: xdg .desktop file support'
136 'colord: for ICC color profile support'
137 'logrotate: for logfile rotation support')
139 cd "${pkgbase}"-${pkgver}
140 make BUILDROOT="${pkgdir}" install-data install-exec
142 # this one we ship in the libcups pkg
143 rm -f "${pkgdir}"/usr/bin/cups-config
145 # kill the sysv stuff
146 rm -rf "${pkgdir}"/etc/rc*.d
147 rm -rf "${pkgdir}"/etc/init.d
148 install -D -m644 ../cups.logrotate "${pkgdir}"/etc/logrotate.d/cups
149 install -D -m644 ../cups.pam "${pkgdir}"/etc/pam.d/cups
151 # fix perms on /var/spool and /etc
152 chmod 755 "${pkgdir}"/var/spool
153 chmod 755 "${pkgdir}"/etc
155 # use cups group FS#36769
156 install -Dm644 "$srcdir"/cups.sysusers "${pkgdir}/usr/lib/sysusers.d/$pkgname.conf"
157 sed -i "s:#User 209:User 209:" "${pkgdir}"/etc/cups/cups-files.conf{,.default}
158 sed -i "s:#Group 209:Group 209:" "${pkgdir}"/etc/cups/cups-files.conf{,.default}
160 # install ssl directory where to store the certs, solves some samba issues
161 install -dm700 -g 209 "${pkgdir}"/etc/cups/ssl
162 # remove directory from package, it will be recreated at each server start
163 rm -rf "${pkgdir}"/run
165 # install some more configuration files that will get filled by cupsd
166 touch "${pkgdir}"/etc/cups/printers.conf
167 touch "${pkgdir}"/etc/cups/classes.conf
168 touch "${pkgdir}"/etc/cups/subscriptions.conf
169 chgrp -R 209 "${pkgdir}"/etc/cups
172 sed -i 's|^Exec=htmlview http://localhost:631/|Exec=xdg-open http://localhost:631/|g' "${pkgdir}"/usr/share/applications/cups.desktop
174 # compress some driver files, adopted from Fedora
175 find "${pkgdir}"/usr/share/cups/model -name "*.ppd" | xargs gzip -n9f
177 # remove client.conf man page
178 rm -f "${pkgdir}"/usr/share/man/man5/client.conf.5
180 # comment out removed filters that are now part of cups-filters
181 perl -p -i -e 's:^(.*\s+bannertops\s*)$:#\1:' "$pkgdir"/usr/share/cups/mime/mime.convs
183 # comment out unnecessary PageLogFormat entry
184 sed -i -e 's:PageLogFormat:#PageLogFormat:' "$pkgdir"/etc/cups/cupsd.conf*
186 # no more xinetd support
187 rm -rf "${pkgdir}"/etc/xinetd.d