Gentoo Archives: gentoo-commits

From: "Andreas Hüttel" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-print/cups/files/, net-print/cups/
Date: Wed, 15 Feb 2017 00:43:00
Message-Id: 1487119364.dce4f3e5b343e66d88ba2e47b14902264d42988c.dilfridge@gentoo
1 commit: dce4f3e5b343e66d88ba2e47b14902264d42988c
2 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 15 00:42:23 2017 +0000
4 Commit: Andreas Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 15 00:42:44 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dce4f3e5
7
8 net-print/cups: Switch to using pidfile, bug 551544
9
10 Package-Manager: Portage-2.3.3, Repoman-2.3.1
11
12 .../{cups-9999.ebuild => cups-2.2.2-r2.ebuild} | 46 +++++++++++-----------
13 net-print/cups/cups-9999.ebuild | 46 +++++++++++-----------
14 net-print/cups/files/cupsd.init.d-r3 | 23 +++++++++++
15 3 files changed, 71 insertions(+), 44 deletions(-)
16
17 diff --git a/net-print/cups/cups-9999.ebuild b/net-print/cups/cups-2.2.2-r2.ebuild
18 similarity index 91%
19 copy from net-print/cups/cups-9999.ebuild
20 copy to net-print/cups/cups-2.2.2-r2.ebuild
21 index 0c97e45712..765945a438 100644
22 --- a/net-print/cups/cups-9999.ebuild
23 +++ b/net-print/cups/cups-2.2.2-r2.ebuild
24 @@ -17,7 +17,7 @@ MY_PV=${MY_PV/_beta/b}
25
26 if [[ ${PV} == *9999 ]]; then
27 inherit git-r3
28 - EGIT_REPO_URI="http://www.cups.org/cups.git"
29 + EGIT_REPO_URI="https://github.com/apple/cups.git"
30 if [[ ${PV} != 9999 ]]; then
31 EGIT_BRANCH=branch-${PV/.9999}
32 fi
33 @@ -145,6 +145,12 @@ pkg_setup() {
34 }
35
36 src_prepare() {
37 + if ! use kerberos ; then
38 + PATCHES+=(
39 + "${FILESDIR}/${PN}-2.2.2-no_kerberos_config.patch"
40 + )
41 + fi
42 +
43 default
44
45 # Remove ".SILENT" rule for verbose output (bug 524338).
46 @@ -255,7 +261,7 @@ multilib_src_install_all() {
47 use zeroconf && neededservices+=" avahi-daemon"
48 use dbus && neededservices+=" dbus"
49 [[ -n ${neededservices} ]] && neededservices="need${neededservices}"
50 - cp "${FILESDIR}"/cupsd.init.d-r2 "${T}"/cupsd || die
51 + cp "${FILESDIR}"/cupsd.init.d-r3 "${T}"/cupsd || die
52 sed -i \
53 -e "s/@neededservices@/$neededservices/" \
54 "${T}"/cupsd || die
55 @@ -318,30 +324,26 @@ pkg_postinst() {
56 gnome2_icon_cache_update
57 fdo-mime_desktop_database_update
58
59 - # not slotted - at most one value
60 - if ! [[ "${REPLACING_VERSIONS}" ]]; then
61 + local v
62 +
63 + for v in ${REPLACING_VERSIONS}; do
64 + if ! version_is_at_least 2.2.2-r2 ${v}; then
65 + echo
66 + ewarn "The cupsd init script switched to using pidfiles. Shutting down"
67 + ewarn "cupsd will fail the next time. To fix this, please run once as root"
68 + ewarn " killall cupsd ; /etc/init.d/cupsd zap ; /etc/init.d/cupsd start"
69 + echo
70 + break
71 + fi
72 + done
73 +
74 + for v in ${REPLACING_VERSIONS}; do
75 echo
76 elog "For information about installing a printer and general cups setup"
77 elog "take a look at: https://wiki.gentoo.org/wiki/Printing"
78 echo
79 - fi
80 -
81 - if [[ "${REPLACING_VERSIONS}" ]] && [[ "${REPLACING_VERSIONS}" < "1.6" ]]; then
82 - echo
83 - elog "CUPS-1.6 no longer supports automatic remote printers or implicit classes"
84 - elog "via the CUPS, LDAP, or SLP protocols, i.e. \"network browsing\"."
85 - elog "You will have to find printers using zeroconf/avahi instead, enter"
86 - elog "the location manually, or run cups-browsed from net-print/cups-filters"
87 - elog "which re-adds that functionality as a separate daemon."
88 - echo
89 - fi
90 -
91 - if [[ "${REPLACING_VERSIONS}" == "1.6.2-r4" ]]; then
92 - ewarn
93 - ewarn "You are upgrading from the broken version net-print/cups-1.6.2-r4."
94 - ewarn "Please rebuild net-print/cups-filters now to make sure everything is OK."
95 - ewarn
96 - fi
97 + break
98 + done
99 }
100
101 pkg_postrm() {
102
103 diff --git a/net-print/cups/cups-9999.ebuild b/net-print/cups/cups-9999.ebuild
104 index 0c97e45712..765945a438 100644
105 --- a/net-print/cups/cups-9999.ebuild
106 +++ b/net-print/cups/cups-9999.ebuild
107 @@ -17,7 +17,7 @@ MY_PV=${MY_PV/_beta/b}
108
109 if [[ ${PV} == *9999 ]]; then
110 inherit git-r3
111 - EGIT_REPO_URI="http://www.cups.org/cups.git"
112 + EGIT_REPO_URI="https://github.com/apple/cups.git"
113 if [[ ${PV} != 9999 ]]; then
114 EGIT_BRANCH=branch-${PV/.9999}
115 fi
116 @@ -145,6 +145,12 @@ pkg_setup() {
117 }
118
119 src_prepare() {
120 + if ! use kerberos ; then
121 + PATCHES+=(
122 + "${FILESDIR}/${PN}-2.2.2-no_kerberos_config.patch"
123 + )
124 + fi
125 +
126 default
127
128 # Remove ".SILENT" rule for verbose output (bug 524338).
129 @@ -255,7 +261,7 @@ multilib_src_install_all() {
130 use zeroconf && neededservices+=" avahi-daemon"
131 use dbus && neededservices+=" dbus"
132 [[ -n ${neededservices} ]] && neededservices="need${neededservices}"
133 - cp "${FILESDIR}"/cupsd.init.d-r2 "${T}"/cupsd || die
134 + cp "${FILESDIR}"/cupsd.init.d-r3 "${T}"/cupsd || die
135 sed -i \
136 -e "s/@neededservices@/$neededservices/" \
137 "${T}"/cupsd || die
138 @@ -318,30 +324,26 @@ pkg_postinst() {
139 gnome2_icon_cache_update
140 fdo-mime_desktop_database_update
141
142 - # not slotted - at most one value
143 - if ! [[ "${REPLACING_VERSIONS}" ]]; then
144 + local v
145 +
146 + for v in ${REPLACING_VERSIONS}; do
147 + if ! version_is_at_least 2.2.2-r2 ${v}; then
148 + echo
149 + ewarn "The cupsd init script switched to using pidfiles. Shutting down"
150 + ewarn "cupsd will fail the next time. To fix this, please run once as root"
151 + ewarn " killall cupsd ; /etc/init.d/cupsd zap ; /etc/init.d/cupsd start"
152 + echo
153 + break
154 + fi
155 + done
156 +
157 + for v in ${REPLACING_VERSIONS}; do
158 echo
159 elog "For information about installing a printer and general cups setup"
160 elog "take a look at: https://wiki.gentoo.org/wiki/Printing"
161 echo
162 - fi
163 -
164 - if [[ "${REPLACING_VERSIONS}" ]] && [[ "${REPLACING_VERSIONS}" < "1.6" ]]; then
165 - echo
166 - elog "CUPS-1.6 no longer supports automatic remote printers or implicit classes"
167 - elog "via the CUPS, LDAP, or SLP protocols, i.e. \"network browsing\"."
168 - elog "You will have to find printers using zeroconf/avahi instead, enter"
169 - elog "the location manually, or run cups-browsed from net-print/cups-filters"
170 - elog "which re-adds that functionality as a separate daemon."
171 - echo
172 - fi
173 -
174 - if [[ "${REPLACING_VERSIONS}" == "1.6.2-r4" ]]; then
175 - ewarn
176 - ewarn "You are upgrading from the broken version net-print/cups-1.6.2-r4."
177 - ewarn "Please rebuild net-print/cups-filters now to make sure everything is OK."
178 - ewarn
179 - fi
180 + break
181 + done
182 }
183
184 pkg_postrm() {
185
186 diff --git a/net-print/cups/files/cupsd.init.d-r3 b/net-print/cups/files/cupsd.init.d-r3
187 new file mode 100644
188 index 0000000000..20373414e9
189 --- /dev/null
190 +++ b/net-print/cups/files/cupsd.init.d-r3
191 @@ -0,0 +1,23 @@
192 +#!/sbin/openrc-run
193 +# Copyright 1999-2017 Gentoo Foundation
194 +# $Id$
195 +
196 +description="The Common Unix Printing System daemon"
197 +command="/usr/sbin/cupsd"
198 +command_args="-f -c /etc/cups/cupsd.conf -s /etc/cups/cups-files.conf"
199 +pidfile="/var/run/cupsd.pid"
200 +start_stop_daemon_args="-b -m --pidfile ${pidfile}"
201 +
202 +depend() {
203 + use net
204 + @neededservices@
205 + before nfs
206 + after logger
207 +}
208 +
209 +start_pre() {
210 + checkpath -q -d -m 0775 -o root:lp /var/cache/cups
211 + checkpath -q -d -m 0775 -o root:lp /var/cache/cups/rss
212 + checkpath -q -d -m 0755 -o root:lp /run/cups
213 + checkpath -q -d -m 0511 -o lp:lpadmin /run/cups/certs
214 +}