Gentoo Archives: gentoo-commits

From: "Tony Vroon (chainsaw)" <chainsaw@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-misc/dhcp: ChangeLog dhcp-3.1.1.ebuild
Date: Fri, 27 Jun 2008 10:10:56
Message-Id: E1KCAuo-00066L-Ls@stork.gentoo.org
1 chainsaw 08/06/27 10:10:50
2
3 Modified: ChangeLog
4 Added: dhcp-3.1.1.ebuild
5 Log:
6 Version bump for bug #227135.
7 (Portage version: 2.2_rc1/cvs/Linux 2.6.26-rc7-00051-g62786b9-dirty x86_64)
8
9 Revision Changes Path
10 1.143 net-misc/dhcp/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/dhcp/ChangeLog?rev=1.143&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/dhcp/ChangeLog?rev=1.143&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/dhcp/ChangeLog?r1=1.142&r2=1.143
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/net-misc/dhcp/ChangeLog,v
19 retrieving revision 1.142
20 retrieving revision 1.143
21 diff -u -r1.142 -r1.143
22 --- ChangeLog 29 Mar 2008 19:47:53 -0000 1.142
23 +++ ChangeLog 27 Jun 2008 10:10:50 -0000 1.143
24 @@ -1,6 +1,11 @@
25 # ChangeLog for net-misc/dhcp
26 # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/ChangeLog,v 1.142 2008/03/29 19:47:53 vapier Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/ChangeLog,v 1.143 2008/06/27 10:10:50 chainsaw Exp $
29 +
30 +*dhcp-3.1.1 (27 Jun 2008)
31 +
32 + 27 Jun 2008; <chainsaw@g.o> +dhcp-3.1.1.ebuild:
33 + Version bump for bug #227135.
34
35 29 Mar 2008; Mike Frysinger <vapier@g.o>
36 files/dhcp-3.0.3-dhclient-ntp.patch,
37
38
39
40 1.1 net-misc/dhcp/dhcp-3.1.1.ebuild
41
42 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/dhcp/dhcp-3.1.1.ebuild?rev=1.1&view=markup
43 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/dhcp/dhcp-3.1.1.ebuild?rev=1.1&content-type=text/plain
44
45 Index: dhcp-3.1.1.ebuild
46 ===================================================================
47 # Copyright 1999-2008 Gentoo Foundation
48 # Distributed under the terms of the GNU General Public License v2
49 # $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/dhcp-3.1.1.ebuild,v 1.1 2008/06/27 10:10:50 chainsaw Exp $
50
51 inherit eutils flag-o-matic multilib toolchain-funcs
52
53 MY_PV="${PV//_alpha/a}"
54 MY_PV="${MY_PV//_beta/b}"
55 MY_PV="${MY_PV//_rc/rc}"
56 MY_P="${PN}-${MY_PV}"
57 DESCRIPTION="ISC Dynamic Host Configuration Protocol"
58 HOMEPAGE="http://www.isc.org/products/DHCP"
59 SRC_URI="ftp://ftp.isc.org/isc/dhcp/${MY_P}.tar.gz"
60
61 LICENSE="isc-dhcp"
62 SLOT="0"
63 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
64 IUSE="doc minimal static selinux kernel_linux"
65
66 DEPEND="selinux? ( sec-policy/selinux-dhcp )
67 kernel_linux? ( sys-apps/net-tools )"
68
69 PROVIDE="virtual/dhcpc"
70
71 S="${WORKDIR}/${MY_P}"
72
73 src_unpack() {
74 unpack ${A}
75 cd "${S}"
76
77 # Gentoo patches - these will probably never be accepted upstream
78 # Enable chroot support
79 epatch "${FILESDIR}/${PN}"-3.0-paranoia.patch
80 # Fix some permission issues
81 epatch "${FILESDIR}/${PN}"-3.0-fix-perms.patch
82 # Enable dhclient to equery NTP servers
83 epatch "${FILESDIR}/${PN}"-3.0.3-dhclient-ntp.patch
84 # resolvconf support in dhclient-script
85 epatch "${FILESDIR}/${PN}"-3.1.0a1-dhclient-resolvconf.patch
86 # Fix setting hostnames on Linux
87 epatch "${FILESDIR}/${PN}"-3.0.3-dhclient-hostname.patch
88 # Allow mtu settings
89 epatch "${FILESDIR}/${PN}"-3.0.3-dhclient-mtu.patch
90 # Allow dhclient to use IF_METRIC to set route metrics
91 epatch "${FILESDIR}/${PN}"-3.0.3-dhclient-metric.patch
92 # Stop downing the interface on Linux as that breaks link dameons
93 # such as wpa_supplicant and netplug
94 epatch "${FILESDIR}/${PN}"-3.0.3-dhclient-no-down.patch
95 # Quiet the isc blurb
96 epatch "${FILESDIR}/${PN}"-3.0.3-no_isc_blurb.patch
97 # Enable dhclient to get extra configuration from stdin
98 epatch "${FILESDIR}/${PN}"-3.0.4-dhclient-stdin-conf.patch
99 # Disable fallback interfaces when using BPF
100 # This allows more than one dhclient instance on the BSD's
101 epatch "${FILESDIR}/${PN}"-3.0.5-bpf-nofallback.patch
102
103 # General fixes which will probably be accepted upstream eventually
104 # Install libdst, #75544
105 epatch "${FILESDIR}/${PN}"-3.0.3-libdst.patch
106 # Fix building on Gentoo/FreeBSD
107 epatch "${FILESDIR}/${PN}"-3.0.2-gmake.patch
108
109 # NetworkManager support patches
110 # If they fail to apply to future versions they will be dropped
111 # Add dbus support to dhclient
112 epatch "${FILESDIR}/${PN}"-3.0.3-dhclient-dbus.patch
113
114 # Brand the version with Gentoo
115 # include revision if >0
116 local newver="${MY_PV}-Gentoo"
117 [[ ${PR} != "r0" ]] && newver="${newver}-${PR}"
118 sed -i '/^#define DHCP_VERSION[ \t]\+/ s/'"${MY_PV}/${newver}/g" \
119 includes/version.h || die
120
121 # Change the hook script locations of the scripts
122 sed -i -e 's,/etc/dhclient-exit-hooks,/etc/dhcp/dhclient-exit-hooks,g' \
123 -e 's,/etc/dhclient-enter-hooks,/etc/dhcp/dhclient-enter-hooks,g' \
124 client/scripts/* || die
125
126 # No need for the linux script to force bash, #158540.
127 sed -i -e 's,#!/bin/bash,#!/bin/sh,' client/scripts/linux || die
128
129 # Quiet the freebsd logger a little
130 sed -i -e '/LOGGER=/ s/-s -p user.notice //g' client/scripts/freebsd || die
131
132 # Remove these options from the sample config
133 sed -i -e "/\(script\|host-name\|domain-name\) / d" \
134 client/dhclient.conf || die
135
136 # Build sed man pages as we don't ever support BSD 4.4 and older, #130251.
137 local x=
138 for x in Makefile.dist $(ls */Makefile.dist) ; do
139 sed -i -e 's/$(CATMANPAGES)/$(SEDMANPAGES)/g' "${x}" || die
140 done
141
142 # Only install different man pages if we don't have en
143 if [[ " ${LINGUAS} " != *" en "* ]]; then
144 # Install Japanese man pages
145 if [[ " ${LINGUAS} " == *" ja "* && -d doc/ja_JP.eucJP ]]; then
146 einfo "Installing Japanese documention"
147 cp doc/ja_JP.eucJP/dhclient* client
148 cp doc/ja_JP.eucJP/dhcp* common
149 fi
150 fi
151
152 # Now remove the non-english docs so there are no errors later
153 [[ -d doc/ja_JP.eucJP ]] && rm -rf doc/ja_JP.eucJP
154 }
155
156 src_compile() {
157 use static && append-ldflags -static
158
159 cat <<-END >> includes/site.h
160 #define _PATH_DHCPD_CONF "/etc/dhcp/dhcpd.conf"
161 #define _PATH_DHCPD_PID "/var/run/dhcp/dhcpd.pid"
162 #define _PATH_DHCPD_DB "/var/lib/dhcp/dhcpd.leases"
163 #define _PATH_DHCLIENT_CONF "/etc/dhcp/dhclient.conf"
164 #define _PATH_DHCLIENT_DB "/var/lib/dhcp/dhclient.leases"
165 #define _PATH_DHCLIENT_PID "/var/run/dhcp/dhclient.pid"
166 #define DHCPD_LOG_FACILITY LOG_LOCAL1
167 END
168
169 cat <<-END > site.conf
170 CC = $(tc-getCC)
171 LFLAGS = ${LDFLAGS}
172 LIBDIR = /usr/$(get_libdir)
173 INCDIR = /usr/include
174 ETC = /etc/dhcp
175 VARDB = /var/lib/dhcp
176 VARRUN = /var/run/dhcp
177 ADMMANDIR = /usr/share/man/man8
178 ADMMANEXT = .8
179 FFMANDIR = /usr/share/man/man5
180 FFMANEXT = .5
181 LIBMANDIR = /usr/share/man/man3
182 LIBMANEXT = .3
183 USRMANDIR = /usr/share/man/man1
184 USRMANEXT = .1
185 MANCAT = man
186 END
187
188 ./configure --copts "-DPARANOIA -DEARLY_CHROOT ${CFLAGS}" \
189 || die "configure failed"
190
191 # Remove server support from the Makefile
192 # We still install some extra crud though
193 if use minimal ; then
194 sed -i -e 's/\(server\|relay\|dhcpctl\)/ /g' work.*/Makefile || die
195 fi
196 emake || die "compile problem"
197 }
198
199 src_install() {
200 make install DESTDIR="${D}" || die
201 use doc && dodoc README RELNOTES doc/*
202
203 insinto /etc/dhcp
204 newins client/dhclient.conf dhclient.conf.sample
205 keepdir /var/{lib,run}/dhcp
206
207 # Install our server files
208 if ! use minimal ; then
209 insinto /etc/dhcp
210 newins server/dhcpd.conf dhcpd.conf.sample
211 newinitd "${FILESDIR}"/dhcpd.init dhcpd
212 newinitd "${FILESDIR}"/dhcrelay.init dhcrelay
213 newconfd "${FILESDIR}"/dhcpd.conf dhcpd
214 newconfd "${FILESDIR}"/dhcrelay.conf dhcrelay
215
216 # We never want portage to own this file
217 rm -f "${D}"/var/lib/dhcp/dhcpd.leases
218 fi
219 }
220
221 pkg_preinst() {
222 if ! use minimal ; then
223 enewgroup dhcp
224 enewuser dhcp -1 -1 /var/lib/dhcp dhcp
225 fi
226 }
227
228 pkg_postinst() {
229 use minimal && return
230
231 chown dhcp:dhcp "${ROOT}"/var/{lib,run}/dhcp
232
233 if [[ -e "${ROOT}"/etc/init.d/dhcp ]] ; then
234 ewarn
235 ewarn "WARNING: The dhcp init script has been renamed to dhcpd"
236 ewarn "/etc/init.d/dhcp and /etc/conf.d/dhcp need to be removed and"
237 ewarn "and dhcp should be removed from the default runlevel"
238 ewarn
239 fi
240
241 einfo "You can edit /etc/conf.d/dhcpd to customize dhcp settings."
242 einfo
243 einfo "If you would like to run dhcpd in a chroot, simply configure the"
244 einfo "DHCPD_CHROOT directory in /etc/conf.d/dhcpd and then run:"
245 einfo " emerge --config =${PF}"
246 }
247
248 pkg_config() {
249 if use minimal ; then
250 eerror "${PN} has not been compiled for server support"
251 eerror "emerge ${PN} without the minimal USE flag to use dhcp sever"
252 return 1
253 fi
254
255 local CHROOT="$(
256 sed -n -e 's/^[[:blank:]]\?DHCPD_CHROOT="*\([^#"]\+\)"*/\1/p' \
257 "${ROOT}"/etc/conf.d/dhcpd
258 )"
259
260 if [[ -z ${CHROOT} ]]; then
261 eerror "CHROOT not defined in /etc/conf.d/dhcpd"
262 return 1
263 fi
264
265 CHROOT="${ROOT}/${CHROOT}"
266
267 if [[ -d ${CHROOT} ]] ; then
268 ewarn "${CHROOT} already exists - aborting"
269 return 0
270 fi
271
272 ebegin "Setting up the chroot directory"
273 mkdir -m 0755 -p "${CHROOT}/"{dev,etc,var/lib,var/run/dhcp}
274 cp /etc/{localtime,resolv.conf} "${CHROOT}"/etc
275 cp -R /etc/dhcp "${CHROOT}"/etc
276 cp -R /var/lib/dhcp "${CHROOT}"/var/lib
277 ln -s ../../var/lib/dhcp "${CHROOT}"/etc/dhcp/lib
278 chown -R dhcp:dhcp "${CHROOT}"/var/{lib,run}/dhcp
279 eend 0
280
281 local logger="$(best_version virtual/logger)"
282 einfo "To enable logging from the dhcpd server, configure your"
283 einfo "logger (${logger}) to listen on ${CHROOT}/dev/log"
284 }
285
286
287
288 --
289 gentoo-commits@l.g.o mailing list