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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20