Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/avahi/, net-dns/avahi/files/
Date: Thu, 22 Sep 2016 01:19:08
Message-Id: 1474507001.c1abde559a2dd280c67e4c78b39eb35da9a15f93.blueness@gentoo
1 commit: c1abde559a2dd280c67e4c78b39eb35da9a15f93
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 22 01:16:41 2016 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 22 01:16:41 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c1abde55
7
8 net-dns/avahi: update openrc init scripts, bug #594622
9
10 Package-Manager: portage-2.2.28
11
12 net-dns/avahi/avahi-0.6.32-r1.ebuild | 233 +++++++++++++++++++++
13 ...ahi-0.6.32-openrc-0.21.7-fix-init-scripts.patch | 18 ++
14 2 files changed, 251 insertions(+)
15
16 diff --git a/net-dns/avahi/avahi-0.6.32-r1.ebuild b/net-dns/avahi/avahi-0.6.32-r1.ebuild
17 new file mode 100644
18 index 00000000..850c800
19 --- /dev/null
20 +++ b/net-dns/avahi/avahi-0.6.32-r1.ebuild
21 @@ -0,0 +1,233 @@
22 +# Copyright 1999-2016 Gentoo Foundation
23 +# Distributed under the terms of the GNU General Public License v2
24 +# $Id$
25 +
26 +EAPI="5"
27 +
28 +PYTHON_COMPAT=( python2_7 )
29 +PYTHON_REQ_USE="gdbm"
30 +
31 +WANT_AUTOMAKE=1.11
32 +
33 +inherit autotools eutils flag-o-matic multilib multilib-minimal mono-env python-r1 systemd user
34 +
35 +DESCRIPTION="System which facilitates service discovery on a local network"
36 +HOMEPAGE="http://avahi.org/"
37 +SRC_URI="https://github.com/lathiat/avahi/archive/v${PV}.tar.gz -> ${P}.tar.gz"
38 +
39 +S="${WORKDIR}/${P}"
40 +
41 +LICENSE="LGPL-2.1"
42 +SLOT="0"
43 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86"
44 +IUSE="autoipd bookmarks dbus doc gdbm gtk gtk3 howl-compat +introspection ipv6 kernel_linux mdnsresponder-compat mono nls python qt4 selinux test utils"
45 +
46 +REQUIRED_USE="
47 + utils? ( || ( gtk gtk3 ) )
48 + python? ( dbus gdbm )
49 + mono? ( dbus )
50 + howl-compat? ( dbus )
51 + mdnsresponder-compat? ( dbus )
52 +"
53 +
54 +COMMON_DEPEND="
55 + dev-libs/libdaemon
56 + dev-libs/expat
57 + dev-libs/glib:2[${MULTILIB_USEDEP}]
58 + gdbm? ( sys-libs/gdbm[${MULTILIB_USEDEP}] )
59 + qt4? ( dev-qt/qtcore:4[${MULTILIB_USEDEP}] )
60 + gtk? ( x11-libs/gtk+:2[${MULTILIB_USEDEP}] )
61 + gtk3? ( x11-libs/gtk+:3[${MULTILIB_USEDEP}] )
62 + dbus? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
63 + kernel_linux? ( sys-libs/libcap )
64 + introspection? ( dev-libs/gobject-introspection:= )
65 + mono? (
66 + dev-lang/mono
67 + gtk? ( dev-dotnet/gtk-sharp )
68 + )
69 + python? (
70 + ${PYTHON_DEPS}
71 + gtk? ( dev-python/pygtk )
72 + dbus? ( dev-python/dbus-python )
73 + )
74 + bookmarks? (
75 + dev-python/twisted-core
76 + dev-python/twisted-web
77 + )
78 +"
79 +
80 +DEPEND="
81 + ${COMMON_DEPEND}
82 + doc? ( app-doc/doxygen )
83 + app-doc/xmltoman
84 + dev-util/intltool
85 + virtual/pkgconfig[${MULTILIB_USEDEP}]
86 +"
87 +
88 +RDEPEND="
89 + ${COMMON_DEPEND}
90 + howl-compat? ( !net-misc/howl )
91 + mdnsresponder-compat? ( !net-misc/mDNSResponder )
92 + selinux? ( sec-policy/selinux-avahi )
93 +"
94 +
95 +pkg_preinst() {
96 + enewgroup netdev
97 + enewgroup avahi
98 + enewuser avahi -1 -1 -1 avahi
99 +
100 + if use autoipd; then
101 + enewgroup avahi-autoipd
102 + enewuser avahi-autoipd -1 -1 -1 avahi-autoipd
103 + fi
104 +}
105 +
106 +pkg_setup() {
107 + use mono && mono-env_pkg_setup
108 +}
109 +
110 +src_prepare() {
111 + if ! use ipv6; then
112 + sed -i \
113 + -e s/use-ipv6=yes/use-ipv6=no/ \
114 + avahi-daemon/avahi-daemon.conf || die
115 + fi
116 +
117 + sed -i\
118 + -e "s:\\.\\./\\.\\./\\.\\./doc/avahi-docs/html/:../../../doc/${PF}/html/:" \
119 + doxygen_to_devhelp.xsl || die
120 +
121 + # Make gtk utils optional
122 + # https://github.com/lathiat/avahi/issues/24
123 + epatch "${FILESDIR}"/${PN}-0.6.30-optional-gtk-utils.patch
124 +
125 + # Don't install avahi-discover unless ENABLE_GTK_UTILS, bug #359575
126 + # https://github.com/lathiat/avahi/issues/24
127 + epatch "${FILESDIR}"/${PN}-0.6.31-fix-install-avahi-discover.patch
128 +
129 + # Fix build under various locales, bug #501664
130 + # https://github.com/lathiat/avahi/issues/27
131 + epatch "${FILESDIR}"/${PN}-0.6.31-fix-locale-build.patch
132 +
133 + # Update the init scripts for the new openrc, bug #594622
134 + epatch "${FILESDIR}"/${PN}-0.6.32-openrc-0.21.7-fix-init-scripts.patch
135 +
136 + # Bug #525832
137 + epatch_user
138 +
139 + # Prevent .pyc files in DESTDIR
140 + >py-compile
141 +
142 + eautoreconf
143 +
144 + # bundled manpages
145 + multilib_copy_sources
146 +}
147 +
148 +src_configure() {
149 + # those steps should be done once-per-ebuild rather than per-ABI
150 + use sh && replace-flags -O? -O0
151 + use python && python_export_best
152 +
153 + # We need to unset DISPLAY, else the configure script might have problems detecting the pygtk module
154 + unset DISPLAY
155 +
156 + multilib-minimal_src_configure
157 +}
158 +
159 +multilib_src_configure() {
160 + local myconf=( --disable-static )
161 +
162 + if use python; then
163 + myconf+=(
164 + $(multilib_native_use_enable dbus python-dbus)
165 + $(multilib_native_use_enable gtk pygtk)
166 + )
167 + fi
168 +
169 + if use mono; then
170 + myconf+=( $(multilib_native_use_enable doc monodoc) )
171 + fi
172 +
173 + if ! multilib_is_native_abi; then
174 + myconf+=(
175 + # used by daemons only
176 + --disable-libdaemon
177 + --with-xml=none
178 + )
179 + fi
180 +
181 + econf \
182 + --localstatedir="${EPREFIX}/var" \
183 + --with-distro=gentoo \
184 + --disable-python-dbus \
185 + --disable-pygtk \
186 + --enable-manpages \
187 + --enable-xmltoman \
188 + --disable-monodoc \
189 + --enable-glib \
190 + --enable-gobject \
191 + $(multilib_native_use_enable test tests) \
192 + $(multilib_native_use_enable autoipd) \
193 + $(use_enable mdnsresponder-compat compat-libdns_sd) \
194 + $(use_enable howl-compat compat-howl) \
195 + $(multilib_native_use_enable doc doxygen-doc) \
196 + $(multilib_native_use_enable mono) \
197 + $(use_enable dbus) \
198 + $(multilib_native_use_enable python) \
199 + $(use_enable gtk) \
200 + $(use_enable gtk3) \
201 + $(use_enable nls) \
202 + $(multilib_native_use_enable introspection) \
203 + $(multilib_native_use_enable utils gtk-utils) \
204 + --disable-qt3 \
205 + $(use_enable qt4) \
206 + $(use_enable gdbm) \
207 + $(systemd_with_unitdir) \
208 + "${myconf[@]}"
209 +}
210 +
211 +multilib_src_compile() {
212 + emake
213 +
214 + multilib_is_native_abi && use doc && emake avahi.devhelp
215 +}
216 +
217 +multilib_src_install() {
218 + emake install DESTDIR="${D}"
219 + use bookmarks && use python && use dbus && use gtk || \
220 + rm -f "${ED}"/usr/bin/avahi-bookmarks
221 +
222 + # https://github.com/lathiat/avahi/issues/28
223 + use howl-compat && dosym avahi-compat-howl.pc /usr/$(get_libdir)/pkgconfig/howl.pc
224 + use mdnsresponder-compat && dosym avahi-compat-libdns_sd/dns_sd.h /usr/include/dns_sd.h
225 +
226 + if multilib_is_native_abi && use doc; then
227 + dohtml -r doxygen/html/. || die
228 + insinto /usr/share/devhelp/books/avahi
229 + doins avahi.devhelp || die
230 + fi
231 +}
232 +
233 +multilib_src_install_all() {
234 + if use autoipd; then
235 + insinto /$(get_libdir)/rcscripts/net
236 + doins "${FILESDIR}"/autoipd.sh
237 +
238 + insinto /$(get_libdir)/netifrc/net
239 + newins "${FILESDIR}"/autoipd-openrc.sh autoipd.sh
240 + fi
241 +
242 + dodoc docs/{AUTHORS,NEWS,README,TODO}
243 +
244 + prune_libtool_files --all
245 +}
246 +
247 +pkg_postinst() {
248 + if use autoipd; then
249 + elog
250 + elog "To use avahi-autoipd to configure your interfaces with IPv4LL (RFC3927)"
251 + elog "addresses, just set config_<interface>=( autoipd ) in /etc/conf.d/net!"
252 + elog
253 + fi
254 +}
255
256 diff --git a/net-dns/avahi/files/avahi-0.6.32-openrc-0.21.7-fix-init-scripts.patch b/net-dns/avahi/files/avahi-0.6.32-openrc-0.21.7-fix-init-scripts.patch
257 new file mode 100644
258 index 00000000..2b91179
259 --- /dev/null
260 +++ b/net-dns/avahi/files/avahi-0.6.32-openrc-0.21.7-fix-init-scripts.patch
261 @@ -0,0 +1,18 @@
262 +diff -Naur avahi-0.6.32.orig/initscript/gentoo/avahi-daemon.in avahi-0.6.32/initscript/gentoo/avahi-daemon.in
263 +--- avahi-0.6.32.orig/initscript/gentoo/avahi-daemon.in 2016-02-15 21:13:45.000000000 -0500
264 ++++ avahi-0.6.32/initscript/gentoo/avahi-daemon.in 2016-09-21 20:58:01.999109439 -0400
265 +@@ -1,4 +1,4 @@
266 +-#!/sbin/runscript
267 ++#!/sbin/openrc-run
268 + # Copyright 1999-2007 Gentoo Foundation
269 + # Distributed under the terms of the GNU General Public License v2
270 +
271 +diff -Naur avahi-0.6.32.orig/initscript/gentoo/avahi-dnsconfd.in avahi-0.6.32/initscript/gentoo/avahi-dnsconfd.in
272 +--- avahi-0.6.32.orig/initscript/gentoo/avahi-dnsconfd.in 2016-02-15 21:13:45.000000000 -0500
273 ++++ avahi-0.6.32/initscript/gentoo/avahi-dnsconfd.in 2016-09-21 20:58:12.683109618 -0400
274 +@@ -1,4 +1,4 @@
275 +-#!/sbin/runscript
276 ++#!/sbin/openrc-run
277 + # Copyright 1999-2007 Gentoo Foundation
278 + # Distributed under the terms of the GNU General Public License v2
279 +