commit:     dce4f3e5b343e66d88ba2e47b14902264d42988c
Author:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 15 00:42:23 2017 +0000
Commit:     Andreas Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Wed Feb 15 00:42:44 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dce4f3e5

net-print/cups: Switch to using pidfile, bug 551544

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 .../{cups-9999.ebuild => cups-2.2.2-r2.ebuild}     | 46 +++++++++++-----------
 net-print/cups/cups-9999.ebuild                    | 46 +++++++++++-----------
 net-print/cups/files/cupsd.init.d-r3               | 23 +++++++++++
 3 files changed, 71 insertions(+), 44 deletions(-)

diff --git a/net-print/cups/cups-9999.ebuild 
b/net-print/cups/cups-2.2.2-r2.ebuild
similarity index 91%
copy from net-print/cups/cups-9999.ebuild
copy to net-print/cups/cups-2.2.2-r2.ebuild
index 0c97e45712..765945a438 100644
--- a/net-print/cups/cups-9999.ebuild
+++ b/net-print/cups/cups-2.2.2-r2.ebuild
@@ -17,7 +17,7 @@ MY_PV=${MY_PV/_beta/b}
 
 if [[ ${PV} == *9999 ]]; then
        inherit git-r3
-       EGIT_REPO_URI="http://www.cups.org/cups.git";
+       EGIT_REPO_URI="https://github.com/apple/cups.git";
        if [[ ${PV} != 9999 ]]; then
                EGIT_BRANCH=branch-${PV/.9999}
        fi
@@ -145,6 +145,12 @@ pkg_setup() {
 }
 
 src_prepare() {
+       if ! use kerberos ; then
+               PATCHES+=(
+                       "${FILESDIR}/${PN}-2.2.2-no_kerberos_config.patch"
+               )
+       fi
+
        default
 
        # Remove ".SILENT" rule for verbose output (bug 524338).
@@ -255,7 +261,7 @@ multilib_src_install_all() {
        use zeroconf && neededservices+=" avahi-daemon"
        use dbus && neededservices+=" dbus"
        [[ -n ${neededservices} ]] && neededservices="need${neededservices}"
-       cp "${FILESDIR}"/cupsd.init.d-r2 "${T}"/cupsd || die
+       cp "${FILESDIR}"/cupsd.init.d-r3 "${T}"/cupsd || die
        sed -i \
                -e "s/@neededservices@/$neededservices/" \
                "${T}"/cupsd || die
@@ -318,30 +324,26 @@ pkg_postinst() {
        gnome2_icon_cache_update
        fdo-mime_desktop_database_update
 
-       # not slotted - at most one value
-       if ! [[ "${REPLACING_VERSIONS}" ]]; then
+       local v
+
+       for v in ${REPLACING_VERSIONS}; do
+               if ! version_is_at_least 2.2.2-r2 ${v}; then
+                       echo
+                       ewarn "The cupsd init script switched to using 
pidfiles. Shutting down"
+                       ewarn "cupsd will fail the next time. To fix this, 
please run once as root"
+                       ewarn "   killall cupsd ; /etc/init.d/cupsd zap ; 
/etc/init.d/cupsd start"
+                       echo
+                       break
+               fi
+       done
+
+       for v in ${REPLACING_VERSIONS}; do
                echo
                elog "For information about installing a printer and general 
cups setup"
                elog "take a look at: https://wiki.gentoo.org/wiki/Printing";
                echo
-       fi
-
-       if [[ "${REPLACING_VERSIONS}" ]] && [[ "${REPLACING_VERSIONS}" < "1.6" 
]]; then
-               echo
-               elog "CUPS-1.6 no longer supports automatic remote printers or 
implicit classes"
-               elog "via the CUPS, LDAP, or SLP protocols, i.e. \"network 
browsing\"."
-               elog "You will have to find printers using zeroconf/avahi 
instead, enter"
-               elog "the location manually, or run cups-browsed from 
net-print/cups-filters"
-               elog "which re-adds that functionality as a separate daemon."
-               echo
-       fi
-
-       if [[ "${REPLACING_VERSIONS}" == "1.6.2-r4" ]]; then
-               ewarn
-               ewarn "You are upgrading from the broken version 
net-print/cups-1.6.2-r4."
-               ewarn "Please rebuild net-print/cups-filters now to make sure 
everything is OK."
-               ewarn
-       fi
+               break
+       done
 }
 
 pkg_postrm() {

diff --git a/net-print/cups/cups-9999.ebuild b/net-print/cups/cups-9999.ebuild
index 0c97e45712..765945a438 100644
--- a/net-print/cups/cups-9999.ebuild
+++ b/net-print/cups/cups-9999.ebuild
@@ -17,7 +17,7 @@ MY_PV=${MY_PV/_beta/b}
 
 if [[ ${PV} == *9999 ]]; then
        inherit git-r3
-       EGIT_REPO_URI="http://www.cups.org/cups.git";
+       EGIT_REPO_URI="https://github.com/apple/cups.git";
        if [[ ${PV} != 9999 ]]; then
                EGIT_BRANCH=branch-${PV/.9999}
        fi
@@ -145,6 +145,12 @@ pkg_setup() {
 }
 
 src_prepare() {
+       if ! use kerberos ; then
+               PATCHES+=(
+                       "${FILESDIR}/${PN}-2.2.2-no_kerberos_config.patch"
+               )
+       fi
+
        default
 
        # Remove ".SILENT" rule for verbose output (bug 524338).
@@ -255,7 +261,7 @@ multilib_src_install_all() {
        use zeroconf && neededservices+=" avahi-daemon"
        use dbus && neededservices+=" dbus"
        [[ -n ${neededservices} ]] && neededservices="need${neededservices}"
-       cp "${FILESDIR}"/cupsd.init.d-r2 "${T}"/cupsd || die
+       cp "${FILESDIR}"/cupsd.init.d-r3 "${T}"/cupsd || die
        sed -i \
                -e "s/@neededservices@/$neededservices/" \
                "${T}"/cupsd || die
@@ -318,30 +324,26 @@ pkg_postinst() {
        gnome2_icon_cache_update
        fdo-mime_desktop_database_update
 
-       # not slotted - at most one value
-       if ! [[ "${REPLACING_VERSIONS}" ]]; then
+       local v
+
+       for v in ${REPLACING_VERSIONS}; do
+               if ! version_is_at_least 2.2.2-r2 ${v}; then
+                       echo
+                       ewarn "The cupsd init script switched to using 
pidfiles. Shutting down"
+                       ewarn "cupsd will fail the next time. To fix this, 
please run once as root"
+                       ewarn "   killall cupsd ; /etc/init.d/cupsd zap ; 
/etc/init.d/cupsd start"
+                       echo
+                       break
+               fi
+       done
+
+       for v in ${REPLACING_VERSIONS}; do
                echo
                elog "For information about installing a printer and general 
cups setup"
                elog "take a look at: https://wiki.gentoo.org/wiki/Printing";
                echo
-       fi
-
-       if [[ "${REPLACING_VERSIONS}" ]] && [[ "${REPLACING_VERSIONS}" < "1.6" 
]]; then
-               echo
-               elog "CUPS-1.6 no longer supports automatic remote printers or 
implicit classes"
-               elog "via the CUPS, LDAP, or SLP protocols, i.e. \"network 
browsing\"."
-               elog "You will have to find printers using zeroconf/avahi 
instead, enter"
-               elog "the location manually, or run cups-browsed from 
net-print/cups-filters"
-               elog "which re-adds that functionality as a separate daemon."
-               echo
-       fi
-
-       if [[ "${REPLACING_VERSIONS}" == "1.6.2-r4" ]]; then
-               ewarn
-               ewarn "You are upgrading from the broken version 
net-print/cups-1.6.2-r4."
-               ewarn "Please rebuild net-print/cups-filters now to make sure 
everything is OK."
-               ewarn
-       fi
+               break
+       done
 }
 
 pkg_postrm() {

diff --git a/net-print/cups/files/cupsd.init.d-r3 
b/net-print/cups/files/cupsd.init.d-r3
new file mode 100644
index 0000000000..20373414e9
--- /dev/null
+++ b/net-print/cups/files/cupsd.init.d-r3
@@ -0,0 +1,23 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# $Id$
+
+description="The Common Unix Printing System daemon"
+command="/usr/sbin/cupsd"
+command_args="-f -c /etc/cups/cupsd.conf -s /etc/cups/cups-files.conf"
+pidfile="/var/run/cupsd.pid"
+start_stop_daemon_args="-b -m --pidfile ${pidfile}"
+
+depend() {
+       use net
+       @neededservices@
+       before nfs
+       after logger
+}
+
+start_pre() {
+       checkpath -q -d -m 0775 -o root:lp /var/cache/cups
+       checkpath -q -d -m 0775 -o root:lp /var/cache/cups/rss
+       checkpath -q -d -m 0755 -o root:lp /run/cups
+       checkpath -q -d -m 0511 -o lp:lpadmin /run/cups/certs
+}

Reply via email to