- Correct %post problems in dhclient package (#495361)
- Read hooks scripts from /etc/dhcp (#495361) - Update to latest ldap-for-dhcp
This commit is contained in:
parent
a1643e997f
commit
580990a32d
@ -1,2 +1,2 @@
|
|||||||
dhcp-4.1.0.tar.gz
|
dhcp-4.1.0.tar.gz
|
||||||
ldap-for-dhcp-4.1.0.tar.gz
|
ldap-for-dhcp-4.1.0-2.tar.gz
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
# dhclient-script: Network interface configuration script run by
|
# dhclient-script: Network interface configuration script run by
|
||||||
# dhclient based on DHCP client communication
|
# dhclient based on DHCP client communication
|
||||||
#
|
#
|
||||||
# Copyright (C) 2008 Red Hat, Inc.
|
# Copyright (C) 2008, 2009 Red Hat, Inc.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -35,6 +35,8 @@ SAVEDIR=/var/lib/dhclient
|
|||||||
LOGFACILITY="local7"
|
LOGFACILITY="local7"
|
||||||
LOGLEVEL="notice"
|
LOGLEVEL="notice"
|
||||||
|
|
||||||
|
ETCDIR="/etc/dhcp"
|
||||||
|
|
||||||
logmessage() {
|
logmessage() {
|
||||||
msg="${1}"
|
msg="${1}"
|
||||||
logger -p ${LOGFACILITY}.${LOGLEVEL} -t "NET" "dhclient: ${msg}"
|
logger -p ${LOGFACILITY}.${LOGLEVEL} -t "NET" "dhclient: ${msg}"
|
||||||
@ -107,8 +109,8 @@ make_resolv_conf() {
|
|||||||
exit_with_hooks() {
|
exit_with_hooks() {
|
||||||
exit_status="${1}"
|
exit_status="${1}"
|
||||||
|
|
||||||
if [ -x /etc/dhclient-exit-hooks ]; then
|
if [ -x ${ETCDIR}/dhclient-exit-hooks ]; then
|
||||||
. /etc/dhclient-exit-hooks
|
. ${ETCDIR}/dhclient-exit-hooks
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit ${exit_status}
|
exit ${exit_status}
|
||||||
@ -236,10 +238,10 @@ dhconfig() {
|
|||||||
ip link set ${interface} mtu ${new_interface_mtu}
|
ip link set ${interface} mtu ${new_interface_mtu}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -x /etc/dhclient-${interface}-up-hooks ]; then
|
if [ -x ${ETCDIR}/dhclient-${interface}-up-hooks ]; then
|
||||||
. /etc/dhclient-${interface}-up-hooks
|
. ${ETCDIR}/dhclient-${interface}-up-hooks
|
||||||
elif [ -x /etc/dhclient-up-hooks ]; then
|
elif [ -x ${ETCDIR}/dhclient-up-hooks ]; then
|
||||||
. /etc/dhclient-up-hooks
|
. ${ETCDIR}/dhclient-up-hooks
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ (( -z "${GATEWAYDEV}" ) ||
|
if [[ (( -z "${GATEWAYDEV}" ) ||
|
||||||
@ -360,8 +362,8 @@ dhconfig() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# execute any additional client side configuration scripts we have
|
# execute any additional client side configuration scripts we have
|
||||||
if [ -d /etc/dhcp/dhclient.d ]; then
|
if [ -d ${ETCDIR}/dhclient.d ]; then
|
||||||
for f in /etc/dhcp/dhclient.d/*.sh ; do
|
for f in ${ETCDIR}/dhclient.d/*.sh ; do
|
||||||
if [ -x ${f} ]; then
|
if [ -x ${f} ]; then
|
||||||
subsystem="${f%.sh}"
|
subsystem="${f%.sh}"
|
||||||
subsystem="${subsystem##*/}"
|
subsystem="${subsystem##*/}"
|
||||||
@ -386,12 +388,12 @@ get_prefix() {
|
|||||||
# ### MAIN
|
# ### MAIN
|
||||||
#
|
#
|
||||||
|
|
||||||
if [ -x /etc/dhclient-enter-hooks ]; then
|
if [ -x ${ETCDIR}/dhclient-enter-hooks ]; then
|
||||||
exit_status=0
|
exit_status=0
|
||||||
|
|
||||||
# dhclient-enter-hooks can abort dhclient-script by setting
|
# dhclient-enter-hooks can abort dhclient-script by setting
|
||||||
# the exit_status variable to a non-zero value
|
# the exit_status variable to a non-zero value
|
||||||
. /etc/dhclient-enter-hooks
|
. ${ETCDIR}/dhclient-enter-hooks
|
||||||
if [ ${exit_status} -ne 0 ]; then
|
if [ ${exit_status} -ne 0 ]; then
|
||||||
exit ${exit_status}
|
exit ${exit_status}
|
||||||
fi
|
fi
|
||||||
@ -488,8 +490,8 @@ case "${reason}" in
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# execute any additional client side configuration scripts we have
|
# execute any additional client side configuration scripts we have
|
||||||
if [ -d /etc/dhcp/dhclient.d ]; then
|
if [ -d ${ETCDIR}/dhclient.d ]; then
|
||||||
for f in /etc/dhcp/dhclient.d/*.sh ; do
|
for f in ${ETCDIR}/dhclient.d/*.sh ; do
|
||||||
if [ -x ${f} ]; then
|
if [ -x ${f} ]; then
|
||||||
subsystem="${f%.sh}"
|
subsystem="${f%.sh}"
|
||||||
subsystem="${subsystem##*/}"
|
subsystem="${subsystem##*/}"
|
||||||
@ -499,10 +501,10 @@ case "${reason}" in
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -x /etc/dhclient-${interface}-down-hooks ]; then
|
if [ -x ${ETCDIR}/dhclient-${interface}-down-hooks ]; then
|
||||||
. /etc/dhclient-${interface}-down-hooks
|
. ${ETCDIR}/dhclient-${interface}-down-hooks
|
||||||
elif [ -x /etc/dhclient-down-hooks ]; then
|
elif [ -x ${ETCDIR}/dhclient-down-hooks ]; then
|
||||||
. /etc/dhclient-down-hooks
|
. ${ETCDIR}/dhclient-down-hooks
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${alias_ip_address}" ]; then
|
if [ -n "${alias_ip_address}" ]; then
|
||||||
|
15
dhcp.spec
15
dhcp.spec
@ -4,6 +4,9 @@
|
|||||||
# Where dhcp configuration files are stored
|
# Where dhcp configuration files are stored
|
||||||
%define dhcpconfdir %{_sysconfdir}/dhcp
|
%define dhcpconfdir %{_sysconfdir}/dhcp
|
||||||
|
|
||||||
|
# LDAP patch version
|
||||||
|
%define ldappatchver %{version}-2
|
||||||
|
|
||||||
Summary: Dynamic host configuration protocol software
|
Summary: Dynamic host configuration protocol software
|
||||||
Name: dhcp
|
Name: dhcp
|
||||||
Version: 4.1.0
|
Version: 4.1.0
|
||||||
@ -17,7 +20,7 @@ License: ISC
|
|||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
URL: http://isc.org/products/DHCP/
|
URL: http://isc.org/products/DHCP/
|
||||||
Source0: ftp://ftp.isc.org/isc/%{name}/%{name}-%{version}.tar.gz
|
Source0: ftp://ftp.isc.org/isc/%{name}/%{name}-%{version}.tar.gz
|
||||||
Source1: http://dcantrel.fedorapeople.org/dhcp/ldap-patch/ldap-for-dhcp-%{version}-2.tar.gz
|
Source1: http://dcantrel.fedorapeople.org/dhcp/ldap-patch/ldap-for-dhcp-%{ldappatchver}.tar.gz
|
||||||
Source2: dhcpd.init
|
Source2: dhcpd.init
|
||||||
Source3: dhcrelay.init
|
Source3: dhcrelay.init
|
||||||
Source4: dhclient-script
|
Source4: dhclient-script
|
||||||
@ -106,7 +109,7 @@ libdhcpctl and libomapi static libraries are also included in this package.
|
|||||||
%setup -T -D -a 1
|
%setup -T -D -a 1
|
||||||
|
|
||||||
# Add in LDAP support
|
# Add in LDAP support
|
||||||
%{__patch} -p1 < ldap-for-dhcp-%{version}-2/%{name}-%{version}-ldap.patch
|
%{__patch} -p1 < ldap-for-dhcp-%{ldappatchver}/%{name}-%{version}-ldap.patch
|
||||||
|
|
||||||
# Replace the standard ISC warning message about requesting help with an
|
# Replace the standard ISC warning message about requesting help with an
|
||||||
# explanation that this is a patched build of ISC DHCP and bugs should be
|
# explanation that this is a patched build of ISC DHCP and bugs should be
|
||||||
@ -185,7 +188,7 @@ libdhcpctl and libomapi static libraries are also included in this package.
|
|||||||
%patch18 -p1
|
%patch18 -p1
|
||||||
|
|
||||||
# Copy in documentation and example scripts for LDAP patch to dhcpd
|
# Copy in documentation and example scripts for LDAP patch to dhcpd
|
||||||
%{__install} -p -m 0755 ldap-for-dhcp-%{version}/dhcpd-conf-to-ldap contrib/
|
%{__install} -p -m 0755 ldap-for-dhcp-%{ldappatchver}/dhcpd-conf-to-ldap contrib/
|
||||||
|
|
||||||
# Copy in the Fedora/RHEL dhclient script
|
# Copy in the Fedora/RHEL dhclient script
|
||||||
%{__install} -p -m 0755 %{SOURCE4} client/scripts/linux
|
%{__install} -p -m 0755 %{SOURCE4} client/scripts/linux
|
||||||
@ -311,7 +314,7 @@ EOF
|
|||||||
|
|
||||||
# Install dhcp.schema for LDAP configuration
|
# Install dhcp.schema for LDAP configuration
|
||||||
%{__mkdir} -p %{buildroot}%{_sysconfdir}/openldap/schema
|
%{__mkdir} -p %{buildroot}%{_sysconfdir}/openldap/schema
|
||||||
%{__install} -p -m 0644 -D ldap-for-dhcp-%{version}/dhcp.schema \
|
%{__install} -p -m 0644 -D ldap-for-dhcp-%{ldappatchver}/dhcp.schema \
|
||||||
%{buildroot}%{_sysconfdir}/openldap/schema
|
%{buildroot}%{_sysconfdir}/openldap/schema
|
||||||
|
|
||||||
# Install empty directory for dhclient.d scripts
|
# Install empty directory for dhclient.d scripts
|
||||||
@ -365,9 +368,9 @@ fi
|
|||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%doc LICENSE README ldap-for-dhcp-%{version}/README.ldap
|
%doc LICENSE README ldap-for-dhcp-%{ldappatchver}/README.ldap
|
||||||
%doc RELNOTES dhcpd.conf.sample doc/IANA-arp-parameters doc/api+protocol
|
%doc RELNOTES dhcpd.conf.sample doc/IANA-arp-parameters doc/api+protocol
|
||||||
%doc doc/*.txt __fedora_contrib/* ldap-for-dhcp-%{version}/*.txt
|
%doc doc/*.txt __fedora_contrib/* ldap-for-dhcp-%{ldappatchver}/*.txt
|
||||||
%dir %{_localstatedir}/lib/dhcpd
|
%dir %{_localstatedir}/lib/dhcpd
|
||||||
%dir %{dhcpconfdir}
|
%dir %{dhcpconfdir}
|
||||||
%verify(not size md5 mtime) %config(noreplace) %{_localstatedir}/lib/dhcpd/dhcpd.leases
|
%verify(not size md5 mtime) %config(noreplace) %{_localstatedir}/lib/dhcpd/dhcpd.leases
|
||||||
|
Loading…
Reference in New Issue
Block a user