dhcp/dhcp.spec

343 lines
11 KiB
RPMSpec
Raw Permalink Normal View History

2013-11-07 15:36:10 +04:00
%define plevel P1
2013-07-31 23:22:01 +04:00
2013-11-07 14:47:27 +04:00
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server/relay agent/client
2012-02-01 14:24:24 +04:00
Name: dhcp
Epoch: 3
2013-11-07 14:47:27 +04:00
Version: 4.2.5
2013-12-30 23:28:40 +04:00
Release: 0.%{?plevel:%{plevel}}.5
2012-02-01 14:24:24 +04:00
License: Distributable
Group: System/Servers
2013-11-07 14:47:27 +04:00
Url: http://www.isc.org/software/dhcp
2013-11-07 16:31:08 +04:00
Source0: ftp://ftp.isc.org/isc/%{name}/%{version}-%{?plevel:%{plevel}}/%{name}-%{version}%{?plevel:-%{plevel}}.tar.gz
Source1: ftp://ftp.isc.org/isc/%{name}/%{version}-%{?plevel:%{plevel}}/%{name}-%{version}%{?plevel:-%{plevel}}.tar.gz.sha512.asc
2012-02-01 14:24:24 +04:00
Source2: dhcpd.conf
Source4: dhcp-dynamic-dns-examples.tar.bz2
Source7: dhcpreport.pl
Source8: dhcpd-chroot.sh
# (eugeni) dhclient-exit-hooks script
Source9: dhclient-exit-hooks
2013-07-31 23:22:01 +04:00
Source10: draft-ietf-dhc-ldap-schema-01.txt
2013-11-07 14:47:27 +04:00
Source11: dhcpd.init
2013-07-31 23:22:01 +04:00
Source12: dhcpd.service
2013-11-07 14:47:27 +04:00
Source13: dhcpd6.init
2013-07-31 23:22:01 +04:00
Source14: dhcpd6.service
2013-11-07 14:47:27 +04:00
Source15: dhcrelay.init
2013-07-31 23:22:01 +04:00
Source16: dhcrelay.service
Source17: dhcpd.tmpfiles
Source18: dhclient.tmpfiles
Source19: dhcrelay.tmpfiles
# mageia patches
Patch100: dhcp-4.2.2-ifup.patch
Patch101: dhcp-4.2.2-fix-format-errors.patch
2012-02-01 14:24:24 +04:00
# prevents needless deassociation, working around mdv bug #43441
2013-07-31 23:22:01 +04:00
Patch102: dhcp-4.1.1-prevent_wireless_deassociation.patch
# fedora patches
2013-11-07 14:47:27 +04:00
# Handle Xen partial UDP checksums
2013-07-31 23:22:01 +04:00
Patch8: dhcp-4.2.2-xen-checksum.patch
2013-11-07 14:47:27 +04:00
# If the ipv6 kernel module is missing, do not segfault
# (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #19367])
2013-07-31 23:22:01 +04:00
Patch15: dhcp-4.2.2-missing-ipv6-not-fatal.patch
2013-11-07 14:47:27 +04:00
# Handle cases in add_timeout() where the function is called with a NULL
# value for the 'when' parameter
2013-07-31 23:22:01 +04:00
Patch17: dhcp-4.2.0-add_timeout_when_NULL.patch
2013-11-07 14:47:27 +04:00
# Ensure 64-bit platforms parse lease file dates & times correctly
2013-07-31 23:22:01 +04:00
Patch18: dhcp-4.2.4-64_bit_lease_parse.patch
2013-11-07 14:47:27 +04:00
BuildRequires: libtool
BuildRequires: groff-base
BuildRequires: systemd-units
BuildRequires: bind-devel
2012-02-01 14:24:24 +04:00
BuildRequires: openldap-devel
%description
DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
individual devices on an IP network to get their own network configuration
information (IP address, subnetmask, broadcast address, etc.) from a DHCP
server. The overall purpose of DHCP is to make it easier to administer a
large network. The dhcp package includes the DHCP server and a DHCP relay
agent. You will also need to install the dhcp-client or dhcpcd package,
or pump or dhcpxd, which provides the DHCP client daemon, on client machines.
If you want the DHCP server and/or relay, you will also need to install the
dhcp-server and/or dhcp-relay packages.
2013-11-07 14:47:27 +04:00
%package common
2012-02-01 14:24:24 +04:00
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server
Group: System/Servers
2013-11-07 14:47:27 +04:00
%description common
2012-02-01 14:24:24 +04:00
DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
individual devices on an IP network to get their own network
configuration information (IP address, subnetmask, broadcast address,
etc.) from a DHCP server. The overall purpose of DHCP is to make it
easier to administer a large network. The dhcp package includes the
DHCP server and a DHCP relay agent.
You will also need to install the dhcp-client or dhcpcd package, or pump or
dhcpxd, which provides the DHCP client daemon, on client machines. If you
want the DHCP server and/or relay, you will also need to install the
dhcp-server and/or dhcp-relay packages.
2013-11-07 14:47:27 +04:00
%package doc
2012-02-01 14:24:24 +04:00
Summary: Documentation about the ISC DHCP server/client
Group: System/Servers
2013-11-07 14:47:27 +04:00
%description doc
2012-02-01 14:24:24 +04:00
This package contains RFC/API/protocol documentation about the ISC
DHCP server and client.
DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
individual devices on an IP network to get their own network
configuration information (IP address, subnetmask, broadcast address,
etc.) from a DHCP server. The overall purpose of DHCP is to make it
easier to administer a large network. The dhcp package includes the
DHCP server and a DHCP relay agent.
2013-11-07 14:47:27 +04:00
%package server
2012-02-01 14:24:24 +04:00
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server
Group: System/Servers
2013-11-07 14:47:27 +04:00
Requires: dhcp-common >= %{EVRD}
Requires(post,preun): rpm-helper
Requires(post,postun): systemd-units
2012-02-01 14:24:24 +04:00
2013-11-07 14:47:27 +04:00
%description server
2012-02-01 14:24:24 +04:00
DHCP server is the Internet Software Consortium (ISC) DHCP server for various
UNIX operating systems. It allows a UNIX mac hine to serve DHCP requests from
the network.
You should install dhcp-server if you want to set up a DHCP server on your
network. You will also need to install the base dhcp package.
2013-11-07 14:47:27 +04:00
%package client
2012-02-01 14:24:24 +04:00
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) client
Group: System/Servers
2013-11-07 14:47:27 +04:00
Requires: dhcp-common >= %{EVRD}
Provides: dhcp-client-daemon
2012-02-01 14:24:24 +04:00
2013-11-07 14:47:27 +04:00
%description client
2012-02-01 14:24:24 +04:00
DHCP client is the Internet Software Consortium (ISC) DHCP client for various
UNIX operating systems. It allows a UNIX mac hine to obtain it's networking
parameters from a DHCP server.
You should install dhcp-client if you want to use the ISC DHCP client instead
of the Red Hat DHCP client, pump, or dhcpcd, or dhcpxd. You will also need to
install the base dhcp package.
2013-11-07 14:47:27 +04:00
%package relay
2012-02-01 14:24:24 +04:00
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) relay
Group: System/Servers
2013-11-07 14:47:27 +04:00
Requires: dhcp-common >= %{EVRD}
Requires(post,preun): rpm-helper
2012-02-01 14:24:24 +04:00
2013-11-07 14:47:27 +04:00
%description relay
2012-02-01 14:24:24 +04:00
DHCP relay is the Internet Software Consortium (ISC) relay agent for DHCP
packets. It is used on a subnet with DHCP clients to "relay" their requests
to a subnet that has a DHCP server on it. Because DHCP packets can be
broadcast, they will not be routed off of the local subnet. The DHCP relay
takes care of this for the client. You will need to set the environment
2013-11-07 14:47:27 +04:00
variable SERVERS and optionally OPTIONS in %{_sysconfdir}/sysconfig/dhcrelay before
2012-02-01 14:24:24 +04:00
starting the server.
2013-11-07 14:47:27 +04:00
%package devel
2012-02-01 14:24:24 +04:00
Summary: Development headers and libraries for the dhcpctl API
Group: Development/Other
2013-11-07 14:47:27 +04:00
Requires: dhcp-common >= %{EVRD}
2012-02-01 14:24:24 +04:00
2013-11-07 14:47:27 +04:00
%description devel
2012-02-01 14:24:24 +04:00
DHCP devel contains all of the libraries and headers for developing with the
Internet Software Consortium (ISC) dhcpctl API.
%prep
2013-11-07 14:47:27 +04:00
%setup -qn %{name}-%{version}%{?plevel:-%{plevel}}
%apply_patches
autoreconf -fi
# remove empty files
find -size 0 |grep ldap | xargs rm -rf
2013-07-31 23:22:01 +04:00
2013-11-07 14:47:27 +04:00
cp %{SOURCE10} doc
2012-02-01 14:24:24 +04:00
%build
2013-11-07 14:47:27 +04:00
%serverbuild_hardened
%configure2_5x \
--enable-paranoia \
--enable-early-chroot \
--with-ldapcrypto \
--with-srv-lease-file=%{_localstatedir}/lib/dhcp/dhcpd.leases \
--with-srv6-lease-file=%{_localstatedir}/lib/dhcp/dhcpd6.leases \
--with-cli-lease-file=%{_localstatedir}/lib/dhcp/dhclient.leases \
--with-cli6-lease-file=%{_localstatedir}/lib/dhcp/dhclient6.leases \
--with-srv-pid-file=%{_var}/run/dhcpd/dhcpd.pid \
--with-srv6-pid-file=%{_var}/run/dhcpd/dhcpd6.pid \
--with-cli-pid-file=%{_var}/run/dhclient.pid \
--with-cli6-pid-file=%{_var}/run/dhclient6.pid \
--with-relay-pid-file=%{_var}/run/dhcrelay.pid
2012-02-01 14:24:24 +04:00
%make
%install
%makeinstall_std
# Install correct dhclient-script
2013-11-07 14:47:27 +04:00
install -p -m755 client/scripts/linux -D %{buildroot}/sbin/dhclient-script
2013-07-31 23:22:01 +04:00
mv %{buildroot}%{_sbindir}/dhclient %{buildroot}/sbin/dhclient
2013-11-07 14:47:27 +04:00
install -m644 %{SOURCE12} -D %{buildroot}%{_unitdir}/dhcpd.service
install -m644 %{SOURCE14} -D %{buildroot}%{_unitdir}/dhcpd6.service
install -m644 %{SOURCE16} -D %{buildroot}%{_unitdir}/dhcrelay.service
2012-02-01 14:24:24 +04:00
2013-11-07 17:27:26 +04:00
install -D -p -m 644 %{SOURCE17} %{buildroot}%{_prefix}/lib/tmpfiles.d/dhcpd.conf
install -D -p -m 644 %{SOURCE18} %{buildroot}%{_prefix}/lib/tmpfiles.d/dhclient.conf
install -D -p -m 644 %{SOURCE19} %{buildroot}%{_prefix}/lib/tmpfiles.d/dhcrelay.conf
2012-02-01 14:24:24 +04:00
2013-11-07 14:47:27 +04:00
install -m755 %{SOURCE11} -D %{buildroot}%{_initrddir}/dhcpd
install -m755 %{SOURCE13} -D %{buildroot}%{_initrddir}/dhcpd6
install -m755 %{SOURCE15} -D %{buildroot}%{_initrddir}/dhcrelay
install -m755 %{SOURCE7} -D %{buildroot}%{_sbindir}/dhcpreport.pl
install -m755 %{SOURCE8} -D %{buildroot}%{_sbindir}/dhcpd-chroot.sh
install -m644 %{SOURCE2} -D %{buildroot}%{_sysconfdir}/dhcpd.conf
install -m755 contrib/ldap/dhcpd-conf-to-ldap -D %{buildroot}%{_sbindir}/dhcpd-conf-to-ldap
install -d %{buildroot}%{_var}/lib/dhclient
touch %{buildroot}%{_var}/lib/dhclient/dhclient.leases
2012-02-01 14:24:24 +04:00
# install exit-hooks script to /etc/
2013-11-07 14:47:27 +04:00
install -m755 %{SOURCE9} -D %{buildroot}%{_sysconfdir}/dhclient-exit-hooks
2012-02-01 14:24:24 +04:00
2013-07-31 23:22:01 +04:00
install -d %{buildroot}%{_sysconfdir}/sysconfig
2012-02-01 14:24:24 +04:00
cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcpd <<EOF
# You can set here various option for dhcpd
# Which configuration file to use.
2013-11-07 14:47:27 +04:00
CONFIGFILE="%{_sysconfdir}/dhcpd.conf"
2012-02-01 14:24:24 +04:00
# Where to store the lease state information.
2013-11-07 14:47:27 +04:00
LEASEFILE="%{_localstatedir}/lib/dhcp/dhcpd.leases"
2012-02-01 14:24:24 +04:00
# Define INTERFACES to limit which network interfaces dhcpd listens on.
# The default null value causes dhcpd to listen on all interfaces.
2013-11-07 14:47:27 +04:00
INTERFACES=""
2012-02-01 14:24:24 +04:00
# Define OPTIONS with any other options to pass to the dhcpd server.
# See dhcpd(8) for available options and syntax.
OPTIONS="-q"
2013-11-07 14:47:27 +04:00
2012-02-01 14:24:24 +04:00
EOF
2013-11-07 14:47:27 +04:00
install -d %{buildroot}%{_localstatedir}/lib/dhcp
install -d %{buildroot}%{_var}/run/dhcpd
touch %{buildroot}%{_localstatedir}/lib/dhcp/dhcpd.leases
touch %{buildroot}%{_localstatedir}/lib/dhcp/dhclient.leases
2012-02-01 14:24:24 +04:00
cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcrelay <<EOF
# Define SERVERS with a list of one or more DHCP servers where
# DHCP packets are to be relayed to and from. This is mandatory.
#SERVERS="10.11.12.13 10.9.8.7"
SERVERS=""
# Define OPTIONS with any other options to pass to the dhcrelay server.
# See dhcrelay(8) for available options and syntax.
#OPTIONS="-q -i eth0 -i eth1"
OPTIONS="-q"
EOF
find . -type d -exec chmod 0755 {} \;
find . -type f -exec chmod 0644 {} \;
rm -rf doc/ja_JP.eucJP
# remove empty files
find -size 0 |grep ldap | xargs rm -rf
# remove unwanted file
2013-11-07 14:47:27 +04:00
rm %{buildroot}%{_sysconfdir}/dhclient.conf*
rm %{buildroot}%{_sysconfdir}/dhcpd.conf.example
2012-02-01 14:24:24 +04:00
%post server
%_post_service dhcpd
2013-12-25 07:46:02 -05:00
/bin/systemd-tmpfiles --create dhcpd
# %tmpfiles_create dhcpd
2012-02-01 14:24:24 +04:00
# New dhcpd lease file
2013-11-07 14:47:27 +04:00
if [ ! -f %{_localstatedir}/lib/dhcp/dhcpd.leases ]; then
touch %{_localstatedir}/lib/dhcp/dhcpd.leases
2012-02-01 14:24:24 +04:00
fi
%preun server
%_preun_service dhcpd
%post relay
%_post_service dhcrelay
2013-12-25 07:46:02 -05:00
/bin/systemd-tmpfiles --create dhcrelay
# %tmpfiles_create dhcrelay
2012-02-01 14:24:24 +04:00
%preun relay
%_preun_service dhcrelay
%post client
2013-12-25 07:46:02 -05:00
/bin/systemd-tmpfiles --create dhclient
# %tmpfiles_create dhclient
2013-11-07 14:47:27 +04:00
touch %{_localstatedir}/lib/dhclient/dhclient.leases
2012-02-01 14:24:24 +04:00
%postun client
2013-11-07 14:47:27 +04:00
rm -rf %{_localstatedir}/lib/dhclient/dhclient.leases
2012-02-01 14:24:24 +04:00
%files common
%doc README contrib/ldap/README.ldap RELNOTES
%doc contrib/3.0b1-lease-convert
2013-11-07 14:47:27 +04:00
%dir %{_localstatedir}/lib/dhcp
2012-02-01 14:24:24 +04:00
%{_mandir}/man5/dhcp-options.5*
%files doc
%doc doc/*
%files server
2013-11-07 14:47:27 +04:00
%doc tests/failover contrib/ldap/dhcp.schema
2013-07-31 23:22:01 +04:00
%{_unitdir}/dhcpd.service
%{_unitdir}/dhcpd6.service
2013-11-07 17:27:26 +04:00
%{_prefix}/lib/tmpfiles.d//dhcpd.conf
2013-11-07 14:47:27 +04:00
%{_initrddir}/dhcpd
%{_initrddir}/dhcpd6
2012-02-01 14:24:24 +04:00
%config(noreplace) %{_sysconfdir}/dhcpd.conf
%config(noreplace) %{_sysconfdir}/dhclient-exit-hooks
%config(noreplace) %{_sysconfdir}/sysconfig/dhcpd
2013-11-07 14:47:27 +04:00
%config(noreplace) %ghost %{_localstatedir}/lib/dhcp/dhcpd.leases
2012-02-01 14:24:24 +04:00
%{_sbindir}/dhcpd
%{_sbindir}/dhcpreport.pl
%{_sbindir}/dhcpd-conf-to-ldap
%{_sbindir}/dhcpd-chroot.sh
%{_bindir}/omshell
%{_mandir}/man1/omshell.1*
%{_mandir}/man5/dhcpd.conf.5*
%{_mandir}/man5/dhcpd.leases.5*
%{_mandir}/man5/dhcp-eval.5*
%{_mandir}/man8/dhcpd.8*
2013-11-07 14:47:27 +04:00
%dir %{_var}/run/dhcpd
2012-02-01 14:24:24 +04:00
%files relay
2013-07-31 23:22:01 +04:00
%{_unitdir}/dhcrelay.service
2013-11-07 17:27:26 +04:00
%{_prefix}/lib/tmpfiles.d/dhcrelay.conf
2013-11-07 14:47:27 +04:00
%{_initrddir}/dhcrelay
2012-02-01 14:24:24 +04:00
%config(noreplace) %{_sysconfdir}/sysconfig/dhcrelay
2013-11-07 17:27:26 +04:00
%{_prefix}/lib/tmpfiles.d/dhclient.conf
2012-02-01 14:24:24 +04:00
%{_sbindir}/dhcrelay
%{_mandir}/man8/dhcrelay.8*
%files client
2013-11-07 14:47:27 +04:00
%config(noreplace) %ghost %{_localstatedir}/lib/dhcp/dhclient.leases
%config(noreplace) %ghost %{_var}/lib/dhclient/dhclient.leases
/sbin/dhclient-script
2012-02-01 14:24:24 +04:00
/sbin/dhclient
%{_mandir}/man5/dhclient.conf.5*
%{_mandir}/man5/dhclient.leases.5*
%{_mandir}/man8/dhclient.8*
%{_mandir}/man8/dhclient-script.8*
2013-07-31 23:22:01 +04:00
%dir %{_var}/lib/dhclient
2012-02-01 14:24:24 +04:00
%files devel
%{_includedir}/*
2013-11-07 14:47:27 +04:00
%{_libdir}/*.a
2013-07-31 23:22:01 +04:00
%{_mandir}/man3/*