Date: Friday, June 17, 2011 @ 15:45:36 Author: andyrtr Revision: 127716
upgpkg: cups 1.4.6-4 make xdg-utils an optional dependency FS#24444; use condional icon updates at install/update therefore; update the rc.d file with the proto one from abs pkg to gain latest initscript features; remove /var/run from pkg FS#18157 Modified: cups/trunk/PKGBUILD cups/trunk/cups cups/trunk/cups.install --------------+ PKGBUILD | 47 +++++++++++++++++++++++++++++++++++----------- cups | 58 +++++++++++++++++++++++++++++++++++++++++++-------------- cups.install | 12 ++++++++--- 3 files changed, 89 insertions(+), 28 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2011-06-17 18:25:22 UTC (rev 127715) +++ PKGBUILD 2011-06-17 19:45:36 UTC (rev 127716) @@ -4,11 +4,11 @@ pkgbase="cups" pkgname=('libcups' 'cups') pkgver=1.4.6 -pkgrel=3 +pkgrel=4 arch=('i686' 'x86_64') license=('GPL') url="http://www.cups.org/" -makedepends=('libtiff>=3.9.2-2' 'libpng>=1.4.0' 'acl' 'openslp' 'pam' 'xdg-utils' 'krb5' 'gnutls>=2.8.3' 'poppler>=0.12.3' +makedepends=('libtiff>=3.9.2-2' 'libpng>=1.4.0' 'acl' 'openslp' 'pam' 'xdg-utils' 'krb5' 'gnutls>=2.8.3' 'poppler>=0.12.3' 'xinetd' 'gzip' 'autoconf' 'php' 'libusb-compat' 'dbus-core' 'avahi' 'hicolor-icon-theme') source=(ftp://ftp.easysw.com/pub/cups/${pkgver}/cups-${pkgver}-source.tar.bz2 cups-avahi.patch @@ -16,7 +16,7 @@ #options=('!emptydirs') md5sums=('de8fb5a29c36554925c0c6a6e2c0dae1' '8ebd390197501ffd709f0ee546937fd5' - '5c85b7d8d2ddd02c2c64955cebbf55ea' + '9657daa21760bb0b5fa3d8b51d5e01a1' 'f861b18f4446c43918c8643dcbbd7f6d' '96f82c38f3f540b53f3e5144900acf17') @@ -32,14 +32,36 @@ autoconf -I config-scripts ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ - --with-logdir=/var/log/cups -with-docdir=/usr/share/cups/doc \ - --with-cups-user=daemon --with-cups-group=lp --enable-pam=yes \ - --disable-ldap --libdir=/usr/lib --enable-raw-printing \ - --enable-dbus --with-dbusdir=/etc/dbus-1 --enable-ssl=yes --enable-gnutls --disable-threads --enable-avahi\ - --with-php=/usr/bin/php-cgi --with-pdftops=pdftops --with-optim="$CFLAGS" + --libdir=/usr/lib \ + --with-logdir=/var/log/cups \ + --with-docdir=/usr/share/cups/doc \ + --with-cups-user=daemon \ + --with-cups-group=lp \ + --enable-pam=yes \ + --disable-ldap \ + --enable-raw-printing \ + --enable-dbus --with-dbusdir=/etc/dbus-1 \ + --enable-ssl=yes --enable-gnutls \ + --disable-threads \ + --enable-avahi\ + --with-php=/usr/bin/php-cgi \ + --with-pdftops=pdftops \ + --with-optim="$CFLAGS" + + #reminder + #Restored support for GNU TLS and OpenSSL with threading enabled (STR #3605) in cups 1.5b1 + make } +check() { + cd "$srcdir/$pkgbase-$pkgver" + #httpAddrGetList(workstation64): FAIL + #1 TESTS FAILED! + #make[1]: *** [testhttp] Error 1 + make -k check || /bin/true +} + package_libcups() { pkgdesc="The CUPS Printing System - client libraries and headers" depends=('gnutls>=2.8.3' 'libtiff>=3.9.2-2' 'libpng>=1.4.0' 'krb5' 'avahi') @@ -66,12 +88,13 @@ etc/logrotate.d/cups etc/pam.d/cups etc/xinetd.d/cups-lpd) -depends=('acl' 'openslp' 'pam' "libcups>=${pkgver}" 'xdg-utils' 'poppler>=0.12.3' 'libusb-compat' 'dbus-core' 'hicolor-icon-theme') +depends=('acl' 'openslp' 'pam' "libcups>=${pkgver}" 'poppler>=0.12.3' 'libusb-compat' 'dbus-core' 'hicolor-icon-theme') optdepends=('php: for included phpcups.so module' 'ghostscript: for non-PostScript printers to print with CUPS to convert PostScript to raster images' 'foomatic-db: drivers use Ghostscript to convert PostScript to a printable form directly' 'foomatic-db-engine: drivers use Ghostscript to convert PostScript to a printable form directly' - 'foomatic-db-nonfree: drivers use Ghostscript to convert PostScript to a printable form directly') + 'foomatic-db-nonfree: drivers use Ghostscript to convert PostScript to a printable form directly' + 'xdg-utils: xdg .desktop file support') cd ${srcdir}/${pkgbase}-${pkgver} make BUILDROOT=${pkgdir} install-data install-exec @@ -95,7 +118,9 @@ # install ssl directory where to store the certs, solves some samba issues install -dm700 -g lp ${pkgdir}/etc/cups/ssl - install -dm511 -g lp ${pkgdir}/var/run/cups/certs + # remove directory from package, we create it in cups rc.d file + rm -rf ${pkgdir}/var/run +# install -dm511 -g lp ${pkgdir}/var/run/cups/certs # install some more configuration files that will get filled by cupsd touch ${pkgdir}/etc/cups/printers.conf Modified: cups =================================================================== --- cups 2011-06-17 18:25:22 UTC (rev 127715) +++ cups 2011-06-17 19:45:36 UTC (rev 127716) @@ -1,38 +1,68 @@ #!/bin/bash +daemon_name=cupsd + . /etc/rc.conf . /etc/rc.d/functions +#. /etc/conf.d/$daemon_name.conf -PID=`pidof -o %PPID /usr/sbin/cupsd` +get_pid() { + pidof -o %PPID $daemon_name +} + case "$1" in start) - stat_busy "Starting CUPS Daemon" - [ -z "$PID" ] && /usr/sbin/cupsd - if [ $? -gt 0 ]; then + stat_busy "Starting $daemon_name daemon" + + PID=$(get_pid) + if [ -z "$PID" ]; then + [ -f /var/run/$daemon_name.pid ] && rm -f /var/run/$daemon_name.pid + # RUN + $daemon_name + # + if [ $? -gt 0 ]; then + stat_fail + exit 1 + else + echo $(get_pid) > /var/run/$daemon_name.pid + add_daemon $daemon_name + stat_done + fi + else stat_fail - else - echo $(pidof -o %PPID -x /usr/sbin/cupsd) > /var/run/cups.pid - add_daemon cups - stat_done + exit 1 fi ;; + stop) - stat_busy "Stopping CUPS Daemon" - [ ! -z "$PID" ] && kill $PID &> /dev/null + stat_busy "Stopping $daemon_name daemon" + PID=$(get_pid) + # KILL + [ ! -z "$PID" ] && kill $PID &> /dev/null + # if [ $? -gt 0 ]; then stat_fail + exit 1 else - rm /var/run/cups.pid - rm_daemon cups + rm -f /var/run/$daemon_name.pid &> /dev/null + rm_daemon $daemon_name stat_done fi ;; + restart) $0 stop - sleep 1 + sleep 3 $0 start ;; + + status) + stat_busy "Checking $daemon_name status"; + ck_status $daemon_name + ;; + *) - echo "usage: $0 {start|stop|restart}" + echo "usage: $0 {start|stop|restart|status}" esac + exit 0 Modified: cups.install =================================================================== --- cups.install 2011-06-17 18:25:22 UTC (rev 127715) +++ cups.install 2011-06-17 19:45:36 UTC (rev 127716) @@ -1,5 +1,7 @@ post_install() { - xdg-icon-resource forceupdate --theme hicolor 2> /dev/null + if [ -x usr/bin/xdg-icon-resource ]; then + xdg-icon-resource forceupdate --theme hicolor 2> /dev/null + fi echo ">> If you use an HTTPS connection to CUPS, the first time you access" echo ">> the interface it may take a very long time before the site comes up." echo ">> This is because the first request triggers the generation of the CUPS" @@ -7,9 +9,13 @@ } post_upgrade() { - xdg-icon-resource forceupdate --theme hicolor 2> /dev/null + if [ -x usr/bin/xdg-icon-resource ]; then + xdg-icon-resource forceupdate --theme hicolor 2> /dev/null + fi } post_remove() { - xdg-icon-resource forceupdate --theme hicolor 2> /dev/null + if [ -x usr/bin/xdg-icon-resource ]; then + xdg-icon-resource forceupdate --theme hicolor 2> /dev/null + fi }