2007-01-10 17:39:58 +01:00
|
|
|
#
|
2010-12-13 12:54:52 +01:00
|
|
|
# spec file for package dhcp (Version 4.2.0.P2)
|
2007-01-10 17:39:58 +01:00
|
|
|
#
|
2010-01-14 16:36:26 +01:00
|
|
|
# Copyright (c) 2010 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
|
|
|
|
|
2010-12-13 09:59:07 +01:00
|
|
|
%define isc_version 4.2.0-P2
|
2010-05-14 00:27:05 +02:00
|
|
|
%define susefw2dir %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services
|
|
|
|
%define omc_prefix /usr/share/omc
|
|
|
|
%define omc_svcdir %{omc_prefix}/svcinfo.d
|
|
|
|
%define with_ldap 1
|
2010-12-07 15:52:41 +01:00
|
|
|
%define with_ldapcasa 0%{?sles_version} > 0
|
2008-04-01 23:02:39 +02:00
|
|
|
|
2007-01-10 17:39:58 +01:00
|
|
|
Name: dhcp
|
2010-12-07 15:52:41 +01:00
|
|
|
%if 0%{?with_ldap}
|
|
|
|
%if 0%{?with_ldapcasa}
|
2007-02-25 23:22:54 +01:00
|
|
|
BuildRequires: CASA-devel
|
2010-12-07 15:52:41 +01:00
|
|
|
%endif
|
2010-05-14 00:27:05 +02:00
|
|
|
BuildRequires: openldap2-devel
|
2007-02-25 23:22:54 +01:00
|
|
|
%endif
|
2010-05-14 00:27:05 +02:00
|
|
|
BuildRequires: dos2unix
|
2010-01-14 16:36:26 +01:00
|
|
|
License: BSD3c(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
|
2010-12-13 09:59:07 +01:00
|
|
|
Version: 4.2.0.P2
|
2010-12-13 12:54:52 +01:00
|
|
|
Release: 1
|
2007-01-10 17:39:58 +01:00
|
|
|
Summary: Common Files Used by ISC DHCP Software
|
2010-05-14 00:27:05 +02:00
|
|
|
Url: http://www.isc.org/software/dhcp
|
2010-04-30 01:02:03 +02:00
|
|
|
Source0: dhcp-%{isc_version}.tar.bz2
|
2010-05-14 00:27:05 +02:00
|
|
|
#
|
|
|
|
Source10: rc.dhcpd
|
|
|
|
Source11: rc.dhcpd6
|
|
|
|
Source12: rc.dhcrelay
|
2010-05-18 20:37:44 +02:00
|
|
|
Source13: rc.dhcrelay6
|
2010-05-14 00:27:05 +02:00
|
|
|
Source14: sysconfig.dhcpd
|
|
|
|
Source15: sysconfig.syslog-dhcpd
|
|
|
|
Source16: sysconfig.dhcrelay
|
|
|
|
Source19: if-up.d.dhcpd-restart-hook
|
|
|
|
#
|
|
|
|
Source20: dhclient.conf
|
|
|
|
Source21: dhclient6.conf
|
|
|
|
Source22: dhcpd.conf
|
|
|
|
Source23: dhcpd6.conf
|
|
|
|
Source24: dhclient-script
|
|
|
|
#
|
|
|
|
Source30: dhcpd.xml
|
|
|
|
Source31: dhcpd6.xml
|
|
|
|
Source32: SuSEfirewall2.dhcp-server
|
|
|
|
#
|
|
|
|
Source40: dhcp.LIESMICH
|
|
|
|
Source41: dhcp.README
|
|
|
|
Source42: dhcp.README.upgrade
|
|
|
|
Source43: DDNS-howto.txt
|
|
|
|
Source44: contrib.tar.gz
|
|
|
|
Source45: examples.tar.gz
|
|
|
|
#
|
|
|
|
Patch10: dhcp-4.1.1-default-paths.diff
|
|
|
|
# paranoia patch is included now, but not the
|
|
|
|
# additional patch by thomas@suse.de not ...
|
|
|
|
Patch11: dhcp-4.1.1-paranoia.diff
|
|
|
|
Patch12: dhcp-4.1.1-man-includes.diff
|
|
|
|
Patch13: dhcp-4.1.1-tmpfile.diff
|
|
|
|
Patch14: dhcp-4.1.1-in6_pktinfo-prototype.diff
|
2010-09-29 12:28:25 +02:00
|
|
|
Patch15: contrib-lease-path.diff
|
2010-05-14 00:27:05 +02:00
|
|
|
Patch20: dhcp-4.1.1-dhclient-exec-filedes.diff
|
2010-11-26 15:57:47 +01:00
|
|
|
Patch21: dhcp-4.2.0-P1-dhclient-send-hostname-rml.diff
|
2009-10-03 00:32:25 +02:00
|
|
|
## patch lives here: http://www.suse.de/~mt/git/dhcp-ldap.git/
|
2010-11-26 15:57:47 +01:00
|
|
|
Patch30: dhcp-4.2.0-P1-ldap-patch-mt01.diff.bz2
|
|
|
|
Patch39: dhcp-4.2.0-P1-no-libcrypto.diff
|
2010-07-02 13:06:17 +02:00
|
|
|
Patch40: dhcp-4.1.1-P1-lpf-bind-msg-fix.diff
|
2010-11-02 11:29:02 +01:00
|
|
|
Patch41: dhcp-4.1.1-P1-relay-no-ip-on-interface.diff
|
2010-11-02 12:55:23 +01:00
|
|
|
Patch42: dhcp-4.1.1-P1-optional-value-infinite-loop.diff
|
2008-09-13 00:24:42 +02:00
|
|
|
##
|
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
|
2010-01-14 16:36:26 +01:00
|
|
|
License: BSD3c(or similar)
|
2007-01-10 17:39:58 +01:00
|
|
|
Summary: ISC DHCP Server
|
|
|
|
Group: Productivity/Networking/Boot/Servers
|
2010-05-14 00:27:05 +02:00
|
|
|
Requires: net-tools dhcp = %{version}
|
2007-01-10 17:39:58 +01:00
|
|
|
PreReq: %insserv_prereq %fillup_prereq /bin/cat /bin/mkdir /bin/cp /usr/sbin/useradd
|
2010-05-14 00:27:05 +02:00
|
|
|
Provides: dhcp_server dhcp_server6
|
2007-11-22 18:09:01 +01:00
|
|
|
AutoReqProv: on
|
|
|
|
|
2007-01-10 17:39:58 +01:00
|
|
|
%package client
|
2010-01-14 16:36:26 +01:00
|
|
|
License: BSD3c(or similar)
|
2007-01-10 17:39:58 +01:00
|
|
|
Summary: ISC DHCP Client
|
|
|
|
Group: Productivity/Networking/Boot/Clients
|
2010-05-14 00:27:05 +02:00
|
|
|
Requires: net-tools dhcp = %{version} /sbin/arping /usr/bin/host
|
|
|
|
PreReq: %insserv_prereq %fillup_prereq /bin/cat /bin/mkdir /bin/cp /bin/grep
|
|
|
|
Provides: dhcp_client dhcp_client6
|
2007-11-22 18:09:01 +01:00
|
|
|
AutoReqProv: on
|
|
|
|
|
2007-01-10 17:39:58 +01:00
|
|
|
%package relay
|
2010-01-14 16:36:26 +01:00
|
|
|
License: BSD3c(or similar)
|
2010-05-14 00:27:05 +02:00
|
|
|
Summary: ISC DHCP Relay Agent
|
2007-01-10 17:39:58 +01:00
|
|
|
Group: Productivity/Networking/Boot/Servers
|
2010-05-14 00:27:05 +02:00
|
|
|
Requires: net-tools dhcp = %{version}
|
2007-01-10 17:39:58 +01:00
|
|
|
PreReq: %insserv_prereq %fillup_prereq /bin/cat /bin/mkdir /bin/cp
|
2010-05-14 00:27:05 +02:00
|
|
|
Provides: dhcp_relay dhcp_relay6
|
2007-11-22 18:09:01 +01:00
|
|
|
AutoReqProv: on
|
|
|
|
|
2007-01-10 17:39:58 +01:00
|
|
|
%package devel
|
2010-01-14 16:36:26 +01:00
|
|
|
License: BSD3c(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}
|
|
|
|
|
2010-05-14 00:27:05 +02:00
|
|
|
%package doc
|
|
|
|
License: BSD3c(or similar)
|
|
|
|
Summary: Documentation
|
|
|
|
Group: Productivity/Networking/Boot/Servers
|
2007-01-10 17:39:58 +01:00
|
|
|
|
2010-05-14 00:27:05 +02:00
|
|
|
%description
|
|
|
|
This package contains common programs used by both the ISC DHCP
|
|
|
|
server ("dhcp-server" package) and client ("dhcp-client") as the
|
|
|
|
omshell and common manual pages.
|
2007-01-10 17:39:58 +01:00
|
|
|
|
|
|
|
Authors:
|
|
|
|
--------
|
2010-05-14 00:27:05 +02:00
|
|
|
Internet Systems Consortium, Inc. <info@isc.org>
|
|
|
|
|
2010-05-07 16:12:44 +02:00
|
|
|
|
2007-01-10 17:39:58 +01:00
|
|
|
%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:
|
|
|
|
--------
|
2010-05-14 00:27:05 +02:00
|
|
|
Internet Systems Consortium, Inc. <info@isc.org>
|
|
|
|
|
2010-05-07 16:12:44 +02:00
|
|
|
|
2007-01-10 17:39:58 +01:00
|
|
|
%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:
|
|
|
|
--------
|
2010-05-14 00:27:05 +02:00
|
|
|
Internet Systems Consortium, Inc. <info@isc.org>
|
2007-01-10 17:39:58 +01:00
|
|
|
|
|
|
|
%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.
|
|
|
|
|
|
|
|
|
2010-05-14 00:27:05 +02:00
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
Internet Systems Consortium, Inc. <info@isc.org>
|
|
|
|
|
|
|
|
%description doc
|
|
|
|
This package contains additional documentation files provided with
|
|
|
|
the software. The manual pages are in the corresponding packages.
|
|
|
|
|
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
Internet Systems Consortium, Inc. <info@isc.org>
|
|
|
|
|
2007-01-10 17:39:58 +01:00
|
|
|
|
|
|
|
%description devel
|
|
|
|
This package contains all of the libraries and headers for developing
|
|
|
|
with the Internet Software Consortium (ISC) dhcpctl API.
|
|
|
|
|
|
|
|
Authors:
|
|
|
|
--------
|
2010-05-14 00:27:05 +02:00
|
|
|
Internet Systems Consortium, Inc. <info@isc.org>
|
|
|
|
|
2010-05-07 16:12:44 +02:00
|
|
|
|
2007-01-10 17:39:58 +01:00
|
|
|
%prep
|
2010-09-29 12:28:25 +02:00
|
|
|
%setup -q -n %{name}-%{isc_version} -a 44 -a 45
|
2008-09-13 00:24:42 +02:00
|
|
|
##
|
|
|
|
%patch10 -p1
|
2010-05-14 00:27:05 +02:00
|
|
|
%patch11 -p1
|
|
|
|
%patch12 -p1
|
|
|
|
%patch13 -p1
|
|
|
|
%patch14 -p1
|
2010-09-29 12:28:25 +02:00
|
|
|
%patch15 -p0
|
2010-05-14 00:27:05 +02:00
|
|
|
%patch20 -p1
|
|
|
|
%patch21 -p1
|
2010-12-07 15:52:41 +01:00
|
|
|
%if 0%{?with_ldap}
|
2010-05-14 00:27:05 +02:00
|
|
|
%patch30 -p1
|
2007-01-10 17:39:58 +01:00
|
|
|
%endif
|
2010-11-26 15:57:47 +01:00
|
|
|
%patch39 -p1
|
2010-07-02 13:06:17 +02:00
|
|
|
%patch40 -p1
|
2010-11-02 12:55:23 +01:00
|
|
|
%patch41 -p1
|
|
|
|
%patch42 -p1
|
2008-09-13 00:24:42 +02:00
|
|
|
##
|
2007-01-10 17:39:58 +01:00
|
|
|
find . -type f -name \*.cat\* -exec rm -f {} \;
|
2008-09-13 00:24:42 +02:00
|
|
|
dos2unix contrib/ms2isc/*
|
2007-01-10 17:39:58 +01:00
|
|
|
|
|
|
|
%build
|
2010-05-14 00:27:05 +02:00
|
|
|
CFLAGS="$RPM_OPT_FLAGS -W -Wall -fno-strict-aliasing -Wno-unused"
|
2007-01-10 17:39:58 +01:00
|
|
|
%ifarch ppc ppc64 s390x
|
|
|
|
# bugs 134590, 171532
|
|
|
|
CFLAGS="$CFLAGS -fsigned-char"
|
|
|
|
%endif
|
2010-01-14 16:36:26 +01:00
|
|
|
%ifarch ia64 %sparc alpha s390x ppc64 x86_64
|
2007-01-10 17:39:58 +01:00
|
|
|
CFLAGS="$CFLAGS -fPIE"
|
|
|
|
%else
|
|
|
|
CFLAGS="$CFLAGS -fpie"
|
|
|
|
%endif
|
2010-05-14 00:27:05 +02:00
|
|
|
LDFLAGS="-pie"
|
|
|
|
FFLAGS="$CFLAGS"
|
|
|
|
CXXFLAGS="$CFLAGS"
|
|
|
|
export RPM_OPT_FLAGS LDFLAGS
|
|
|
|
export CFLAGS FFLAGS CXXFLAGS
|
|
|
|
#
|
|
|
|
%{?suse_update_config:%{suse_update_config -f}}
|
|
|
|
libtoolize --force
|
|
|
|
autoreconf
|
|
|
|
#
|
|
|
|
%configure \
|
|
|
|
--enable-dhcpv6 \
|
|
|
|
--enable-failover \
|
|
|
|
--enable-paranoia \
|
|
|
|
--enable-early-chroot \
|
2010-12-07 15:52:41 +01:00
|
|
|
%if 0%{?with_ldap}
|
2010-11-26 15:57:47 +01:00
|
|
|
--with-ldap \
|
|
|
|
--with-ldapcrypto \
|
2010-12-07 15:52:41 +01:00
|
|
|
%if 0%{with_ldapcasa}
|
2010-11-26 15:57:47 +01:00
|
|
|
--with-ldapcasa \
|
2010-12-07 15:52:41 +01:00
|
|
|
%endif
|
2007-01-10 17:39:58 +01:00
|
|
|
%endif
|
2010-05-14 00:27:05 +02:00
|
|
|
--with-cli-pid-file=%{_localstatedir}/run/dhclient.pid \
|
|
|
|
--with-cli-lease-file=%{_localstatedir}/lib/dhcp/dhclient.leases \
|
|
|
|
--with-cli6-pid-file=%{_localstatedir}/run/dhclient6.pid \
|
|
|
|
--with-cli6-lease-file=%{_localstatedir}/lib/dhcp6/dhclient.leases \
|
|
|
|
--with-srv-pid-file=%{_localstatedir}/run/dhcpd.pid \
|
|
|
|
--with-srv-lease-file=%{_localstatedir}/lib/dhcp/db/dhcpd.leases \
|
|
|
|
--with-srv6-pid-file=%{_localstatedir}/run/dhcpd6.pid \
|
|
|
|
--with-srv6-lease-file=%{_localstatedir}/lib/dhcp6/db/dhcpd6.leases
|
|
|
|
#
|
|
|
|
make %{?_smp_mflags}
|
|
|
|
|
|
|
|
%check
|
2007-01-10 17:39:58 +01:00
|
|
|
# with a minimal config, see if it runs
|
|
|
|
echo "ddns-update-style interim;" > testconf
|
2010-05-14 00:27:05 +02:00
|
|
|
./server/dhcpd -4 -t -cf testconf || exit 1
|
|
|
|
./server/dhcpd -6 -t -cf testconf || exit 1
|
|
|
|
# check syntax in our scripts
|
|
|
|
bash -n $RPM_SOURCE_DIR/rc.dhcpd
|
|
|
|
bash -n $RPM_SOURCE_DIR/rc.dhcpd6
|
|
|
|
bash -n $RPM_SOURCE_DIR/rc.dhcrelay
|
|
|
|
bash -n $RPM_SOURCE_DIR/rc.dhcrelay6
|
|
|
|
bash -n $RPM_SOURCE_DIR/dhclient-script
|
2007-01-10 17:39:58 +01:00
|
|
|
|
|
|
|
%install
|
2010-05-14 00:27:05 +02:00
|
|
|
export RPM_BUILD_ROOT
|
|
|
|
make install DESTDIR="$RPM_BUILD_ROOT"
|
|
|
|
#
|
|
|
|
# directories
|
|
|
|
install -d -m0755 $RPM_BUILD_ROOT/sbin
|
|
|
|
install -d -m0755 $RPM_BUILD_ROOT%{_sysconfdir}/init.d
|
|
|
|
install -d -m0755 $RPM_BUILD_ROOT/%{susefw2dir}
|
|
|
|
install -d -m0755 $RPM_BUILD_ROOT/%{omc_svcdir}
|
2010-12-07 15:52:41 +01:00
|
|
|
%if 0%{?with_ldap}
|
2010-05-14 00:27:05 +02:00
|
|
|
install -d -m0755 $RPM_BUILD_ROOT%{_sysconfdir}/openldap/schema
|
2010-11-26 15:57:47 +01:00
|
|
|
%endif
|
2010-05-14 00:27:05 +02:00
|
|
|
install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/run
|
|
|
|
install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/adm/fillup-templates
|
|
|
|
# chroot jail
|
|
|
|
install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/{dhcp,dhcp6}/etc
|
|
|
|
install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/{dhcp,dhcp6}/dev
|
|
|
|
install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/{dhcp,dhcp6}/%_lib
|
|
|
|
install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/{dhcp,dhcp6}/var/run
|
|
|
|
install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/{dhcp,dhcp6}/db
|
|
|
|
# move the dhclient binary to /sbin
|
|
|
|
mv -f $RPM_BUILD_ROOT/usr/sbin/dhclient $RPM_BUILD_ROOT/sbin/
|
|
|
|
# provide a ...6 link, so we know it supports DHCPv6
|
|
|
|
ln -sf dhcpd $RPM_BUILD_ROOT%{_sbindir}/dhcpd6
|
|
|
|
ln -sf dhcrelay $RPM_BUILD_ROOT%{_sbindir}/dhcrelay6
|
|
|
|
ln -sf dhclient $RPM_BUILD_ROOT/sbin/dhclient6
|
|
|
|
# install our adopted config examples and dhclient-script:
|
|
|
|
install -m0644 $RPM_SOURCE_DIR/dhcpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/
|
|
|
|
install -m0644 $RPM_SOURCE_DIR/dhcpd6.conf $RPM_BUILD_ROOT%{_sysconfdir}/
|
|
|
|
install -m0644 $RPM_SOURCE_DIR/dhclient.conf $RPM_BUILD_ROOT%{_sysconfdir}/
|
|
|
|
install -m0644 $RPM_SOURCE_DIR/dhclient6.conf $RPM_BUILD_ROOT%{_sysconfdir}/
|
|
|
|
install -m0750 $RPM_SOURCE_DIR/dhclient-script $RPM_BUILD_ROOT/sbin/
|
|
|
|
# init scripts
|
|
|
|
install -m0755 $RPM_SOURCE_DIR/rc.dhcpd \
|
|
|
|
$RPM_BUILD_ROOT%{_sysconfdir}/init.d/dhcpd
|
|
|
|
ln -sf %{_sysconfdir}/init.d/dhcpd \
|
|
|
|
$RPM_BUILD_ROOT%{_sbindir}/rcdhcpd
|
|
|
|
install -m0755 $RPM_SOURCE_DIR/rc.dhcpd6 \
|
|
|
|
$RPM_BUILD_ROOT%{_sysconfdir}/init.d/dhcpd6
|
|
|
|
ln -sf %{_sysconfdir}/init.d/dhcpd6 \
|
|
|
|
$RPM_BUILD_ROOT%{_sbindir}/rcdhcpd6
|
|
|
|
install -m0755 $RPM_SOURCE_DIR/rc.dhcrelay \
|
|
|
|
$RPM_BUILD_ROOT%{_sysconfdir}/init.d/dhcrelay
|
|
|
|
ln -sf %{_sysconfdir}/init.d/dhcrelay \
|
|
|
|
$RPM_BUILD_ROOT%{_sbindir}/rcdhcrelay
|
|
|
|
install -m0755 $RPM_SOURCE_DIR/rc.dhcrelay6 \
|
|
|
|
$RPM_BUILD_ROOT%{_sysconfdir}/init.d/dhcrelay6
|
|
|
|
ln -sf %{_sysconfdir}/init.d/dhcrelay6 \
|
|
|
|
$RPM_BUILD_ROOT%{_sbindir}/rcdhcrelay6
|
|
|
|
# sysconfig files
|
|
|
|
install -m0644 $RPM_SOURCE_DIR/sysconfig.dhcpd \
|
|
|
|
$RPM_BUILD_ROOT%{_localstatedir}/adm/fillup-templates/
|
|
|
|
install -m0644 $RPM_SOURCE_DIR/sysconfig.syslog-dhcpd \
|
|
|
|
$RPM_BUILD_ROOT%{_localstatedir}/adm/fillup-templates/
|
|
|
|
install -m0644 $RPM_SOURCE_DIR/sysconfig.dhcrelay \
|
|
|
|
$RPM_BUILD_ROOT%{_localstatedir}/adm/fillup-templates/
|
|
|
|
# another config files and scripts
|
2010-12-07 15:52:41 +01:00
|
|
|
%if 0%{?with_ldap}
|
2010-11-26 15:57:47 +01:00
|
|
|
install -m0644 contrib/ldap/dhcp.schema \
|
2010-05-14 00:27:05 +02:00
|
|
|
$RPM_BUILD_ROOT%{_sysconfdir}/openldap/schema
|
2010-11-26 15:57:47 +01:00
|
|
|
%endif
|
2010-05-14 00:27:05 +02:00
|
|
|
install -m0644 $RPM_SOURCE_DIR/dhcpd.xml \
|
|
|
|
$RPM_SOURCE_DIR/dhcpd6.xml \
|
|
|
|
$RPM_BUILD_ROOT/%{omc_svcdir}/
|
|
|
|
install -m0644 $RPM_SOURCE_DIR/SuSEfirewall2.dhcp-server \
|
|
|
|
$RPM_BUILD_ROOT/%{susefw2dir}/dhcp-server
|
|
|
|
install -d -m0755 $RPM_BUILD_ROOT/etc/sysconfig/network/if-up.d
|
|
|
|
install -d -m0755 $RPM_BUILD_ROOT/etc/sysconfig/network/scripts
|
|
|
|
install -m0755 $RPM_SOURCE_DIR/if-up.d.dhcpd-restart-hook \
|
2009-08-13 18:04:28 +02:00
|
|
|
$RPM_BUILD_ROOT/etc/sysconfig/network/scripts/dhcpd-restart-hook
|
|
|
|
ln -sf ../scripts/dhcpd-restart-hook \
|
|
|
|
$RPM_BUILD_ROOT/etc/sysconfig/network/if-up.d/60-dhcpd-restart-hook
|
2010-05-14 00:27:05 +02:00
|
|
|
# fix manual page permissions
|
|
|
|
find $RPM_BUILD_ROOT/%{_mandir} -type f | xargs chmod 644
|
|
|
|
# copy some documentation and examples from src dir
|
|
|
|
install -m0644 $RPM_SOURCE_DIR/dhcp.LIESMICH LIESMICH.SuSE
|
|
|
|
install -m0644 $RPM_SOURCE_DIR/dhcp.README README.SuSE
|
|
|
|
install -m0644 $RPM_SOURCE_DIR/dhcp.README.upgrade README.upgrade
|
|
|
|
install -m0644 $RPM_SOURCE_DIR/DDNS-howto.txt .
|
2010-09-29 12:28:25 +02:00
|
|
|
cp doc/examples/* ./examples/
|
2010-05-14 00:27:05 +02:00
|
|
|
rm -f doc/{References.xml,Makefile*}
|
|
|
|
rm -f contrib/dhcp.spec
|
2007-01-10 17:39:58 +01:00
|
|
|
|
|
|
|
%pre server
|
|
|
|
/usr/sbin/useradd -r -g nogroup -s /bin/false -c "DHCP server daemon" -d /var/lib/dhcp dhcpd 2> /dev/null ||:
|
|
|
|
|
|
|
|
%post server
|
2010-05-14 00:27:05 +02:00
|
|
|
%{fillup_and_insserv -n dhcpd dhcpd dhcpd6}
|
|
|
|
%{fillup_only -ans syslog dhcpd}
|
|
|
|
# update?
|
|
|
|
if [ ${FIRST_ARG:-0} -gt 1 ]; then
|
|
|
|
if grep -q '^DHCPD_RUN_AS=.*nobody' etc/sysconfig/dhcpd; then
|
2007-01-10 17:39:58 +01:00
|
|
|
tmpfile=$(mktemp -q etc/sysconfig/dhcpd.XXXXXX)
|
2010-05-14 00:27:05 +02:00
|
|
|
sed 's|^DHCPD_RUN_AS=.*|DHCPD_RUN_AS="dhcpd"|' etc/sysconfig/dhcpd \
|
2007-01-10 17:39:58 +01:00
|
|
|
> $tmpfile && mv $tmpfile etc/sysconfig/dhcpd
|
|
|
|
rm -f $tmpfile
|
2010-05-14 00:27:05 +02:00
|
|
|
fi
|
|
|
|
if grep -q '^DHCPD_BINARY=.*dhcpd\..*' etc/sysconfig/dhcpd; then
|
|
|
|
tmpfile=$(mktemp -q etc/sysconfig/dhcpd.XXXXXX)
|
|
|
|
sed 's|^DHCPD_BINARY=.*|DHCPD_BINARY=""|' etc/sysconfig/dhcpd \
|
|
|
|
> $tmpfile && mv $tmpfile etc/sysconfig/dhcpd
|
|
|
|
rm -f $tmpfile
|
|
|
|
fi
|
2007-01-10 17:39:58 +01:00
|
|
|
fi
|
|
|
|
exit 0
|
|
|
|
|
2010-05-14 00:27:05 +02:00
|
|
|
%preun server
|
|
|
|
%stop_on_removal dhcpd
|
|
|
|
%stop_on_removal dhcpd6
|
|
|
|
|
2007-01-10 17:39:58 +01:00
|
|
|
%postun server
|
|
|
|
%restart_on_update dhcpd
|
2010-05-14 00:27:05 +02:00
|
|
|
%restart_on_update dhcpd6
|
2007-01-10 17:39:58 +01:00
|
|
|
%insserv_cleanup
|
|
|
|
|
2010-05-14 00:26:56 +02:00
|
|
|
%post relay
|
2010-11-30 22:53:03 +01:00
|
|
|
%{rename_sysconfig_variable -f etc/sysconfig/dhcrelay
|
|
|
|
DHCRELAY6_LOWER_INTERFACES_ARGS DHCRELAY6_LOWER_INTERFACES}
|
|
|
|
%{rename_sysconfig_variable -f etc/sysconfig/dhcrelay
|
|
|
|
DHCRELAY6_UPPER_INTERFACES_ARGS DHCRELAY6_UPPER_INTERFACES}
|
2010-05-14 00:27:05 +02:00
|
|
|
%{fillup_and_insserv -n dhcrelay dhcrelay dhcrelay6}
|
|
|
|
|
|
|
|
%preun relay
|
|
|
|
%stop_on_removal dhcrelay
|
|
|
|
%stop_on_removal dhcrelay6
|
2007-01-10 17:39:58 +01:00
|
|
|
|
|
|
|
%postun relay
|
|
|
|
%restart_on_update dhcrelay
|
2010-05-14 00:27:05 +02:00
|
|
|
%restart_on_update dhcrelay6
|
2007-01-10 17:39:58 +01:00
|
|
|
%insserv_cleanup
|
|
|
|
|
2010-04-30 01:02:03 +02:00
|
|
|
%post client
|
2010-05-14 00:27:05 +02:00
|
|
|
test -e %{_localstatedir}/lib/dhcp/dhclient.leases || \
|
|
|
|
touch %{_localstatedir}/lib/dhcp/dhclient.leases
|
|
|
|
test -e %{_localstatedir}/lib/dhcp6/dhclient6.leases || \
|
|
|
|
touch %{_localstatedir}/lib/dhcp6/dhclient6.leases
|
2010-04-30 01:02:03 +02:00
|
|
|
|
2007-01-10 17:39:58 +01:00
|
|
|
%clean
|
|
|
|
if ! test -f /.buildenv; then rm -rf $RPM_BUILD_ROOT; fi
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2010-05-14 00:27:05 +02:00
|
|
|
%config %{susefw2dir}/dhcp-server
|
|
|
|
%{_bindir}/omshell
|
2007-01-10 17:39:58 +01:00
|
|
|
%doc %{_mandir}/man1/omshell.1.gz
|
|
|
|
%doc %{_mandir}/man5/dhcp-eval.5.gz
|
2010-05-14 00:27:05 +02:00
|
|
|
%doc %{_mandir}/man5/dhcp-options.5.gz
|
|
|
|
|
|
|
|
%files doc
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc LICENSE README RELNOTES
|
|
|
|
%doc LIESMICH.* README.*
|
|
|
|
%doc DDNS-howto.txt doc/*
|
|
|
|
%doc contrib examples
|
2007-01-10 17:39:58 +01:00
|
|
|
|
|
|
|
%files server
|
|
|
|
%defattr(-,root,root)
|
2010-05-14 00:27:05 +02:00
|
|
|
%{_sbindir}/dhcpd
|
|
|
|
%{_sbindir}/dhcpd6
|
|
|
|
%{_sbindir}/rcdhcpd
|
|
|
|
%{_sbindir}/rcdhcpd6
|
|
|
|
%config %{_sysconfdir}/init.d/dhcpd
|
|
|
|
%config %{_sysconfdir}/init.d/dhcpd6
|
|
|
|
%config(noreplace) %{_sysconfdir}/dhcpd.conf
|
|
|
|
%config(noreplace) %{_sysconfdir}/dhcpd6.conf
|
|
|
|
%dir %{_localstatedir}/lib/dhcp
|
|
|
|
%dir %{_localstatedir}/lib/dhcp/etc
|
|
|
|
%dir %{_localstatedir}/lib/dhcp/dev
|
|
|
|
%dir %{_localstatedir}/lib/dhcp/%_lib
|
|
|
|
%dir %{_localstatedir}/lib/dhcp/var
|
|
|
|
%dir %{_localstatedir}/lib/dhcp/var/run
|
|
|
|
%attr(755,dhcpd,root) %dir %{_localstatedir}/lib/dhcp/db
|
|
|
|
%dir %{_localstatedir}/lib/dhcp6
|
|
|
|
%dir %{_localstatedir}/lib/dhcp6/etc
|
|
|
|
%dir %{_localstatedir}/lib/dhcp6/dev
|
|
|
|
%dir %{_localstatedir}/lib/dhcp6/%_lib
|
|
|
|
%dir %{_localstatedir}/lib/dhcp6/var
|
|
|
|
%dir %{_localstatedir}/lib/dhcp6/var/run
|
|
|
|
%attr(755,dhcpd,root) %dir %{_localstatedir}/lib/dhcp6/db
|
|
|
|
%doc %{_mandir}/man8/dhcpd.8.gz
|
2007-01-10 17:39:58 +01:00
|
|
|
%doc %{_mandir}/man5/dhcpd.conf.5.gz
|
|
|
|
%doc %{_mandir}/man5/dhcpd.leases.5.gz
|
2010-12-07 15:52:41 +01:00
|
|
|
%if 0%{?with_ldap}
|
2010-05-14 00:27:05 +02:00
|
|
|
%dir %{_sysconfdir}/openldap
|
|
|
|
%dir %{_sysconfdir}/openldap/schema
|
|
|
|
%attr(0644, root, root) %config %{_sysconfdir}/openldap/schema/dhcp.schema
|
2007-01-10 17:39:58 +01:00
|
|
|
%endif
|
|
|
|
%{omc_svcdir}/dhcpd.xml
|
2010-05-14 00:27:05 +02:00
|
|
|
%{omc_svcdir}/dhcpd6.xml
|
|
|
|
%{_sysconfdir}/sysconfig/network/scripts/dhcpd-restart-hook
|
|
|
|
%{_sysconfdir}/sysconfig/network/if-up.d/60-dhcpd-restart-hook
|
|
|
|
%{_localstatedir}/adm/fillup-templates/sysconfig.dhcpd
|
|
|
|
%{_localstatedir}/adm/fillup-templates/sysconfig.syslog-dhcpd
|
2007-01-10 17:39:58 +01:00
|
|
|
|
|
|
|
%files client
|
|
|
|
%defattr(-,root,root)
|
|
|
|
/sbin/dhclient
|
2010-05-14 00:27:05 +02:00
|
|
|
/sbin/dhclient6
|
2007-01-10 17:39:58 +01:00
|
|
|
/sbin/dhclient-script
|
2010-05-14 00:27:05 +02:00
|
|
|
%config(noreplace) %{_sysconfdir}/dhclient.conf
|
|
|
|
%config(noreplace) %{_sysconfdir}/dhclient6.conf
|
2007-01-10 17:39:58 +01:00
|
|
|
%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
|
2010-05-14 00:27:05 +02:00
|
|
|
%dir %{_localstatedir}/lib/dhcp
|
|
|
|
%dir %{_localstatedir}/lib/dhcp6
|
2007-01-10 17:39:58 +01:00
|
|
|
|
|
|
|
%files relay
|
|
|
|
%defattr(-,root,root)
|
2010-05-14 00:27:05 +02:00
|
|
|
%{_sbindir}/dhcrelay
|
|
|
|
%{_sbindir}/dhcrelay6
|
|
|
|
%{_sbindir}/rcdhcrelay
|
|
|
|
%{_sbindir}/rcdhcrelay6
|
|
|
|
%config %{_sysconfdir}/init.d/dhcrelay
|
|
|
|
%config %{_sysconfdir}/init.d/dhcrelay6
|
2007-01-10 17:39:58 +01:00
|
|
|
%doc %{_mandir}/man8/dhcrelay.8.gz
|
2010-05-14 00:27:05 +02:00
|
|
|
%{_localstatedir}/adm/fillup-templates/sysconfig.dhcrelay
|
2007-01-10 17:39:58 +01:00
|
|
|
|
|
|
|
%files devel
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%_libdir/lib*
|
|
|
|
%{_prefix}/include/*
|
|
|
|
%doc %{_mandir}/man3/omapi.3.gz
|
|
|
|
%doc %{_mandir}/man3/dhcpctl.3.gz
|
|
|
|
|
2007-02-25 23:22:54 +01:00
|
|
|
%changelog
|