Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
2b1404a5
Commit
2b1404a5
authored
Nov 21, 2012
by
Mike Hibler
Browse files
Remove old dhcp30 port, we only need one old dhcp client!
parent
a1529d8e
Changes
28
Hide whitespace changes
Inline
Side-by-side
install/ports/emulab-dhcp30-client/Makefile
deleted
100644 → 0
View file @
a1529d8e
#
# XXX hacked up Emulab version of isc-dhcp30-server/Makefile to be standalone
# for dhcp30-client. We have no local mods to this version of dhcp, we just
# need a dhclient program that works on multiple interfaces at once, hence we
# keep this version alive.
# From:
#
# ex:ts=8
# Ports collection makefile for: dhcp
# Date created: 7 Mar 1996
# Whom: se
#
# $FreeBSD: ports/net/isc-dhcp30-server/Makefile,v 1.135 2009/07/22 00:11:47 jpaetzel Exp $
#
PORTNAME
=
dhcp
PORTVERSION
=
3.0.7
PORTREVISION
=
${DHCP_PORTREVISION}
CATEGORIES
=
misc net
MASTER_SITES
=
${MASTER_SITE_ISC}
MASTER_SITE_SUBDIR
=
dhcp dhcp/dhcp-3.0-history
PKGNAMEPREFIX
=
isc-
PKGNAMESUFFIX
=
30-client
DISTNAME
=
${PORTNAME}
-
${RELEASE}${VERSION}${PATCHLEVEL}
MAINTAINER
=
jpaetzel@FreeBSD.org
COMMENT
?=
The ISC Dynamic Host Configuration Protocol server
PORTREVISION_SERVER
=
5
PORTREVISION_CLIENT
=
1
PORTREVISION_RELAY
=
0
PORTREVISION_DEVEL
=
0
UNIQUENAME
=
${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}
# PORTREVISION handling
DHCP_PORTREVISION
=
${PORTREVISION_CLIENT}
.
include
<bsd.port.pre.mk>
# Global variables
#
HAS_CONFIGURE
=
yes
CONFIGURE_ARGS
=
--subsys
client
ALL_TARGET
=
all.client
INSTALL_TARGET
=
install.client
SCRIPTS_ENV
+=
PKG_PREFIX
=
${PREFIX}
MAN5
=
dhclient.conf.5 dhclient.leases.5
MAN8
=
dhclient.8 dhclient-script.8
MAN5
+=
dhcp-eval.5 dhcp-options.5
MSG_FILE
=
${
.CURDIR
}
/pkg-message
DESCR
=
${
.CURDIR
}
/pkg-descr
PKGINSTALL
=
${
.CURDIR
}
/pkg-install
PKGDEINSTALL
=
${PKGINSTALL}
PKGMESSAGE
=
${WRKDIR}
/pkg-message
PLIST
=
${
.CURDIR
}
/pkg-plist
# Local variables
#
# for instance, possible versions are:
# 1.2.r3.4 (or 1.2.b3.4), 1.2.r3 (or 1.2.b3), 1.2.3, 1.2
# which have to become:
# 1.2rc3pl4 (or 1.2beta3pl4), 1.2rc3 (or 1.2beta3), 1.2.3, 1.2
# so, the magic things are:
VERSION
=
PATCHLEVEL
=
.if ${PORTVERSION
:
R:E:M[br]*} != ""
RELEASE
=
${PORTVERSION:R:R}
VERSION
=
${
PORTVERSION
:R:E:S/b/beta/:S/r/rc/
}
PATCHLEVEL
=
pl
${PORTVERSION:E}
.elif ${PORTVERSION
:
E:M[br]*} != ""
RELEASE
=
${PORTVERSION:R}
VERSION
=
${
PORTVERSION
:E:S/b/beta/:S/r/rc/
}
#.elif ${PORTVERSION:R:E} != ""
#RELEASE= ${PORTVERSION:R}
#PATCHLEVEL= pl${PORTVERSION:E}
.
else
RELEASE
=
${PORTVERSION}
.
endif
PATCH_SUBDIRS
=
common minires dst omapip
PATCH_SUBDIRS
+=
client
.if
!defined(NOPORTDOCS)
PORTDOCS
=
LICENSE README RELNOTES
.
endif
BIN_FILES
=
dhclient
LOCAL_CONF_FILES
=
dhclient.conf
SAMP_FILES
=
client/dhclient.conf
DATA_FILES
=
dhclient.leases
SAMP_SUFX
=
.sample
CONF_DIR
=
${PREFIX}
/etc
SCHEMA_DIR
=
${PREFIX}
/share/
${PKGBASE}
DOCSDIR
=
${PREFIX}
/share/doc/
${PKGBASE}
DATADIR
=
/var/db
PLIST_SUB
+=
SCHEMA_DIR
=
"
${
SCHEMA_DIR
:S,^
${PREFIX}
/,,
}
"
.if
defined(WITH_DHCP_LDAP)
PLIST_SUB
+=
LDAP
=
""
.
else
PLIST_SUB
+=
LDAP
=
"@comment "
.
endif
REINPLACE_SUB
=
PREFIX
=
${PREFIX}
.if
!defined(WITHOUT_DHCP_PARANOIA)
SUB_LIST
+=
PARANOIA
=
YES
.
else
SUB_LIST
+=
PARANOIA
=
NO
.
endif
.if
!defined(WITHOUT_DHCP_JAIL)
SUB_LIST
+=
JAIL
=
YES
.
else
SUB_LIST
+=
JAIL
=
NO
.
endif
PKGMESSAGE_SUB
=
PREFIX
=
"
${PREFIX}
"
MAN1PREFIX
=
"
${MAN1PREFIX}
"
\
DOCSDIR
=
"
${DOCSDIR}
"
SCHEMA_DIR
=
"
${SCHEMA_DIR}
"
# Post-extract
#
post-extract
:
extract-omshell extract-script
extract-omshell
:
@
${MKDIR}
${WRKSRC}
/omshell
@
${MV}
${WRKSRC}
/dhcpctl/omshell.?
${WRKSRC}
/omshell
@
${CP}
${FILESDIR}
/omshell::Makefile.dist
\
${WRKSRC}
/omshell/Makefile.dist
extract-script
:
@
${CP}
${FILESDIR}
/client::scripts::freebsd
${WRKSRC}
/client/scripts/freebsd
# Post-patch
#
post-patch
:
patch-scripts patch-makefile-conf
\
patch-makefiles-dist patch-man-pages
\
patch-pkgmessage patch-site-conf
patch-scripts
:
@
${REINPLACE_CMD}
${
REINPLACE_SUB
:S/
$/
!g/
:S/^/
-e s!%%/
:S/
=/%%!/
}
\
${WRKSRC}
/client/dhclient.conf
\
${WRKSRC}
/client/scripts/freebsd
patch-site-conf
:
@
${ECHO_CMD}
CFLAGS +
=
-DENABLE_POLLING_MODE
>>
${WRKSRC}
/site.conf
patch-makefile-conf
:
@
${REINPLACE_CMD}
-e
's|^DEBUG[ ]*=|# DEBUG ?=|g'
\
${WRKSRC}
/Makefile.conf
patch-makefiles-dist
:
.for
subdir
in
${PATCH_SUBDIRS}
@${REINPLACE_CMD}
-e
's|^CFLAGS[ ]*=|CFLAGS +=|g'
\
${WRKSRC}/${subdir}/Makefile.dist
.endfor
# temporary hack - no patch file needed for this typo.
patch-man-pages
:
@
${REINPLACE_CMD}
-e
'/^\.Fd$$/d'
${WRKSRC}
/dhcpctl/dhcpctl.3
patch-pkgmessage
:
@
${SED}
${
PKGMESSAGE_SUB
:S/
$/
!g/
:S/^/
-e s!%%/
:S/
=/%%!/
}
\
${MSG_FILE}
>
${PKGMESSAGE}
.if
defined(WITH_DHCP_LDAP)
@${REINPLACE_CMD}
-e
's|^%%LDAP%%||g'
${PKGMESSAGE}
.
else
@${REINPLACE_CMD}
-e
'/^%%LDAP%%/d'
${PKGMESSAGE}
.
endif
# Post-install
#
POST-INSTALL
=
parallel-post-install install-rc-script configure-package
\
display-message
.ORDER
:
${POST-INSTALL}
post-install
:
${POST-INSTALL}
parallel-post-install
:
\
strip-binary-files
\
install-doc-files install-sample-files
\
create-conf-files create-data-files
strip-binary-files
:
.for
f
in
${BIN_FILES}
.if
exists(${PREFIX}/bin/${f})
@${STRIP_CMD}
${PREFIX}/bin/${f}
.
endif
.if
exists(${PREFIX}/sbin/${f})
@${STRIP_CMD}
${PREFIX}/sbin/${f}
.
endif
.endfor
install-doc-files
:
.if
!defined(NOPORTDOCS)
@${MKDIR}
${DOCSDIR}
.for
f
in
${PORTDOCS}
@${INSTALL_DATA}
${WRKSRC}/${f}
${DOCSDIR}
.endfor
.
endif
install-sample-files
:
.for
f
in
${SAMP_FILES}
@${INSTALL_DATA} ${WRKSRC}/${f} ${CONF_DIR}/${f
:
T}${SAMP_SUFX}
.endfor
create-conf-files
:
.for
f
in
${LOCAL_CONF_FILES}
.if
!exists(${CONF_DIR}/${f})
@${TOUCH}
${CONF_DIR}/${f}
.
endif
.endfor
create-data-files
:
.for
f
in
${DATA_FILES}
.if
!exists(${DATADIR}/${f})
@${TOUCH}
${DATADIR}/${f}
.
endif
.endfor
configure-package
:
display-message
:
@
${ECHO_MSG}
@
${CAT}
${PKGMESSAGE}
@
${ECHO_MSG}
.
include
<bsd.port.post.mk>
install/ports/emulab-dhcp30-client/distinfo
deleted
100644 → 0
View file @
a1529d8e
MD5 (dhcp-3.0.7.tar.gz) = 426bfa1712ababaff4be6dadee9c1982
SHA256 (dhcp-3.0.7.tar.gz) = 9ec6fbd37b4705fd8eed782b64790a246c56b5fd1d5e7de3109b6c23f41b9c50
SIZE (dhcp-3.0.7.tar.gz) = 888829
install/ports/emulab-dhcp30-client/files/client::scripts::freebsd
deleted
100644 → 0
View file @
a1529d8e
#!/bin/sh
#############################################################################
#
# Copyright (c) 1999, MindStep Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
#
#############################################################################
#
# This script was written by Patrick Bihan-Faou, patrick@mindstep.com,
# Please contact us for bug reports, etc.
#
#############################################################################
# $MindStep_Id: dhclient-script.sh,v 1.8 1999/12/07 22:11:08 patrick Exp $
# $MindStep_Tag: CONTRIB_19991207 $
# from FreeBSD: src/sbin/dhclient/dhclient-script.sh,v 1.2 2002/02/01 18:46:58 alfred Exp
# $FreeBSD: ports/net/isc-dhcp30-server/files/client::scripts::freebsd,v 1.3 2008/10/13 11:10:11 edwin Exp $
#############################################################################
#############################################################################
# hook functions prototypes
#
# The "pre_state_XXX_hook" functions are called before the main
# work is done for the state XXX
#
# The "post_state_XXX_hook" functions are called after the main
# work is done for the state XXX
#
# These functions are meant to be overridden by the user's
# dhclient-enter-hooks file
#############################################################################
pre_state_MEDIUM_hook
()
{
}
pre_state_PREINIT_hook
()
{
}
pre_state_ARPCHECK_hook
()
{
}
pre_state_ARPSEND_hook
()
{
}
pre_state_RENEW_hook
()
{
}
pre_state_REBIND_hook
()
{
}
pre_state_BOUND_hook
()
{
}
pre_state_REBOOT_hook
()
{
}
pre_state_EXPIRE_hook
()
{
}
pre_state_FAIL_hook
()
{
}
pre_state_TIMEOUT_hook
()
{
}
post_state_MEDIUM_hook
()
{
}
post_state_PREINIT_hook
()
{
}
post_state_ARPCHECK_hook
()
{
}
post_state_ARPSEND_hook
()
{
}
post_state_RENEW_hook
()
{
}
post_state_REBIND_hook
()
{
}
post_state_BOUND_hook
()
{
}
post_state_REBOOT_hook
()
{
}
post_state_EXPIRE_hook
()
{
}
post_state_FAIL_hook
()
{
}
post_state_TIMEOUT_hook
()
{
}
#############################################################################
# make_resolv_conf
#
# This function is called to update the information related to the
# DNS configuration (the resolver part)
#############################################################################
make_resolv_conf
()
{
if
[
"x
$new_domain_name
"
!=
x
]
&&
[
"x
$new_domain_name_servers
"
!=
x
]
;
then
echo
search
$new_domain_name
>
/etc/resolv.conf
for
nameserver
in
$new_domain_name_servers
;
do
echo
nameserver
$nameserver
>>
/etc/resolv.conf
done
fi
}
#############################################################################
# set_XXX
# unset_XXX
#
# These function each deal with one particular setting.
# They are OS dependent and may be overridden in the
# dhclient-enter-hooks file if needed.
#
# These functions are called with either "new" or "old" to indicate which
# set of variables to use (new_ip_address or old_ip_address...)
#
#############################################################################
update_hostname
()
{
local
current_hostname
=
`
/bin/hostname
`
if
[
"
$current_hostname
"
=
""
]
||
\
[
"
$current_hostname
"
=
"
$old_host_name
"
]
then
if
[
"
$new_host_name
"
!=
"
$old_host_name
"
]
then
$LOGGER
"New Hostname:
$new_host_name
"
hostname
$new_host_name
fi
fi
}
set_ip_address
()
{
local
ip
local
mask
local
bcast
if
[
$#
-lt
1
]
then
return
1
fi
eval
ip
=
"
\$
${
1
}
_ip_address"
eval
mask
=
"
\$
${
1
}
_subnet_mask"
eval
bcast
=
"
\$
${
1
}
_broadcast_address"
if
[
"
$ip
"
!=
""
]
then
ifconfig
$interface
inet
$ip
netmask
$mask
broadcast
$bcast
$medium
# route add $ip 127.0.0.1 > /dev/null 2>&1
fi
}
unset_ip_address
()
{
local
ip
if
[
$#
-lt
1
]
then
return
1
fi
eval
ip
=
"
\$
${
1
}
_ip_address"
if
[
"
$ip
"
!=
""
]
then
ifconfig
$interface
inet
-alias
$ip
$medium
# route delete $ip 127.0.0.1 > /dev/null 2>&1
fi
}
set_ip_alias
()
{
if
[
"
$alias_ip_address
"
!=
""
]
then
ifconfig
$interface
inet
alias
$alias_ip_address
netmask
$alias_subnet_mask
# route add $alias_ip_address 127.0.0.1
fi
}
unset_ip_alias
()
{
if
[
"
$alias_ip_address
"
!=
""
]
then
ifconfig
$interface
inet
-alias
$alias_ip_address
>
/dev/null 2>&1
# route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
}
set_routers
()
{
local
router_list
if
[
$#
-lt
1
]
then
return
1
fi
eval
router_list
=
"
\$
${
1
}
_routers"
for
router
in
$router_list
do
route add default
$router
>
/dev/null 2>&1
done
}
unset_routers
()
{
local
router_list
if
[
$#
-lt
1
]
then
return
1
fi
eval
router_list
=
"
\$
${
1
}
_routers"
for
router
in
$router_list
do
route delete default
$router
>
/dev/null 2>&1
done
}
set_static_routes
()
{
local
static_routes
if
[
$#
-lt
1
]
then
return
1
fi
eval
static_routes
=
"
\$
${
1
}
_static_routes"
set
static_routes
while
[
$#
-ge
2
]
do
$LOGGER
"New Static Route:
$1
->
$2
"
route add
$1
$2
shift
;
shift
done
}
unset_static_routes
()
{
local
static_routes
if
[
$#
-lt
1
]
then
return
1
fi
eval
static_routes
=
"
\$
${
1
}
_static_routes"
set
static_routes
while
[
$#
-ge
2
]
do
route delete
$1
$2
shift
;
shift
done
}
#############################################################################
#
# utility functions grouping what needs to be done in logical units.
#
#############################################################################
set_all
()
{
set_ip_address new
set_routers new
set_static_routes new
if
[
"
$new_ip_address
"
!=
"
$alias_ip_address
"
]
then
set_ip_alias
fi
}
set_others
()
{
update_hostname
make_resolv_conf
}
clear_arp_table
()
{
arp
-d
-a
}
unset_all
()
{
if
[
"
$alias_ip_address
"
!=
"
$old_ip_address
"
]
then
unset_ip_alias
fi
if
[
"
$old_ip_address
"
!=
""
]
then
unset_ip_address old
unset_routers old
unset_static_routes old
clear_arp_table
fi
}
test_new_lease
()
{
local
rc
set
$new_routers
if
[
$#
-ge
1
]
then
set_ip_address new
if
ping
-q
-c
1
$1
then
rc
=
0
else
rc
=
1
fi
unset_ip_address new
else
rc
=
1
fi
return
$rc
}
#############################################################################
# Main State functions.
#
# There is a state function for each state of the DHCP client
# These functions are OS specific and should be be tampered with.
#############################################################################
in_state_MEDIUM
()
{
ifconfig
$interface
$medium
ifconfig
$interface
inet
-alias
0.0.0.0
$medium
>
/dev/null 2>&1
sleep
1
exit_status
=
0
}
in_state_PREINIT
()
{
unset_ip_alias
ifconfig
$interface
inet 0.0.0.0 netmask 0.0.0.0
\
broadcast 255.255.255.255 up
exit_status
=
0
}
in_state_ARPCHECK
()
{
exit_status
=
0
}
in_state_ARPSEND
()
{
exit_status
=
0
}
in_state_RENEW
()
{
if
[
"
$old_ip_address
"
!=
"
$new_ip_address
"
]
then
unset_all
set_all
fi
set_others
}
in_state_REBIND
()
{
in_state_RENEW
}
in_state_BOUND
()
{
unset_all
set_all