/[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.70 - (show annotations) (download)
Tue Feb 10 21:19:39 2015 UTC (2 weeks, 2 days ago) by dilfridge
Branch: MAIN
CVS Tags: HEAD
Changes since 1.69: +2 -3 lines
Version bump

(Portage version: 2.2.15/cvs/Linux x86_64, signed Manifest commit with key EBE6A336BE19039C!)

1 # Copyright 1999-2015 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.69 2015/01/03 20:05:37 mrueg 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 else
25 SRC_URI="http://www.cups.org/software/${MY_PV}/${MY_P}-source.tar.bz2"
26 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~m68k-mint"
27 fi
28
29 DESCRIPTION="The Common Unix Printing System"
30 HOMEPAGE="http://www.cups.org/"
31
32 LICENSE="GPL-2"
33 SLOT="0"
34 IUSE="acl dbus debug java kerberos lprng-compat pam
35 python selinux +ssl static-libs systemd +threads usb X xinetd zeroconf"
36
37 LANGS="ca cs de es fr it ja pt_BR ru"
38 for X in ${LANGS} ; do
39 IUSE="${IUSE} +linguas_${X}"
40 done
41
42 CDEPEND="
43 app-text/libpaper
44 acl? (
45 kernel_linux? (
46 sys-apps/acl
47 sys-apps/attr
48 )
49 )
50 dbus? ( >=sys-apps/dbus-1.6.18-r1[${MULTILIB_USEDEP}] )
51 java? ( >=virtual/jre-1.6 )
52 kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )
53 !lprng-compat? ( !net-print/lprng )
54 pam? ( virtual/pam )
55 python? ( ${PYTHON_DEPS} )
56 ssl? (
57 >=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}]
58 >=net-libs/gnutls-2.12.23-r6[${MULTILIB_USEDEP}]
59 )
60 systemd? ( sys-apps/systemd )
61 usb? ( virtual/libusb:1 )
62 X? ( x11-misc/xdg-utils )
63 xinetd? ( sys-apps/xinetd )
64 zeroconf? ( >=net-dns/avahi-0.6.31-r2[${MULTILIB_USEDEP}] )
65 abi_x86_32? (
66 !<=app-emulation/emul-linux-x86-baselibs-20140508
67 !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
68 )
69 "
70
71 DEPEND="${CDEPEND}
72 >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
73 "
74
75 RDEPEND="${CDEPEND}
76 selinux? ( sec-policy/selinux-cups )
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 python? ( ${PYTHON_REQUIRED_USE} )
87 usb? ( threads )
88 "
89
90 # upstream includes an interactive test which is a nono for gentoo
91 RESTRICT="test"
92
93 S="${WORKDIR}/${MY_P}"
94
95 PATCHES=(
96 "${FILESDIR}/${PN}-1.6.0-dont-compress-manpages.patch"
97 "${FILESDIR}/${PN}-1.6.0-fix-install-perms.patch"
98 "${FILESDIR}/${PN}-1.4.4-nostrip.patch"
99 "${FILESDIR}/${PN}-2.0.1-rename-systemd-service-files.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
153 # Remove ".SILENT" rule for verbose output (bug 524338).
154 sed 's#^.SILENT:##g' -i "${S}"/Makedefs.in || die "sed failed"
155
156 # Fix install-sh, posix sh does not have 'function'.
157 sed 's#function gzipcp#gzipcp()#g' -i "${S}/install-sh"
158
159 AT_M4DIR=config-scripts eaclocal
160 eautoconf
161
162 # custom Makefiles
163 multilib_copy_sources
164 }
165
166 multilib_src_configure() {
167 export DSOFLAGS="${LDFLAGS}"
168
169 einfo LANGS=\"${LANGS}\"
170 einfo LINGUAS=\"${LINGUAS}\"
171
172 local myconf=()
173
174 if tc-is-static-only; then
175 myconf+=(
176 --disable-shared
177 )
178 fi
179
180 # explicitly specify compiler wrt bug 524340
181 #
182 # need to override KRB5CONFIG for proper flags
183 # https://www.cups.org/str.php?L4423
184 econf \
185 CC="$(tc-getCC)" \
186 CXX="$(tc-getCXX)" \
187 KRB5CONFIG="${EPREFIX}"/usr/bin/${CHOST}-krb5-config \
188 --libdir="${EPREFIX}"/usr/$(get_libdir) \
189 --localstatedir="${EPREFIX}"/var \
190 --with-rundir="${EPREFIX}"/run/cups \
191 --with-cups-user=lp \
192 --with-cups-group=lp \
193 --with-docdir="${EPREFIX}"/usr/share/cups/html \
194 --with-languages="${LINGUAS}" \
195 --with-system-groups=lpadmin \
196 --with-xinetd=/etc/xinetd.d \
197 $(multilib_native_use_enable acl) \
198 $(use_enable dbus) \
199 $(use_enable debug) \
200 $(use_enable debug debug-guards) \
201 $(multilib_native_use_with java) \
202 $(use_enable kerberos gssapi) \
203 $(multilib_native_use_enable pam) \
204 $(multilib_native_use_with python python "${PYTHON}") \
205 $(use_enable static-libs static) \
206 $(use_enable threads) \
207 $(use_enable ssl gnutls) \
208 $(use_enable systemd) \
209 $(multilib_native_use_enable usb libusb) \
210 $(use_enable zeroconf avahi) \
211 --disable-dnssd \
212 --without-perl \
213 --without-php \
214 $(multilib_is_native_abi && echo --enable-libpaper || echo --disable-libpaper) \
215 "${myconf[@]}"
216
217 # install in /usr/libexec always, instead of using /usr/lib/cups, as that
218 # makes more sense when facing multilib support.
219 sed -i -e "s:SERVERBIN.*:SERVERBIN = \"\$\(BUILDROOT\)${EPREFIX}/usr/libexec/cups\":" Makedefs || die
220 sed -i -e "s:#define CUPS_SERVERBIN.*:#define CUPS_SERVERBIN \"${EPREFIX}/usr/libexec/cups\":" config.h || die
221 sed -i -e "s:cups_serverbin=.*:cups_serverbin=\"${EPREFIX}/usr/libexec/cups\":" cups-config || die
222 }
223
224 multilib_src_compile() {
225 if multilib_is_native_abi; then
226 default
227 else
228 emake libs
229 fi
230 }
231
232 multilib_src_test() {
233 multilib_is_native_abi && default
234 }
235
236 multilib_src_install() {
237 if multilib_is_native_abi; then
238 emake BUILDROOT="${D}" install
239 else
240 emake BUILDROOT="${D}" install-libs install-headers
241 dobin cups-config
242 fi
243 }
244
245 multilib_src_install_all() {
246 dodoc {CHANGES,CREDITS,README}.txt
247
248 # move the default config file to docs
249 dodoc "${ED}"/etc/cups/cupsd.conf.default
250 rm -f "${ED}"/etc/cups/cupsd.conf.default
251
252 # clean out cups init scripts
253 rm -rf "${ED}"/etc/{init.d/cups,rc*,pam.d/cups}
254
255 # install our init script
256 local neededservices
257 use zeroconf && neededservices+=" avahi-daemon"
258 use dbus && neededservices+=" dbus"
259 [[ -n ${neededservices} ]] && neededservices="need${neededservices}"
260 cp "${FILESDIR}"/cupsd.init.d-r1 "${T}"/cupsd || die
261 sed -i \
262 -e "s/@neededservices@/$neededservices/" \
263 "${T}"/cupsd || die
264 doinitd "${T}"/cupsd
265
266 # install our pam script
267 pamd_mimic_system cups auth account
268
269 if use xinetd ; then
270 # correct path
271 sed -i \
272 -e "s:server = .*:server = /usr/libexec/cups/daemon/cups-lpd:" \
273 "${ED}"/etc/xinetd.d/cups-lpd || die
274 # it is safer to disable this by default, bug #137130
275 grep -w 'disable' "${ED}"/etc/xinetd.d/cups-lpd || \
276 { sed -i -e "s:}:\tdisable = yes\n}:" "${ED}"/etc/xinetd.d/cups-lpd || die ; }
277 # write permission for file owner (root), bug #296221
278 fperms u+w /etc/xinetd.d/cups-lpd || die "fperms failed"
279 else
280 # always configure with --with-xinetd= and clean up later,
281 # bug #525604
282 rm -rf "${ED}"/etc/xinetd.d
283 fi
284
285 keepdir /usr/libexec/cups/driver /usr/share/cups/{model,profiles} \
286 /var/log/cups /var/spool/cups/tmp
287
288 keepdir /etc/cups/{interfaces,ppd,ssl}
289
290 use X || rm -r "${ED}"/usr/share/applications
291
292 # create /etc/cups/client.conf, bug #196967 and #266678
293 echo "ServerName ${EPREFIX}/run/cups/cups.sock" >> "${ED}"/etc/cups/client.conf
294
295 # the following files are now provided by cups-filters:
296 rm -r "${ED}"/usr/share/cups/banners || die
297 rm -r "${ED}"/usr/share/cups/data/testprint || die
298
299 # the following are created by the init script
300 rm -r "${ED}"/var/cache/cups || die
301 rm -r "${ED}"/run || die
302
303 # for the special case of running lprng and cups together, bug 467226
304 if use lprng-compat ; then
305 rm -fv "${ED}"/usr/bin/{lp*,cancel}
306 rm -fv "${ED}"/usr/sbin/lp*
307 rm -fv "${ED}"/usr/share/man/man1/{lp*,cancel*}
308 rm -fv "${ED}"/usr/share/man/man8/lp*
309 ewarn "Not installing lp... binaries, since the lprng-compat useflag is set."
310 ewarn "Unless you plan to install an exotic server setup, you most likely"
311 ewarn "do not want this. Disable the useflag then and all will be fine."
312 fi
313 }
314
315 pkg_preinst() {
316 gnome2_icon_savelist
317 }
318
319 pkg_postinst() {
320 # Update desktop file database and gtk icon cache (bug 370059)
321 gnome2_icon_cache_update
322 fdo-mime_desktop_database_update
323
324 # not slotted - at most one value
325 if ! [[ "${REPLACING_VERSIONS}" ]]; then
326 echo
327 elog "For information about installing a printer and general cups setup"
328 elog "take a look at: https://wiki.gentoo.org/wiki/Printing"
329 echo
330 fi
331
332 if [[ "${REPLACING_VERSIONS}" ]] && [[ "${REPLACING_VERSIONS}" < "1.6" ]]; then
333 echo
334 elog "CUPS-1.6 no longer supports automatic remote printers or implicit classes"
335 elog "via the CUPS, LDAP, or SLP protocols, i.e. \"network browsing\"."
336 elog "You will have to find printers using zeroconf/avahi instead, enter"
337 elog "the location manually, or run cups-browsed from net-print/cups-filters"
338 elog "which re-adds that functionality as a separate daemon."
339 echo
340 fi
341
342 if [[ "${REPLACING_VERSIONS}" == "1.6.2-r4" ]]; then
343 ewarn
344 ewarn "You are upgrading from the broken version net-print/cups-1.6.2-r4."
345 ewarn "Please rebuild net-print/cups-filters now to make sure everything is OK."
346 ewarn
347 fi
348 }
349
350 pkg_postrm() {
351 # Update desktop file database and gtk icon cache (bug 370059)
352 gnome2_icon_cache_update
353 fdo-mime_desktop_database_update
354 }

  ViewVC Help
Powered by ViewVC 1.1.20