Gentoo Archives: gentoo-commits

From: "Pacho Ramos (pacho)" <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-misc/dhcp: dhcp-4.2.5_p1-r2.ebuild ChangeLog
Date: Thu, 26 Dec 2013 12:58:55
Message-Id: 20131226125850.6A8112004E@flycatcher.gentoo.org
1 pacho 13/12/26 12:58:50
2
3 Modified: ChangeLog
4 Added: dhcp-4.2.5_p1-r2.ebuild
5 Log:
6 Add unit file (#490800)
7
8 (Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key A188FBD4)
9
10 Revision Changes Path
11 1.247 net-misc/dhcp/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/dhcp/ChangeLog?rev=1.247&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/dhcp/ChangeLog?rev=1.247&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/dhcp/ChangeLog?r1=1.246&r2=1.247
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/net-misc/dhcp/ChangeLog,v
20 retrieving revision 1.246
21 retrieving revision 1.247
22 diff -u -r1.246 -r1.247
23 --- ChangeLog 28 Nov 2013 20:30:23 -0000 1.246
24 +++ ChangeLog 26 Dec 2013 12:58:50 -0000 1.247
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.246 2013/11/28 20:30:23 vapier Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/ChangeLog,v 1.247 2013/12/26 12:58:50 pacho Exp $
30 +
31 +*dhcp-4.2.5_p1-r2 (26 Dec 2013)
32 +
33 + 26 Dec 2013; Pacho Ramos <pacho@g.o> +dhcp-4.2.5_p1-r2.ebuild,
34 + +files/dhcpd.tmpfiles, +files/dhcpd4.service, +files/dhcpd6.service,
35 + +files/dhcrelay4.service, +files/dhcrelay4.service.conf,
36 + +files/dhcrelay6.service, +files/dhcrelay6.service.conf:
37 + Add unit file (#490800)
38
39 28 Nov 2013; Mike Frysinger <vapier@g.o> dhcp-4.2.5_p1.ebuild:
40 Mark ia64 stable #488790 by Pacho Ramos.
41
42
43
44 1.1 net-misc/dhcp/dhcp-4.2.5_p1-r2.ebuild
45
46 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/dhcp/dhcp-4.2.5_p1-r2.ebuild?rev=1.1&view=markup
47 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/dhcp/dhcp-4.2.5_p1-r2.ebuild?rev=1.1&content-type=text/plain
48
49 Index: dhcp-4.2.5_p1-r2.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-r2.ebuild,v 1.1 2013/12/26 12:58:50 pacho Exp $
54
55 EAPI="4"
56
57 inherit eutils systemd 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 systemd_newtmpfilesd "${FILESDIR}"/dhcpd.tmpfiles dhcpd.conf
260 systemd_dounit "${FILESDIR}"/dhcpd4.service
261 systemd_dounit "${FILESDIR}"/dhcpd6.service
262 systemd_dounit "${FILESDIR}"/dhcrelay4.service
263 systemd_dounit "${FILESDIR}"/dhcrelay6.service
264 systemd_install_serviced "${FILESDIR}"/dhcrelay4.service.conf
265 systemd_install_serviced "${FILESDIR}"/dhcrelay6.service.conf
266
267 sed -i "s:#@slapd@:$(usex ldap slapd ''):" "${ED}"/etc/init.d/* || die #442560
268 fi
269
270 # the default config files aren't terribly useful #384087
271 local f
272 for f in "${ED}"/etc/dhcp/*.conf.example ; do
273 mv "${f}" "${f%.example}" || die
274 done
275 sed -i '/^[^#]/s:^:#:' "${ED}"/etc/dhcp/*.conf || die
276 }
277
278 pkg_preinst() {
279 enewgroup dhcp
280 enewuser dhcp -1 -1 /var/lib/dhcp dhcp
281
282 # Keep the user files over the sample ones. The
283 # hashing is to ignore the crappy defaults #384087.
284 local f h
285 for f in dhclient:da7c8496a96452190aecf9afceef4510 dhcpd:10979e7b71134bd7f04d2a60bd58f070 ; do
286 h=${f#*:}
287 f="/etc/dhcp/${f%:*}.conf"
288 if [ -e "${EROOT}"${f} ] ; then
289 case $(md5sum "${EROOT}"${f}) in
290 ${h}*) ;;
291 *) cp -p "${EROOT}"${f} "${ED}"${f};;
292 esac
293 fi
294 done
295 }
296
297 pkg_postinst() {
298 if [[ -e "${ROOT}"/etc/init.d/dhcp ]] ; then
299 ewarn
300 ewarn "WARNING: The dhcp init script has been renamed to dhcpd"
301 ewarn "/etc/init.d/dhcp and /etc/conf.d/dhcp need to be removed and"
302 ewarn "and dhcp should be removed from the default runlevel"
303 ewarn
304 fi
305 }