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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Tue Oct 26 14:17:43 2004 UTC (15 years, 1 month ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +1 -1 lines
FILE REMOVED
old

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

  ViewVC Help
Powered by ViewVC 1.1.20