Portfile

# $Id: Portfile 20612 2006-11-09 01:28:17Z markd@macports.org $

PortSystem 1.0
name dhcp
version 3.0.5
categories net
description ISC dhcpd server
long_description ISC's Dynamic Host Configuration Protocol Distribution \
reference implementation of all aspects of the DHCP \
protocol, through a suite of DHCP tools: A DHCP \
server, client, and relay agent. These tools all \
use a modular API which is designed to be sufficently \
general that can easily be made to work on POSIX- \
compliant operating systems and also non-POSIX \
systems like Windows NT and MacOS.\
The DHCP server, client and relay agent are provided \
both as reference implementations of the protocol \
and as working, fully-features sample implementations.\
Both the client and the server provide functionality \
that, while not strictly required by the protocol, \
is very useful in practice. The DHCP server also \
makes allowance for non-compliant clients which \
one might still like to support.
homepage http://www.isc.org/products/DHCP/
platforms darwin
maintainers nomaintainer@macports.org
master_sites isc ftp://ftp.isc.org/isc/dhcp/dhcp-3.0-history/
checksums md5 ce5d30d4645e4eab1f54561b487d1ec7

post-patch {
file copy -force ${filespath}/site.conf ${worksrcpath}
reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/site.conf
}

configure.pre_args

startupitem.create yes
startupitem.name dhcpd
startupitem.init "PID=/var/run/dhcpd.pid"
startupitem.start "\[ -x ${prefix}/sbin/dhcpd \] && ${prefix}/sbin/dhcpd -cf ${prefix}/etc/dhcp/dhcpd.conf -lf ${prefix}/var/db/dhcpd/dhcpd.leases"
startupitem.stop "\[ -r \${PID} \] && kill \$(cat \${PID})"

destroot.keepdirs ${destroot}${prefix}/var/db/dhcpd
post-destroot {
set etc ${destroot}${prefix}/etc/dhcp
xinstall -m 755 -d ${etc}
xinstall -m 644 ${worksrcpath}/server/dhcpd.conf ${etc}/dhcpd.conf.sample
xinstall -m 644 ${worksrcpath}/client/dhclient.conf \
${etc}/dhclient.conf.sample
}

platform darwin 8 { build.args CC=/usr/bin/gcc-4.0 }

post-activate {
ui_msg "\n

NOTE:

-The dhcpd .conf and .leases files must be named and located as shown for dhcpd to find them:
${prefix}/etc/dhcp/dhcpd.conf (there is a sample file)
${prefix}/var/db/dhcpd/dhcpd.leases (use the touch command to create a blank one)

\n"
}

files