/[gentoo-x86]/net-print/cups/cups-9999.ebuild
Gentoo

Contents of /net-print/cups/cups-9999.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.63 - (show annotations) (download)
Sun Sep 7 20:48:21 2014 UTC (10 days, 3 hours ago) by dilfridge
Branch: MAIN
CVS Tags: HEAD
Changes since 1.62: +1 -14 lines
Undo the last change; as correctly pointed out by Arfrever it makes no sense.

(Portage version: 2.2.12/cvs/Linux x86_64, signed Manifest commit with key 84AD142F)

1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-print/cups/cups-9999.ebuild,v 1.61 2014/09/06 18:56:00 dilfridge Exp $
4
5 EAPI=5
6
7 PYTHON_COMPAT=( python{2_6,2_7} )
8
9 inherit autotools base fdo-mime gnome2-utils flag-o-matic linux-info \
10 multilib multilib-minimal pam python-single-r1 user versionator \
11 java-pkg-opt-2 systemd toolchain-funcs
12
13 MY_P=${P/_rc/rc}
14 MY_P=${MY_P/_beta/b}
15 MY_PV=${PV/_rc/rc}
16 MY_PV=${MY_PV/_beta/b}
17
18 if [[ ${PV} == *9999 ]]; then
19 inherit git-r3
20 EGIT_REPO_URI="http://www.cups.org/cups.git"
21 if [[ ${PV} != 9999 ]]; then
22 EGIT_BRANCH=branch-${PV/.9999}
23 fi
24 KEYWORDS=""
25 else
26 SRC_URI="http://www.cups.org/software/${MY_PV}/${MY_P}-source.tar.bz2"
27 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~m68k-mint"
28 fi
29
30 DESCRIPTION="The Common Unix Printing System"
31 HOMEPAGE="http://www.cups.org/"
32
33 LICENSE="GPL-2"
34 SLOT="0"
35 IUSE="acl dbus debug gnutls java kerberos lprng-compat pam
36 python selinux +ssl static-libs systemd +threads usb X xinetd zeroconf"
37
38 LANGS="ca es fr it ja pt_BR ru"
39 for X in ${LANGS} ; do
40 IUSE="${IUSE} +linguas_${X}"
41 done
42
43 RDEPEND="
44 app-text/libpaper
45 acl? (
46 kernel_linux? (
47 sys-apps/acl
48 sys-apps/attr
49 )
50 )
51 dbus? ( >=sys-apps/dbus-1.6.18-r1[${MULTILIB_USEDEP}] )
52 java? ( >=virtual/jre-1.6 )
53 kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )
54 !lprng-compat? ( !net-print/lprng )
55 pam? ( virtual/pam )
56 python? ( ${PYTHON_DEPS} )
57 selinux? ( sec-policy/selinux-cups )
58 ssl? (
59 gnutls? (
60 >=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}]
61 >=net-libs/gnutls-2.12.23-r6[${MULTILIB_USEDEP}]
62 )
63 !gnutls? ( >=dev-libs/openssl-1.0.1h-r2[${MULTILIB_USEDEP}] )
64 )
65 usb? ( virtual/libusb:1 )
66 X? ( x11-misc/xdg-utils )
67 xinetd? ( sys-apps/xinetd )
68 zeroconf? ( >=net-dns/avahi-0.6.31-r2[${MULTILIB_USEDEP}] )
69 abi_x86_32? (
70 !<=app-emulation/emul-linux-x86-baselibs-20140508
71 !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
72 )
73 "
74
75 DEPEND="${RDEPEND}
76 >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
77 "
78
79 PDEPEND="
80 app-text/ghostscript-gpl[cups]
81 app-text/poppler[utils]
82 >=net-print/cups-filters-1.0.43
83 "
84
85 REQUIRED_USE="
86 gnutls? ( ssl )
87 python? ( ${PYTHON_REQUIRED_USE} )
88 usb? ( threads )
89 "
90
91 # upstream includes an interactive test which is a nono for gentoo
92 RESTRICT="test"
93
94 S="${WORKDIR}/${MY_P}"
95
96 PATCHES=(
97 "${FILESDIR}/${PN}-1.6.0-dont-compress-manpages.patch"
98 "${FILESDIR}/${PN}-1.6.0-fix-install-perms.patch"
99 "${FILESDIR}/${PN}-1.4.4-nostrip.patch"
100 )
101
102 MULTILIB_CHOST_TOOLS=(
103 /usr/bin/cups-config
104 )
105
106 pkg_setup() {
107 enewgroup lp
108 enewuser lp -1 -1 -1 lp
109 enewgroup lpadmin 106
110
111 use python && python-single-r1_pkg_setup
112
113 if use kernel_linux; then
114 linux-info_pkg_setup
115 if ! linux_config_exists; then
116 ewarn "Can't check the linux kernel configuration."
117 ewarn "You might have some incompatible options enabled."
118 else
119 # recheck that we don't have usblp to collide with libusb
120 if use usb; then
121 if linux_chkconfig_present USB_PRINTER; then
122 eerror "Your usb printers will be managed via libusb. In this case, "
123 eerror "${P} requires the USB_PRINTER support disabled."
124 eerror "Please disable it:"
125 eerror " CONFIG_USB_PRINTER=n"
126 eerror "in /usr/src/linux/.config or"
127 eerror " Device Drivers --->"
128 eerror " USB support --->"
129 eerror " [ ] USB Printer support"
130 eerror "Alternatively, just disable the usb useflag for cups (your printer will still work)."
131 fi
132 else
133 #here we should warn user that he should enable it so he can print
134 if ! linux_chkconfig_present USB_PRINTER; then
135 ewarn "If you plan to use USB printers you should enable the USB_PRINTER"
136 ewarn "support in your kernel."
137 ewarn "Please enable it:"
138 ewarn " CONFIG_USB_PRINTER=y"
139 ewarn "in /usr/src/linux/.config or"
140 ewarn " Device Drivers --->"
141 ewarn " USB support --->"
142 ewarn " [*] USB Printer support"
143 ewarn "Alternatively, enable the usb useflag for cups and use the libusb code."
144 fi
145 fi
146 fi
147 fi
148 }
149
150 src_prepare() {
151 base_src_prepare
152 use systemd && epatch "${FILESDIR}/${PN}-1.7.2-systemd-socket-2.patch"
153
154 # Fix install-sh, posix sh does not have 'function'.
155 sed 's#function gzipcp#gzipcp()#g' -i "${S}/install-sh"
156
157 AT_M4DIR=config-scripts eaclocal
158 eautoconf
159
160 # custom Makefiles
161 multilib_copy_sources
162 }
163
164 multilib_src_configure() {
165 export DSOFLAGS="${LDFLAGS}"
166
167 einfo LANGS=\"${LANGS}\"
168 einfo LINGUAS=\"${LINGUAS}\"
169
170 local myconf=()
171 if use ssl ; then
172 myconf+=(
173 $(use_enable gnutls)
174 $(use_enable !gnutls openssl)
175 )
176 else
177 myconf+=(
178 --disable-gnutls
179 --disable-openssl
180 )
181 fi
182
183 if tc-is-static-only; then
184 myconf+=(
185 --disable-shared
186 )
187 fi
188
189 if use systemd; then
190 myconf+=(
191 --with-systemdsystemunitdir="$(systemd_get_unitdir)"
192 )
193 fi
194
195 # need to override KRB5CONFIG for proper flags
196 # https://www.cups.org/str.php?L4423
197 econf \
198 KRB5CONFIG="${EPREFIX}"/usr/bin/${CHOST}-krb5-config \
199 --libdir="${EPREFIX}"/usr/$(get_libdir) \
200 --localstatedir="${EPREFIX}"/var \
201 --with-rundir="${EPREFIX}"/run/cups \
202 --with-cups-user=lp \
203 --with-cups-group=lp \
204 --with-docdir="${EPREFIX}"/usr/share/cups/html \
205 --with-languages="${LINGUAS}" \
206 --with-system-groups=lpadmin \
207 $(multilib_native_use_enable acl) \
208 $(use_enable zeroconf avahi) \
209 $(use_enable dbus) \
210 $(use_enable debug) \
211 $(use_enable debug debug-guards) \
212 $(use_enable kerberos gssapi) \
213 $(multilib_native_use_enable pam) \
214 $(use_enable static-libs static) \
215 $(use_enable threads) \
216 $(multilib_native_use_enable usb libusb) \
217 --disable-dnssd \
218 $(multilib_native_use_with java) \
219 --without-perl \
220 --without-php \
221 $(multilib_native_use_with python python "${PYTHON}") \
222 $(multilib_native_use_with xinetd xinetd /etc/xinetd.d) \
223 $(multilib_is_native_abi && echo --enable-libpaper || echo --disable-libpaper) \
224 "${myconf[@]}"
225
226 # install in /usr/libexec always, instead of using /usr/lib/cups, as that
227 # makes more sense when facing multilib support.
228 sed -i -e "s:SERVERBIN.*:SERVERBIN = \"\$\(BUILDROOT\)${EPREFIX}/usr/libexec/cups\":" Makedefs || die
229 sed -i -e "s:#define CUPS_SERVERBIN.*:#define CUPS_SERVERBIN \"${EPREFIX}/usr/libexec/cups\":" config.h || die
230 sed -i -e "s:cups_serverbin=.*:cups_serverbin=\"${EPREFIX}/usr/libexec/cups\":" cups-config || die
231 }
232
233 multilib_src_compile() {
234 if multilib_is_native_abi; then
235 default
236 else
237 emake libs
238 fi
239 }
240
241 multilib_src_test() {
242 multilib_is_native_abi && default
243 }
244
245 multilib_src_install() {
246 if multilib_is_native_abi; then
247 emake BUILDROOT="${D}" install
248 else
249 emake BUILDROOT="${D}" install-libs install-headers
250 dobin cups-config
251 fi
252 }
253
254 multilib_src_install_all() {
255 dodoc {CHANGES,CREDITS,README}.txt
256
257 # move the default config file to docs
258 dodoc "${ED}"/etc/cups/cupsd.conf.default
259 rm -f "${ED}"/etc/cups/cupsd.conf.default
260
261 # clean out cups init scripts
262 rm -rf "${ED}"/etc/{init.d/cups,rc*,pam.d/cups}
263
264 # install our init script
265 local neededservices
266 use zeroconf && neededservices+=" avahi-daemon"
267 use dbus && neededservices+=" dbus"
268 [[ -n ${neededservices} ]] && neededservices="need${neededservices}"
269 cp "${FILESDIR}"/cupsd.init.d-r1 "${T}"/cupsd || die
270 sed -i \
271 -e "s/@neededservices@/$neededservices/" \
272 "${T}"/cupsd || die
273 doinitd "${T}"/cupsd
274
275 # install our pam script
276 pamd_mimic_system cups auth account
277
278 if use xinetd ; then
279 # correct path
280 sed -i \
281 -e "s:server = .*:server = /usr/libexec/cups/daemon/cups-lpd:" \
282 "${ED}"/etc/xinetd.d/cups-lpd || die
283 # it is safer to disable this by default, bug #137130
284 grep -w 'disable' "${ED}"/etc/xinetd.d/cups-lpd || \
285 { sed -i -e "s:}:\tdisable = yes\n}:" "${ED}"/etc/xinetd.d/cups-lpd || die ; }
286 # write permission for file owner (root), bug #296221
287 fperms u+w /etc/xinetd.d/cups-lpd || die "fperms failed"
288 else
289 rm -rf "${ED}"/etc/xinetd.d
290 fi
291
292 keepdir /usr/libexec/cups/driver /usr/share/cups/{model,profiles} \
293 /var/log/cups /var/spool/cups/tmp
294
295 keepdir /etc/cups/{interfaces,ppd,ssl}
296
297 use X || rm -r "${ED}"/usr/share/applications
298
299 # create /etc/cups/client.conf, bug #196967 and #266678
300 echo "ServerName ${EPREFIX}/run/cups/cups.sock" >> "${ED}"/etc/cups/client.conf
301
302 # the following files are now provided by cups-filters:
303 rm -r "${ED}"/usr/share/cups/banners || die
304 rm -r "${ED}"/usr/share/cups/data/testprint || die
305
306 # the following are created by the init script
307 rm -r "${ED}"/var/cache/cups || die
308 rm -r "${ED}"/run || die
309
310 # for the special case of running lprng and cups together, bug 467226
311 if use lprng-compat ; then
312 rm -fv "${ED}"/usr/bin/{lp*,cancel}
313 rm -fv "${ED}"/usr/sbin/lp*
314 rm -fv "${ED}"/usr/share/man/man1/{lp*,cancel*}
315 rm -fv "${ED}"/usr/share/man/man8/lp*
316 ewarn "Not installing lp... binaries, since the lprng-compat useflag is set."
317 ewarn "Unless you plan to install an exotic server setup, you most likely"
318 ewarn "do not want this. Disable the useflag then and all will be fine."
319 fi
320 }
321
322 pkg_preinst() {
323 gnome2_icon_savelist
324 }
325
326 pkg_postinst() {
327 # Update desktop file database and gtk icon cache (bug 370059)
328 gnome2_icon_cache_update
329 fdo-mime_desktop_database_update
330
331 # not slotted - at most one value
332 if ! [[ "${REPLACING_VERSIONS}" ]]; then
333 echo
334 elog "For information about installing a printer and general cups setup"
335 elog "take a look at: http://www.gentoo.org/doc/en/printing-howto.xml"
336 echo
337 fi
338
339 if [[ "${REPLACING_VERSIONS}" ]] && [[ "${REPLACING_VERSIONS}" < "1.6" ]]; then
340 echo
341 elog "CUPS-1.6 no longer supports automatic remote printers or implicit classes"
342 elog "via the CUPS, LDAP, or SLP protocols, i.e. \"network browsing\"."
343 elog "You will have to find printers using zeroconf/avahi instead, enter"
344 elog "the location manually, or run cups-browsed from net-print/cups-filters"
345 elog "which re-adds that functionality as a separate daemon."
346 echo
347 fi
348
349 if [[ "${REPLACING_VERSIONS}" == "1.6.2-r4" ]]; then
350 ewarn
351 ewarn "You are upgrading from the broken version net-print/cups-1.6.2-r4."
352 ewarn "Please rebuild net-print/cups-filters now to make sure everything is OK."
353 ewarn
354 fi
355 }
356
357 pkg_postrm() {
358 # Update desktop file database and gtk icon cache (bug 370059)
359 gnome2_icon_cache_update
360 fdo-mime_desktop_database_update
361 }

  ViewVC Help
Powered by ViewVC 1.1.20