2007-01-10 17:39:58 +01:00
|
|
|
#
|
2009-08-06 21:34:50 +02:00
|
|
|
# spec file for package dhcp (Version 3.1.2p1)
|
2007-01-10 17:39:58 +01:00
|
|
|
#
|
2009-01-19 02:22:10 +01:00
|
|
|
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2007-01-10 17:39:58 +01:00
|
|
|
#
|
2008-08-23 00:17:43 +02:00
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2007-01-10 17:39:58 +01:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
# norootforbuild
|
|
|
|
|
2008-04-01 23:02:39 +02:00
|
|
|
|
2007-01-10 17:39:58 +01:00
|
|
|
Name: dhcp
|
2007-03-15 01:23:11 +01:00
|
|
|
%define susefw2dir %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services
|
2007-01-10 17:39:58 +01:00
|
|
|
%define omc_prefix /usr/share/omc
|
|
|
|
%define omc_svcdir %{omc_prefix}/svcinfo.d
|
2009-08-06 21:34:50 +02:00
|
|
|
%define with_casa 0%{?sles_version} >= 10 || 0%{?suse_version} >= 1110
|
|
|
|
%if 0%{?with_casa:%with_casa}
|
2007-02-25 23:22:54 +01:00
|
|
|
BuildRequires: CASA-devel
|
|
|
|
%endif
|
2008-09-13 00:24:42 +02:00
|
|
|
BuildRequires: dos2unix openldap2-devel
|
2009-08-06 21:34:50 +02:00
|
|
|
License: BSD 3-clause (or similar)
|
2007-01-10 17:39:58 +01:00
|
|
|
Group: Productivity/Networking/Boot/Servers
|
2007-11-22 18:09:01 +01:00
|
|
|
AutoReqProv: on
|
2009-08-06 21:34:50 +02:00
|
|
|
Version: 3.1.2p1
|
|
|
|
Release: 1
|
2007-01-10 17:39:58 +01:00
|
|
|
Summary: Common Files Used by ISC DHCP Software
|
2007-11-22 18:09:01 +01:00
|
|
|
Url: http://www.isc.org/isc/dhcp.html
|
2007-01-10 17:39:58 +01:00
|
|
|
Source0: http://ftp.isc.org/isc/dhcp/dhcp-%{version}.tar.gz
|
|
|
|
Source1: http://ftp.isc.org/isc/dhcp/dhcp-%{version}.tar.gz.asc
|
|
|
|
Source2: rc.dhcpd
|
|
|
|
Source3: rc.dhcrelay
|
|
|
|
Source11: sysconfig.dhcpd
|
|
|
|
Source12: sysconfig.syslog-dhcpd
|
|
|
|
Source14: sysconfig.dhcrelay
|
|
|
|
Source15: dhcp.README
|
|
|
|
Source16: dhcp.LIESMICH
|
|
|
|
Source17: examples.tar.gz
|
|
|
|
Source18: dhcp.README.upgrade
|
|
|
|
Source19: dhcpsync
|
|
|
|
Source20: dhcpsync.8
|
|
|
|
Source21: DDNS-howto.txt
|
|
|
|
Source30: http://www.andrew.cmu.edu/~kevinm/dhcp/leasestate
|
|
|
|
Source31: http://www.andrew.cmu.edu/~kevinm/dhcp/listlease
|
|
|
|
Source32: http://www.andrew.cmu.edu/~kevinm/dhcp/clearip
|
|
|
|
Source33: http://www.andrew.cmu.edu/~kevinm/dhcp/reset-ip
|
|
|
|
Source40: http://www3.baylor.edu/~Jeff_Wilson/GiveAway/leases.awk
|
|
|
|
Source41: http://www.suse.de/~poeml/dnscompr.py
|
|
|
|
Source42: dhcpd.xml
|
2007-03-15 01:23:11 +01:00
|
|
|
Source43: SuSEfirewall2.dhcp-server
|
2008-09-13 00:24:42 +02:00
|
|
|
Patch0: dhcp-3.1.1-paths.dif
|
2007-01-10 17:39:58 +01:00
|
|
|
## chroot patch by Ari Edelkind (see readme)
|
|
|
|
## and patch supplied by <thomas@suse.de>
|
2008-09-13 00:24:42 +02:00
|
|
|
Patch1: dhcp-3.1.1-paranoia.dif
|
|
|
|
Patch2: dhcp-3.1.1-omapi-test.c.dif
|
|
|
|
Patch3: dhcp-3.1.1-man-includes.dif
|
|
|
|
Patch4: dhcp-3.1.1-tmpfile.dif
|
2007-01-10 17:39:58 +01:00
|
|
|
## LDAP support for DHCP server
|
|
|
|
## patch lives here: http://home.ntelos.net/~masneyb/
|
|
|
|
%define DHCPD_LDAP 1
|
|
|
|
%if %DHCPD_LDAP
|
2009-08-06 21:34:50 +02:00
|
|
|
Patch10: dhcp-3.1.2p1-ldap-patch-mt.11.2-02.diff.bz2
|
2007-01-10 17:39:58 +01:00
|
|
|
%endif
|
|
|
|
%if %{?suse_version:%suse_version}%{?!suse_version:99999} > 930
|
2008-09-13 00:24:42 +02:00
|
|
|
Patch30: dhcp-3.1.1-pie.dif
|
2007-01-10 17:39:58 +01:00
|
|
|
%endif
|
2008-09-13 00:24:42 +02:00
|
|
|
Patch40: dhcp-3.1.1-dhclient-exec-filedes.dif
|
|
|
|
Patch41: dhcp-3.1.1-dhclient-send-hostname-rml.dif
|
|
|
|
Patch42: dhcp-3.1.1-dhclient-use-script-cmdline.dif
|
|
|
|
Patch50: dhcp-3.1.1-dhclient-conf.dif
|
2009-08-06 21:34:50 +02:00
|
|
|
Patch60: dhcp-3.1.2-dhclient-script.dif
|
2008-09-13 00:24:42 +02:00
|
|
|
##
|
2009-08-06 21:34:50 +02:00
|
|
|
Patch70: dhcp-3.1.1-CVE-2009-1892.bnc519413.dif
|
2007-01-10 17:39:58 +01:00
|
|
|
Obsoletes: dhcp-base
|
|
|
|
Provides: dhcp-base:/usr/bin/omshell
|
2008-11-28 14:55:40 +01:00
|
|
|
PreReq: /bin/touch /sbin/chkconfig sysconfig
|
2007-01-10 17:39:58 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2007-11-22 18:09:01 +01:00
|
|
|
|
2007-01-10 17:39:58 +01:00
|
|
|
%package server
|
2009-08-06 21:34:50 +02:00
|
|
|
License: BSD 3-clause (or similar)
|
2007-01-10 17:39:58 +01:00
|
|
|
Summary: ISC DHCP Server
|
|
|
|
Group: Productivity/Networking/Boot/Servers
|
|
|
|
Requires: net-tools dhcp
|
|
|
|
PreReq: %insserv_prereq %fillup_prereq /bin/cat /bin/mkdir /bin/cp /usr/sbin/useradd
|
|
|
|
Provides: dhcp_server dhcp:/usr/sbin/dhcpd
|
2007-11-22 18:09:01 +01:00
|
|
|
AutoReqProv: on
|
|
|
|
|
2007-01-10 17:39:58 +01:00
|
|
|
%package client
|
2009-08-06 21:34:50 +02:00
|
|
|
License: BSD 3-clause (or similar)
|
2007-01-10 17:39:58 +01:00
|
|
|
Summary: ISC DHCP Client
|
|
|
|
Group: Productivity/Networking/Boot/Clients
|
|
|
|
Requires: net-tools dhcp /usr/bin/host
|
|
|
|
PreReq: %insserv_prereq %fillup_prereq /bin/cat /bin/mkdir /bin/cp
|
|
|
|
Provides: dhcp_client dhclient
|
|
|
|
Obsoletes: dhclient
|
2007-11-22 18:09:01 +01:00
|
|
|
AutoReqProv: on
|
|
|
|
|
2007-01-10 17:39:58 +01:00
|
|
|
%package relay
|
2009-08-06 21:34:50 +02:00
|
|
|
License: BSD 3-clause (or similar)
|
2007-01-10 17:39:58 +01:00
|
|
|
Summary: DHCP Relay Agent
|
|
|
|
Group: Productivity/Networking/Boot/Servers
|
|
|
|
Requires: net-tools dhcp
|
|
|
|
PreReq: %insserv_prereq %fillup_prereq /bin/cat /bin/mkdir /bin/cp
|
|
|
|
Provides: dhcp_relay dhcrelay
|
|
|
|
Obsoletes: dhcrelay
|
2007-11-22 18:09:01 +01:00
|
|
|
AutoReqProv: on
|
|
|
|
|
2007-01-10 17:39:58 +01:00
|
|
|
%package devel
|
2009-08-06 21:34:50 +02:00
|
|
|
License: BSD 3-clause (or similar)
|
2007-01-10 17:39:58 +01:00
|
|
|
Summary: Header Files and Libraries for dhcpctl API
|
|
|
|
Group: Development/Libraries/C and C++
|
|
|
|
Requires: dhcp = %{version}
|
|
|
|
%if %ul_version >= 1
|
|
|
|
%define VENDOR UnitedLinux
|
|
|
|
%else
|
|
|
|
%define VENDOR SuSE
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%description
|
|
|
|
This package contains common files used by both the ISC DHCP server
|
|
|
|
("dhcp-server" package) and client ("dhcp-client").
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
Ted Lemon <mellon@fugue.com>
|
|
|
|
|
|
|
|
%description server
|
|
|
|
This package contains the ISC DHCP server.
|
|
|
|
|
|
|
|
Please read the documentation in /usr/share/doc/packages/dhcp-server
|
|
|
|
regarding configuration of the DHCP server.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
Ted Lemon <mellon@fugue.com>
|
|
|
|
|
|
|
|
This package also contains software written by Kevin C. Miller <kevinm@andrew.cmu.edu>
|
|
|
|
and Jeff Wilson <wilsonj@cs.ecs.baylor.edu>.
|
|
|
|
|
|
|
|
%description client
|
|
|
|
This is an alternative DHCP client, the ISC DHCP client for Linux. Like
|
|
|
|
"dhcpcd" (the client that is installed by default), it can be used to
|
|
|
|
configure the network setup. IP address, hostname, routing,
|
|
|
|
nameserver, netmask, and broadcast can be dynamically assigned while
|
|
|
|
booting the machine.
|
|
|
|
|
|
|
|
It is configurable via the configuration file /etc/dhclient.conf and
|
|
|
|
you can define your own 'hooks' to be used by the /sbin/dhclient-script
|
|
|
|
(which is called by the daemon).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
Ted Lemon <mellon@fugue.com>
|
|
|
|
|
|
|
|
%description relay
|
|
|
|
This is the ISC DHCP relay agent. It can be used as a 'gateway' for
|
|
|
|
DHCP messages across physical network segments. This is necessary
|
|
|
|
because requests can be broadcast, and they will normally not be
|
|
|
|
routed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%description devel
|
|
|
|
This package contains all of the libraries and headers for developing
|
|
|
|
with the Internet Software Consortium (ISC) dhcpctl API.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
Ted Lemon <mellon@fugue.com>
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n %{name}-%{version}
|
2008-09-13 00:24:42 +02:00
|
|
|
##
|
|
|
|
%patch0 -p0
|
2007-01-10 17:39:58 +01:00
|
|
|
%patch1 -p0
|
2008-09-13 00:24:42 +02:00
|
|
|
%patch2 -p0
|
|
|
|
%patch3 -p0
|
|
|
|
%patch4 -p0
|
2007-01-10 17:39:58 +01:00
|
|
|
%if %DHCPD_LDAP
|
2008-09-13 00:24:42 +02:00
|
|
|
%patch10 -p1
|
2007-01-10 17:39:58 +01:00
|
|
|
%endif
|
|
|
|
%if %{?suse_version:%suse_version}%{?!suse_version:99999} > 930
|
2008-09-13 00:24:42 +02:00
|
|
|
%patch30 -p0
|
2007-01-10 17:39:58 +01:00
|
|
|
%endif
|
2008-09-13 00:24:42 +02:00
|
|
|
%patch40 -p0
|
|
|
|
%patch41 -p0
|
|
|
|
%patch42 -p0
|
|
|
|
%patch50 -p0
|
|
|
|
%patch60 -p0
|
2009-08-06 21:34:50 +02:00
|
|
|
%patch70 -p0
|
2008-09-13 00:24:42 +02:00
|
|
|
##
|
2007-01-10 17:39:58 +01:00
|
|
|
find . -type f -name \*.cat\* -exec rm -f {} \;
|
|
|
|
cp -p %{S:2} %{S:3} %{S:11} %{S:12} %{S:14} %{S:32} %{S:33} .
|
|
|
|
for i in README LIESMICH; do
|
|
|
|
sed 's/SuSE/%VENDOR/' $RPM_SOURCE_DIR/dhcp.$i > $i.%VENDOR
|
|
|
|
done
|
|
|
|
cp -p $RPM_SOURCE_DIR/dhcp.README.upgrade README.upgrade
|
|
|
|
cp -p $RPM_SOURCE_DIR/DDNS-howto.txt .
|
|
|
|
echo "exec /usr/bin/genDDNSkey \"$@\"" > genDDNSKey.sh
|
|
|
|
tar xzf $RPM_SOURCE_DIR/examples.tar.gz
|
2008-09-13 00:24:42 +02:00
|
|
|
dos2unix contrib/ms2isc/*
|
2007-01-10 17:39:58 +01:00
|
|
|
|
|
|
|
%build
|
|
|
|
export CFLAGS
|
2009-08-06 21:34:50 +02:00
|
|
|
CFLAGS="$RPM_OPT_FLAGS -W -Wall -fno-strict-aliasing -Wno-unused -DLDAP_DEPRECATED -DUSE_SSL -DPARANOIA"
|
|
|
|
%if 0%{?with_casa:%with_casa}
|
2007-02-25 23:22:54 +01:00
|
|
|
CFLAGS="$CFLAGS -DLDAP_CASA_AUTH"
|
|
|
|
%endif
|
2008-09-13 00:24:42 +02:00
|
|
|
# seems obsolete (redefined reports) => double check
|
|
|
|
#%ifarch ia64 sparc64 alpha s390x ppc64 x86_64
|
|
|
|
# CFLAGS="$CFLAGS -DPTRSIZE_64BIT"
|
|
|
|
#%endif
|
2007-01-10 17:39:58 +01:00
|
|
|
%ifarch ppc ppc64 s390x
|
|
|
|
# bugs 134590, 171532
|
|
|
|
CFLAGS="$CFLAGS -fsigned-char"
|
|
|
|
%endif
|
|
|
|
%if %{?suse_version:%suse_version}%{?!suse_version:99999} > 930
|
|
|
|
%ifarch ia64 sparc64 alpha s390x ppc64 x86_64
|
|
|
|
CFLAGS="$CFLAGS -fPIE"
|
|
|
|
%else
|
|
|
|
CFLAGS="$CFLAGS -fpie"
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
export DEBUG_FLAGS=$CFLAGS
|
|
|
|
./configure
|
|
|
|
# first, build binaries which use bsd sockets instead of lpf
|
|
|
|
cp includes/site.h includes/site.h.save.lpf
|
|
|
|
echo "#define USE_SOCKETS" >> includes/site.h
|
|
|
|
make DEBUG="$DEBUG_FLAGS -W" all
|
|
|
|
cp -p work.linux-2.2/server/dhcpd work.linux-2.2/server/dhcpd.bsd
|
|
|
|
make clean
|
|
|
|
# then, build the normal binaries using lpf
|
|
|
|
mv includes/site.h.save.lpf includes/site.h
|
|
|
|
make DEBUG="$DEBUG_FLAGS -W" all
|
|
|
|
# with a minimal config, see if it runs
|
|
|
|
echo "ddns-update-style interim;" > testconf
|
|
|
|
work.linux-2.2/server/dhcpd -t -cf testconf || exit 1
|
|
|
|
|
|
|
|
%install
|
|
|
|
MANDIR=%{_mandir} DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} make install
|
|
|
|
install -m 744 work.linux-2.2/omapip/svtest $RPM_BUILD_ROOT/usr/sbin/svtest
|
|
|
|
install -m 644 work.linux-2.2/dst/libdst.a $RPM_BUILD_ROOT/%{_libdir}
|
|
|
|
# install the saved bsd flavor binary
|
|
|
|
install -m 755 work.linux-2.2/server/dhcpd.bsd $RPM_BUILD_ROOT/usr/sbin/dhcpd.bsd
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/init.d
|
2007-03-15 01:23:11 +01:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{susefw2dir}
|
2007-01-10 17:39:58 +01:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{omc_svcdir}
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/var/run
|
|
|
|
# set up chroot jail
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/var/lib/dhcp/etc
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/var/lib/dhcp/dev
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/var/lib/dhcp/%_lib
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/var/lib/dhcp/var/run
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/var/lib/dhcp/db
|
|
|
|
%if %DHCPD_LDAP
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/openldap/schema
|
|
|
|
install -m 644 contrib/dhcp.schema $RPM_BUILD_ROOT/etc/openldap/schema/
|
|
|
|
%endif
|
|
|
|
install -m 744 rc.dhcpd $RPM_BUILD_ROOT/etc/init.d/dhcpd
|
|
|
|
install -m 744 rc.dhcrelay $RPM_BUILD_ROOT/etc/init.d/dhcrelay
|
|
|
|
ln -sf ../../etc/init.d/dhcpd $RPM_BUILD_ROOT/usr/sbin/rcdhcpd
|
|
|
|
ln -sf ../../etc/init.d/dhcrelay $RPM_BUILD_ROOT/usr/sbin/rcdhcrelay
|
|
|
|
install -m 755 $RPM_SOURCE_DIR/dhcpsync $RPM_BUILD_ROOT/usr/sbin/
|
|
|
|
install -m 644 $RPM_SOURCE_DIR/dhcpsync.8 $RPM_BUILD_ROOT/%{_mandir}/man8/
|
|
|
|
install -m 755 $RPM_SOURCE_DIR/leasestate $RPM_BUILD_ROOT/usr/sbin/
|
|
|
|
install -m 755 $RPM_SOURCE_DIR/listlease $RPM_BUILD_ROOT/usr/sbin/
|
|
|
|
install -m 755 $RPM_SOURCE_DIR/leases.awk $RPM_BUILD_ROOT/usr/sbin/
|
|
|
|
cp -p $RPM_SOURCE_DIR/dnscompr.py .
|
|
|
|
install -m 644 sysconfig.dhcpd $RPM_BUILD_ROOT/var/adm/fillup-templates/
|
|
|
|
install -m 644 sysconfig.syslog-dhcpd $RPM_BUILD_ROOT/var/adm/fillup-templates/
|
|
|
|
install -m 644 sysconfig.dhcrelay $RPM_BUILD_ROOT/var/adm/fillup-templates/
|
2008-09-13 00:24:42 +02:00
|
|
|
rm -f $RPM_BUILD_ROOT/var/lib/dhcp/dhcpd.leases
|
2007-01-10 17:39:58 +01:00
|
|
|
touch $RPM_BUILD_ROOT/var/lib/dhcp/dhclient.leases
|
|
|
|
install -m 644 client/dhclient.conf $RPM_BUILD_ROOT/etc/dhclient.conf
|
|
|
|
sed '/^max-lease-time/ a \
|
|
|
|
\
|
|
|
|
# if you do not use dynamical DNS updates:\
|
|
|
|
#\
|
|
|
|
# this statement is needed by dhcpd-3 needs at least this statement.\
|
|
|
|
# you have to delete it for dhcpd-2, because it does not know it.\
|
|
|
|
#\
|
|
|
|
# if you want to use dynamical DNS updates, you should first read\
|
|
|
|
# read /usr/share/doc/packages/dhcp-server/DDNS-howto.txt\
|
|
|
|
ddns-update-style none; ddns-updates off;\
|
|
|
|
' server/dhcpd.conf > dhcpd.conf
|
2007-07-21 17:29:24 +02:00
|
|
|
install -m644 contrib/3.0b1-lease-convert 3.0b1-lease-convert
|
2007-01-10 17:39:58 +01:00
|
|
|
find $RPM_BUILD_ROOT/%{_mandir} -type f | xargs chmod 644
|
|
|
|
install -m 644 $RPM_SOURCE_DIR/dhcpd.xml $RPM_BUILD_ROOT/%{omc_svcdir}/
|
2007-03-15 01:23:11 +01:00
|
|
|
install -m 644 $RPM_SOURCE_DIR/SuSEfirewall2.dhcp-server \
|
|
|
|
$RPM_BUILD_ROOT/%{susefw2dir}/dhcp-server
|
2007-01-10 17:39:58 +01:00
|
|
|
|
|
|
|
%pre
|
|
|
|
# In the past, the name of the source package was "dhcp" but the subpackage
|
|
|
|
# with the common files was named "dhcp-base" -- thus, no subpackage had the
|
|
|
|
# same name as the parent package. This lead to trouble on various ends, like
|
|
|
|
# the putonftp mechanism, so "dhcp-base" was renamed to "dhcp".
|
|
|
|
#
|
|
|
|
# During a YaST system update, the first package to be updated is "dhcp", which
|
|
|
|
# should --and does-- obsolete the dhcp-base package.
|
|
|
|
# However, if RPMv4 is used, there is a peculiarity: RPMv4 automatically
|
|
|
|
# invents an 'obsolete' when it sees a 'provides'.
|
|
|
|
# Since the old dhcp-server package (SLES8) did provide
|
|
|
|
# Provides: dhcp_server dhcp:/usr/sbin/dhcpd dhcp
|
|
|
|
# RPMv4 removes the dhcp-server package.
|
|
|
|
#
|
|
|
|
# This in itself is not a problem because the package is re-installed later
|
|
|
|
# (RPMv4 is not that intelligent). However, if the service is destined to be
|
|
|
|
# started at boot time, the runlevel links will be gone, so the service will
|
|
|
|
# not be started after the update. To restore the links, there is no better way
|
|
|
|
# than remember that the service was running before updating the "dhcp" package,
|
|
|
|
# and restore the links at "dhcp-server" installation time.
|
|
|
|
if [ ${1:-0} -gt 1 ]; then # update
|
|
|
|
if sbin/chkconfig -c dhcpd; then
|
|
|
|
touch var/adm/dhcpd_needs_insserv
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
%pre server
|
|
|
|
/usr/sbin/useradd -r -g nogroup -s /bin/false -c "DHCP server daemon" -d /var/lib/dhcp dhcpd 2> /dev/null ||:
|
|
|
|
if [ ! -x usr/sbin/dhcpd.lpf -a \
|
|
|
|
! -d usr/share/doc/packages/dhcp-server/ms2isc ]; then
|
|
|
|
# usr/sbin/dhcpd.lpf was added _after_ release of 9.1;
|
|
|
|
# usr/share/doc/packages/dhcp-server/ms2isc was added with 9.0;
|
|
|
|
# thus, if both are not present we are updating from pre 9.0 AND
|
|
|
|
# we are NOT updating a 9.1 released package (that has not been updated before).
|
|
|
|
# 9.0 already had a binary compiled with BSD sockets.
|
|
|
|
touch etc/dhcpd_updating_from_lpf_style
|
|
|
|
fi
|
|
|
|
|
|
|
|
%post server
|
2007-07-21 17:29:24 +02:00
|
|
|
%{fillup_and_insserv -n dhcpd dhcpd}
|
|
|
|
%{fillup_only -ans syslog dhcpd}
|
2007-01-10 17:39:58 +01:00
|
|
|
if grep -q '^DHCPD_RUN_AS="nobody"' etc/sysconfig/dhcpd; then
|
|
|
|
tmpfile=$(mktemp -q etc/sysconfig/dhcpd.XXXXXX)
|
|
|
|
sed 's|^DHCPD_RUN_AS="nobody"|DHCPD_RUN_AS="dhcpd"|' etc/sysconfig/dhcpd \
|
|
|
|
> $tmpfile && mv $tmpfile etc/sysconfig/dhcpd
|
|
|
|
rm -f $tmpfile
|
|
|
|
fi
|
|
|
|
# update?
|
|
|
|
if [ ${FIRST_ARG:-0} -gt 1 ]; then
|
|
|
|
if [ -e etc/dhcpd_updating_from_lpf_style -a -x usr/sbin/dhcpd.lpf ]; then
|
|
|
|
if /etc/init.d/dhcpd status &>/dev/null; then
|
|
|
|
was_running=true
|
|
|
|
/etc/init.d/dhcpd stop
|
|
|
|
else
|
|
|
|
was_running=false
|
|
|
|
fi
|
|
|
|
tmpfile=$(mktemp -q etc/sysconfig/dhcpd.XXXXXX)
|
|
|
|
sed 's|^DHCPD_BINARY=""|DHCPD_BINARY="/usr/sbin/dhcpd.lpf"|' etc/sysconfig/dhcpd \
|
|
|
|
> $tmpfile && mv $tmpfile etc/sysconfig/dhcpd
|
|
|
|
rm -f $tmpfile
|
|
|
|
if $was_running; then
|
|
|
|
/etc/init.d/dhcpd start
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
# see comment above
|
|
|
|
if [ -f var/adm/dhcpd_needs_insserv ]; then
|
|
|
|
sbin/insserv dhcpd
|
|
|
|
rm var/adm/dhcpd_needs_insserv
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
rm -f etc/dhcpd_updating_from_lpf_style
|
|
|
|
test -s etc/dhcpd.conf || { cp -p usr/share/doc/packages/dhcp-server/dhcpd.conf etc/; }
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
%postun server
|
|
|
|
%restart_on_update dhcpd
|
|
|
|
%insserv_cleanup
|
|
|
|
|
|
|
|
%preun server
|
|
|
|
%stop_on_removal dhcpd
|
|
|
|
|
|
|
|
%post relay
|
|
|
|
%{fillup_and_insserv -n dhcrelay dhcrelay}
|
|
|
|
|
|
|
|
%postun relay
|
|
|
|
%restart_on_update dhcrelay
|
|
|
|
%insserv_cleanup
|
|
|
|
|
|
|
|
%preun relay
|
|
|
|
%stop_on_removal dhcrelay
|
|
|
|
|
|
|
|
%clean
|
|
|
|
if ! test -f /.buildenv; then rm -rf $RPM_BUILD_ROOT; fi
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc LICENSE README RELNOTES doc
|
|
|
|
/usr/bin/omshell
|
|
|
|
%dir /var/lib/dhcp
|
|
|
|
%doc %{_mandir}/man1/omshell.1.gz
|
|
|
|
%doc %{_mandir}/man5/dhcp-eval.5.gz
|
2007-03-15 01:23:11 +01:00
|
|
|
%{susefw2dir}/dhcp-server
|
2007-01-10 17:39:58 +01:00
|
|
|
|
|
|
|
%files server
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc clearip reset-ip
|
|
|
|
%doc dnscompr.py
|
|
|
|
/usr/sbin/dhcpd
|
|
|
|
/usr/sbin/dhcpd.bsd
|
|
|
|
/usr/sbin/rcdhcpd
|
|
|
|
/usr/sbin/svtest
|
|
|
|
%config /usr/sbin/dhcpsync
|
|
|
|
%config /usr/sbin/leasestate
|
|
|
|
%config /usr/sbin/listlease
|
|
|
|
%config /usr/sbin/leases.awk
|
|
|
|
%config /etc/init.d/dhcpd
|
|
|
|
%dir /var/lib/dhcp/var
|
|
|
|
%dir /var/lib/dhcp/var/run
|
|
|
|
%attr(755,dhcpd,root) %dir /var/lib/dhcp/db
|
|
|
|
%dir /var/lib/dhcp/etc
|
|
|
|
%dir /var/lib/dhcp/dev
|
|
|
|
%doc %{_mandir}/man5/dhcpd.conf.5.gz
|
|
|
|
%doc %{_mandir}/man5/dhcp-options.5.gz
|
|
|
|
%doc %{_mandir}/man5/dhcpd.leases.5.gz
|
|
|
|
%doc %{_mandir}/man8/dhcpd.8.gz
|
|
|
|
%doc %{_mandir}/man8/dhcpsync.8.gz
|
|
|
|
%doc dhcpd.conf LIESMICH.%VENDOR README.%VENDOR README.upgrade 3.0b1-lease-convert DDNS-howto.txt genDDNSKey.sh
|
|
|
|
%doc examples
|
|
|
|
%doc contrib/ms2isc
|
|
|
|
%if %DHCPD_LDAP
|
|
|
|
%doc contrib/dhcp.schema
|
|
|
|
%doc contrib/dhcpd-conf-to-ldap.pl
|
|
|
|
%doc README.ldap doc/draft-ietf-dhc-ldap-schema-01.txt
|
2008-06-27 20:47:45 +02:00
|
|
|
%dir /etc/openldap
|
2007-01-10 17:39:58 +01:00
|
|
|
%dir /etc/openldap/schema
|
|
|
|
%attr(0644, root, root) %config /etc/openldap/schema/dhcp.schema
|
|
|
|
%endif
|
|
|
|
/var/adm/fillup-templates/sysconfig.dhcpd
|
|
|
|
/var/adm/fillup-templates/sysconfig.syslog-dhcpd
|
|
|
|
%dir /var/lib/dhcp/%_lib
|
|
|
|
%{omc_svcdir}/dhcpd.xml
|
|
|
|
|
|
|
|
%files client
|
|
|
|
%defattr(-,root,root)
|
|
|
|
/sbin/dhclient
|
|
|
|
/sbin/dhclient-script
|
|
|
|
%config(noreplace) /etc/dhclient.conf
|
|
|
|
%config(noreplace) /var/lib/dhcp/dhclient.leases
|
|
|
|
%doc %{_mandir}/man5/dhclient.conf.5.gz
|
|
|
|
%doc %{_mandir}/man5/dhclient.leases.5.gz
|
|
|
|
%doc %{_mandir}/man8/dhclient.8.gz
|
|
|
|
%doc %{_mandir}/man8/dhclient-script.8.gz
|
|
|
|
|
|
|
|
%files relay
|
|
|
|
%defattr(-,root,root)
|
|
|
|
/usr/sbin/dhcrelay
|
|
|
|
/usr/sbin/rcdhcrelay
|
|
|
|
%config /etc/init.d/dhcrelay
|
|
|
|
%doc %{_mandir}/man8/dhcrelay.8.gz
|
|
|
|
/var/adm/fillup-templates/sysconfig.dhcrelay
|
|
|
|
|
|
|
|
%files devel
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%_libdir/lib*
|
|
|
|
%{_prefix}/include/*
|
|
|
|
%doc %{_mandir}/man3/omshell.3.gz
|
|
|
|
%doc %{_mandir}/man3/omapi.3.gz
|
|
|
|
%doc %{_mandir}/man3/dhcpctl.3.gz
|
|
|
|
|
2007-02-25 23:22:54 +01:00
|
|
|
%changelog
|