Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-misc/dhcp: dhcp-4.2.5_p1-r1.ebuild ChangeLog
Date: Sat, 28 Sep 2013 11:50:49
Message-Id: 20130928115042.082632004C@flycatcher.gentoo.org
1 vapier 13/09/28 11:50:41
2
3 Modified: ChangeLog
4 Added: dhcp-4.2.5_p1-r1.ebuild
5 Log:
6 Import patch from Fedora for IPv6 interface binding #471142 by Jaak Ristioja. Fix path to iproute2 ip program #480636 by cyberbat.
7
8 (Portage version: 2.2.0/cvs/Linux x86_64, signed Manifest commit with key FB7C4156)
9
10 Revision Changes Path
11 1.244 net-misc/dhcp/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/dhcp/ChangeLog?rev=1.244&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/dhcp/ChangeLog?rev=1.244&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/dhcp/ChangeLog?r1=1.243&r2=1.244
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/net-misc/dhcp/ChangeLog,v
20 retrieving revision 1.243
21 retrieving revision 1.244
22 diff -u -r1.243 -r1.244
23 --- ChangeLog 14 Apr 2013 11:44:39 -0000 1.243
24 +++ ChangeLog 28 Sep 2013 11:50:41 -0000 1.244
25 @@ -1,6 +1,14 @@
26 # ChangeLog for net-misc/dhcp
27 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/ChangeLog,v 1.243 2013/04/14 11:44:39 ago Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/ChangeLog,v 1.244 2013/09/28 11:50:41 vapier Exp $
30 +
31 +*dhcp-4.2.5_p1-r1 (28 Sep 2013)
32 +
33 + 28 Sep 2013; Mike Frysinger <vapier@g.o> +dhcp-4.2.5_p1-r1.ebuild,
34 + +files/dhcp-4.2.5-bindtodevice-inet6.patch,
35 + +files/dhcp-4.2.5-iproute2-path.patch:
36 + Import patch from Fedora for IPv6 interface binding #471142 by Jaak Ristioja.
37 + Fix path to iproute2 ip program #480636 by cyberbat.
38
39 14 Apr 2013; Agostino Sarubbo <ago@g.o> dhcp-4.2.5_p1.ebuild:
40 Stable for sh, wrt bug #463848
41
42
43
44 1.1 net-misc/dhcp/dhcp-4.2.5_p1-r1.ebuild
45
46 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/dhcp/dhcp-4.2.5_p1-r1.ebuild?rev=1.1&view=markup
47 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/dhcp/dhcp-4.2.5_p1-r1.ebuild?rev=1.1&content-type=text/plain
48
49 Index: dhcp-4.2.5_p1-r1.ebuild
50 ===================================================================
51 # Copyright 1999-2013 Gentoo Foundation
52 # Distributed under the terms of the GNU General Public License v2
53 # $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/dhcp-4.2.5_p1-r1.ebuild,v 1.1 2013/09/28 11:50:41 vapier Exp $
54
55 EAPI="4"
56
57 inherit eutils toolchain-funcs user
58
59 MY_PV="${PV//_alpha/a}"
60 MY_PV="${MY_PV//_beta/b}"
61 MY_PV="${MY_PV//_rc/rc}"
62 MY_PV="${MY_PV//_p/-P}"
63 MY_P="${PN}-${MY_PV}"
64 DESCRIPTION="ISC Dynamic Host Configuration Protocol (DHCP) client/server"
65 HOMEPAGE="http://www.isc.org/products/DHCP"
66 SRC_URI="ftp://ftp.isc.org/isc/dhcp/${MY_P}.tar.gz
67 ftp://ftp.isc.org/isc/dhcp/${MY_PV}/${MY_P}.tar.gz"
68
69 LICENSE="ISC BSD SSLeay GPL-2" # GPL-2 only for init script
70 SLOT="0"
71 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
72 IUSE="+client ipv6 kernel_linux ldap selinux +server ssl vim-syntax"
73
74 DEPEND="selinux? ( sec-policy/selinux-dhcp )
75 client? (
76 kernel_linux? (
77 ipv6? ( sys-apps/iproute2 )
78 sys-apps/net-tools
79 )
80 )
81 ldap? (
82 net-nds/openldap
83 ssl? ( dev-libs/openssl )
84 )"
85 RDEPEND="${DEPEND}
86 vim-syntax? ( app-vim/dhcpd-syntax )"
87
88 S="${WORKDIR}/${MY_P}"
89
90 src_unpack() {
91 unpack ${A}
92 # handle local bind hell
93 cd "${S}"/bind
94 unpack ./bind.tar.gz
95 }
96
97 src_prepare() {
98 # Gentoo patches - these will probably never be accepted upstream
99 # Fix some permission issues
100 epatch "${FILESDIR}"/${PN}-3.0-fix-perms.patch
101 # Enable dhclient to equery NTP servers
102 epatch "${FILESDIR}"/${PN}-4.0-dhclient-ntp.patch
103 # resolvconf support in dhclient-script
104 epatch "${FILESDIR}"/${PN}-4.2.2-dhclient-resolvconf.patch
105 # Stop downing the interface on Linux as that breaks link daemons
106 # such as wpa_supplicant and netplug
107 epatch "${FILESDIR}"/${PN}-3.0.3-dhclient-no-down.patch
108 epatch "${FILESDIR}"/${PN}-4.2.0-errwarn-message.patch
109 # Enable dhclient to get extra configuration from stdin
110 epatch "${FILESDIR}"/${PN}-4.2.2-dhclient-stdin-conf.patch
111 epatch "${FILESDIR}"/${PN}-4.2.2-nogateway.patch #265531
112 epatch "${FILESDIR}"/${PN}-4.2.4-quieter-ping.patch #296921
113 epatch "${FILESDIR}"/${PN}-4.2.4-always-accept-4.patch #437108
114 epatch "${FILESDIR}"/${PN}-4.2.5-iproute2-path.patch #480636
115 epatch "${FILESDIR}"/${PN}-4.2.5-bindtodevice-inet6.patch #471142
116
117 # Brand the version with Gentoo
118 sed -i \
119 -e "/VERSION=/s:'$: Gentoo-${PR}':" \
120 configure || die
121
122 # Change the hook script locations of the scripts
123 sed -i \
124 -e 's,/etc/dhclient-exit-hooks,/etc/dhcp/dhclient-exit-hooks,g' \
125 -e 's,/etc/dhclient-enter-hooks,/etc/dhcp/dhclient-enter-hooks,g' \
126 client/scripts/* || die
127
128 # No need for the linux script to force bash #158540
129 sed -i -e 's,#!/bin/bash,#!/bin/sh,' client/scripts/linux || die
130
131 # Quiet the freebsd logger a little
132 sed -i -e '/LOGGER=/ s/-s -p user.notice //g' client/scripts/freebsd || die
133
134 # Remove these options from the sample config
135 sed -i -r \
136 -e "/(script|host-name|domain-name) /d" \
137 client/dhclient.conf.example || die
138
139 if use client && ! use server ; then
140 sed -i -r \
141 -e '/^SUBDIRS/s:\<(dhcpctl|relay|server)\>::g' \
142 Makefile.in || die
143 elif ! use client && use server ; then
144 sed -i -r \
145 -e '/^SUBDIRS/s:\<client\>::' \
146 Makefile.in || die
147 fi
148
149 # Only install different man pages if we don't have en
150 if [[ " ${LINGUAS} " != *" en "* ]]; then
151 # Install Japanese man pages
152 if [[ " ${LINGUAS} " == *" ja "* && -d doc/ja_JP.eucJP ]]; then
153 einfo "Installing Japanese documention"
154 cp doc/ja_JP.eucJP/dhclient* client
155 cp doc/ja_JP.eucJP/dhcp* common
156 fi
157 fi
158 # Now remove the non-english docs so there are no errors later
159 rm -rf doc/ja_JP.eucJP
160
161 # make the bind build work
162 binddir=${S}/bind
163 cd "${binddir}" || die
164 cat <<-EOF > bindvar.tmp
165 binddir=${binddir}
166 GMAKE=${MAKE:-gmake}
167 EOF
168 epatch "${FILESDIR}"/${PN}-4.2.2-bind-disable.patch
169 cd bind-*/
170 epatch "${FILESDIR}"/${PN}-4.2.2-bind-parallel-build.patch #380717
171 epatch "${FILESDIR}"/${PN}-4.2.2-bind-build-flags.patch
172 }
173
174 src_configure() {
175 # bind defaults to stupid `/usr/bin/ar`
176 tc-export AR BUILD_CC
177 export ac_cv_path_AR=${AR}
178
179 # this is tested for by the bind build system, and can cause trouble
180 # when cross-building; since dhcp itself doesn't make use of libcap,
181 # simply disable it.
182 export ac_cv_lib_cap_cap_set_proc=no
183
184 # Use FHS sane paths ... some of these have configure options,
185 # but not all, so just do it all here.
186 local e="/etc/dhcp" r="/var/run/dhcp" l="/var/lib/dhcp"
187 cat <<-EOF >> includes/site.h
188 #define _PATH_DHCPD_CONF "${e}/dhcpd.conf"
189 #define _PATH_DHCLIENT_CONF "${e}/dhclient.conf"
190 #define _PATH_DHCPD_DB "${l}/dhcpd.leases"
191 #define _PATH_DHCPD6_DB "${l}/dhcpd6.leases"
192 #define _PATH_DHCLIENT_DB "${l}/dhclient.leases"
193 #define _PATH_DHCLIENT6_DB "${l}/dhclient6.leases"
194 #define _PATH_DHCPD_PID "${r}/dhcpd.pid"
195 #define _PATH_DHCPD6_PID "${r}/dhcpd6.pid"
196 #define _PATH_DHCLIENT_PID "${r}/dhcpclient.pid"
197 #define _PATH_DHCLIENT6_PID "${r}/dhcpclient6.pid"
198 #define _PATH_DHCRELAY_PID "${r}/dhcrelay.pid"
199 #define _PATH_DHCRELAY6_PID "${r}/dhcrelay6.pid"
200 EOF
201
202 econf \
203 --enable-paranoia \
204 --enable-early-chroot \
205 --sysconfdir=${e} \
206 $(use_enable ipv6 dhcpv6) \
207 $(use_with ldap) \
208 $(use ldap && use_with ssl ldapcrypto || echo --without-ldapcrypto)
209
210 # configure local bind cruft. symtable option requires
211 # perl and we don't want to require that #383837.
212 cd bind/bind-*/ || die
213 eval econf \
214 $(sed -n '/ [.].configure /{s:^[^-]*::;s:>.*::;p}' ../Makefile) \
215 --disable-symtable \
216 --without-make-clean
217 }
218
219 src_compile() {
220 # build local bind cruft first
221 emake -C bind/bind-*/lib/export install
222 # then build standard dhcp code
223 emake AR="$(tc-getAR)"
224 }
225
226 src_install() {
227 default
228
229 dodoc README RELNOTES doc/{api+protocol,IANA-arp-parameters}
230 dohtml doc/References.html
231
232 if [[ -e client/dhclient ]] ; then
233 # move the client to /
234 dodir /sbin
235 mv "${D}"/usr/sbin/dhclient "${D}"/sbin/ || die
236
237 exeinto /sbin
238 if use kernel_linux ; then
239 newexe "${S}"/client/scripts/linux dhclient-script
240 else
241 newexe "${S}"/client/scripts/freebsd dhclient-script
242 fi
243 fi
244
245 if [[ -e server/dhcpd ]] ; then
246 if use ldap ; then
247 insinto /etc/openldap/schema
248 doins contrib/ldap/dhcp.*
249 dosbin contrib/ldap/dhcpd-conf-to-ldap
250 fi
251
252 newinitd "${FILESDIR}"/dhcpd.init5 dhcpd
253 newconfd "${FILESDIR}"/dhcpd.conf2 dhcpd
254 newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay
255 newconfd "${FILESDIR}"/dhcrelay.conf dhcrelay
256 newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay6
257 newconfd "${FILESDIR}"/dhcrelay6.conf dhcrelay6
258
259 sed -i "s:#@slapd@:$(usex ldap slapd ''):" "${ED}"/etc/init.d/* || die #442560
260 fi
261
262 # the default config files aren't terribly useful #384087
263 local f
264 for f in "${ED}"/etc/dhcp/*.conf.example ; do
265 mv "${f}" "${f%.example}" || die
266 done
267 sed -i '/^[^#]/s:^:#:' "${ED}"/etc/dhcp/*.conf || die
268 }
269
270 pkg_preinst() {
271 enewgroup dhcp
272 enewuser dhcp -1 -1 /var/lib/dhcp dhcp
273
274 # Keep the user files over the sample ones. The
275 # hashing is to ignore the crappy defaults #384087.
276 local f h
277 for f in dhclient:da7c8496a96452190aecf9afceef4510 dhcpd:10979e7b71134bd7f04d2a60bd58f070 ; do
278 h=${f#*:}
279 f="/etc/dhcp/${f%:*}.conf"
280 if [ -e "${EROOT}"${f} ] ; then
281 case $(md5sum "${EROOT}"${f}) in
282 ${h}*) ;;
283 *) cp -p "${EROOT}"${f} "${ED}"${f};;
284 esac
285 fi
286 done
287 }
288
289 pkg_postinst() {
290 if [[ -e "${ROOT}"/etc/init.d/dhcp ]] ; then
291 ewarn
292 ewarn "WARNING: The dhcp init script has been renamed to dhcpd"
293 ewarn "/etc/init.d/dhcp and /etc/conf.d/dhcp need to be removed and"
294 ewarn "and dhcp should be removed from the default runlevel"
295 ewarn
296 fi
297 }