/[gentoo-x86]/net-misc/dhcp/dhcp-3.0_p2-r2.ebuild
Gentoo

Contents of /net-misc/dhcp/dhcp-3.0_p2-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (show annotations) (download)
Mon Mar 8 23:45:35 2004 UTC (15 years, 9 months ago) by seemant
Branch: MAIN
CVS Tags: HEAD
Changes since 1.11: +1 -1 lines
FILE REMOVED
Forced a version bump on these ebuilds.  Basically -r0 is now -r4, -r2 is now -r5 and -r3 is now -r6.  The reason for the revision bump was to make this package PROVIDE virtual/dhcp.  Closes a long-standing bloat-reduction request made on gentoo-dev mailing list by:  William Hubbs <kc5eiv@kc5eiv.homeip.net> at http://article.gmane.org/gmane.linux.gentoo.devel/11579

1 # Copyright 1999-2004 Gentoo Technologies, Inc.
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /home/cvsroot/gentoo-x86/net-misc/dhcp/dhcp-3.0_p2-r2.ebuild,v 1.11 2004/03/08 23:02:24 darkspecter Exp $
4
5 inherit eutils flag-o-matic
6
7 DESCRIPTION="ISC Dynamic Host Configuration Protocol."
8 HOMEPAGE="http://www.isc.org/products/DHCP"
9 SRC_URI="ftp://ftp.isc.org/isc/dhcp/${P/_p/pl}.tar.gz
10 http://www.episec.com/people/edelkind/patches/dhcp/dhcp-3.0+paranoia.patch"
11
12 LICENSE="isc-dhcp"
13 SLOT="0"
14 KEYWORDS="x86 ppc sparc ~mips ppc64 hppa"
15 IUSE="static"
16
17 DEPEND="virtual/glibc
18 >=sys-apps/sed-4"
19
20 S="${WORKDIR}/${P/_p/pl}"
21
22 src_unpack() {
23 unpack ${A} && cd "${S}"
24 epatch "${FILESDIR}/dhcp-3.0pl2-user-option-fix.patch"
25 epatch "${FILESDIR}/dhclient.c-3.0-dw-cli-fix.patch"
26 epatch "${DISTDIR}/dhcp-3.0+paranoia.patch"
27 }
28
29 src_compile() {
30 # 01/Mar/2003: Fix for bug #11960 by Jason Wever <weeve@gentoo.org>
31 if [ "${ARCH}" = "sparc" ] ; then
32 filter-flags "-O3"
33 filter-flags "-O2"
34 filter-flags "-O"
35 fi
36
37 use static && append-flags -static
38
39 cat <<-END >> includes/site.h
40 #define _PATH_DHCPD_CONF "/etc/dhcp/dhcpd.conf"
41 #define _PATH_DHCPD_PID "/var/run/dhcp/dhcpd.pid"
42 #define _PATH_DHCPD_DB "/var/lib/dhcp/dhcpd.leases"
43 #define _PATH_DHCLIENT_DB "/var/lib/dhcp/dhclient.leases"
44 #define DHCPD_LOG_FACILITY LOG_LOCAL1
45 END
46
47 cat <<-END > site.conf
48 CC = gcc
49 LIBDIR = /usr/lib
50 INCDIR = /usr/include
51 ETC = /etc/dhcp
52 VARDB = /var/lib/dhcp
53 VARRUN = /var/run/dhcp
54 ADMMANDIR = /usr/share/man/man8
55 FFMANDIR = /usr/share/man/man5
56 LIBMANDIR = /usr/share/man/man3
57 USRMANDIR = /usr/share/man/man1
58 END
59
60 ./configure --with-nsupdate \
61 --copts "-DPARANOIA -DEARLY_CHROOT ${CFLAGS}" || die "configure failed"
62
63 emake || die "compile problem"
64 }
65
66 src_install() {
67 enewgroup dhcp
68 enewuser dhcp -1 /bin/false /var/lib/dhcp dhcp
69
70 einstall DESTDIR="${D}"
71
72 insinto /etc/dhcp
73 newins server/dhcpd.conf dhcpd.conf.sample
74 newins client/dhclient.conf dhclient.conf.sample
75 dosed "s:/etc/dhclient-script:/etc/dhcp/dhclient-script:" \
76 /etc/dhcp/dhclient.conf.sample
77 mv "${D}/sbin/dhclient-script" "${D}/etc/dhcp/dhclient-script.sample"
78
79 dodoc ANONCVS CHANGES COPYRIGHT README RELNOTES doc/*
80 newdoc client/dhclient.conf dhclient.conf.sample
81 newdoc client/scripts/linux dhclient-script.sample
82 newdoc server/dhcpd.conf dhcpd.conf.sample
83
84 insinto /etc/conf.d
85 newins "${FILESDIR}/dhcp.conf" dhcp
86 exeinto /etc/init.d
87 newexe "${FILESDIR}/dhcp.rc6" dhcp
88
89 keepdir /var/{lib,run}/dhcp
90 }
91
92 pkg_postinst() {
93 chown dhcp:dhcp "${ROOT}/var/lib/dhcp" "${ROOT}/var/run/dhcp"
94
95 einfo "You can edit /etc/conf.d/dhcp to customize dhcp settings"
96 einfo
97 einfo "The DHCP ebuild now includes chroot support."
98 einfo "If you like to run dhcpd in chroot AND this is a new install OR"
99 einfo "your dhcpd doesn't already run in chroot, simply run:"
100 einfo " ebuild /var/db/pkg/${CATEGORY}/${PF}/${PF}.ebuild config"
101 einfo "Before running the above command you might want to change the chroot"
102 einfo "dir in /etc/conf.d/dhcp, otherwise /chroot/dhcp will be used."
103 echo
104 }
105
106 pkg_config() {
107 CHROOT=`sed -n 's/^[[:blank:]]\?CHROOT="\([^"]\+\)"/\1/p' /etc/conf.d/dhcp 2>/dev/null`
108
109 if [ ! -d "${CHROOT:=/chroot/dhcp}" ] ; then
110 ebegin "Setting up the chroot directory"
111 mkdir -m 0755 -p "${CHROOT}/"{dev,etc,var/lib,var/run}
112 cp -R /etc/dhcp "${CHROOT}/etc/"
113 cp -R /var/lib/dhcp "${CHROOT}/var/lib"
114 chown -R dhcp:dhcp "${CHROOT}/var/lib" "${CHROOT}/var/run"
115 eend
116
117 if [ "`grep '^#[[:blank:]]\?CHROOT' /etc/conf.d/dhcp`" ] ; then
118 sed -e '/^#[[:blank:]]\?CHROOT/s/^#[[:blank:]]\?//' -i /etc/conf.d/dhcp
119 fi
120
121 einfo "To enable logging from the DHCP server, configure your"
122 einfo "logger (`best_version virtual/logger`) to listen on ${CHROOT}/dev/log"
123 else
124 eerror
125 eerror "${CHROOT} already exists. Quitting."
126 eerror
127 fi
128 }

  ViewVC Help
Powered by ViewVC 1.1.20