%define _catdir /var/cache/man %define major_version 4.2.3 %define patch_version P2 Name: dhcp Epoch: 3 Version: %{major_version}%{patch_version} Release: %mkrel 5 Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server/relay agent/client License: Distributable Group: System/Servers URL: http://www.isc.org/software/dhcp Source0: ftp://ftp.isc.org/isc/%{name}/%{major_version}/%{name}-%{major_version}-%{patch_version}.tar.gz Source1: ftp://ftp.isc.org/isc/%{name}/%{major_version}/%{name}-%{major_version}-%{patch_version}.tar.gz.sha512.asc 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 Source10: draft-ietf-dhc-ldap-schema-01.txt Source11: dhcpd.init Source12: dhcpd.service Source13: dhcpd6.init Source14: dhcpd6.service Source15: dhcrelay.init Source16: dhcrelay.service # mageia patches Patch100: dhcp-4.2.2-ifup.patch Patch101: dhcp-4.2.2-fix-format-errors.patch # prevents needless deassociation, working around mdv bug #43441 Patch102: dhcp-4.1.1-prevent_wireless_deassociation.patch # fedora patches Patch8: dhcp-4.2.2-xen-checksum.patch Patch15: dhcp-4.2.2-missing-ipv6-not-fatal.patch Patch17: dhcp-4.2.0-add_timeout_when_NULL.patch Patch18: dhcp-4.2.1-64_bit_lease_parse.patch BuildRequires: groff-for-man BuildRequires: openldap-devel BuildRequires: bind-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. %package common Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server Group: System/Servers %description common 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. %package doc Summary: Documentation about the ISC DHCP server/client Group: System/Servers %description doc 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. %package server Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server Group: System/Servers Requires: dhcp-common = %{epoch}:%{version}-%{release} %description server 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. %package client Summary: The ISC DHCP (Dynamic Host Configuration Protocol) client Group: System/Servers Requires: dhcp-common = %{epoch}:%{version}-%{release} %description client 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. %package relay Summary: The ISC DHCP (Dynamic Host Configuration Protocol) relay Group: System/Servers Requires: dhcp-common = %{epoch}:%{version}-%{release} %description relay 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 variable SERVERS and optionally OPTIONS in /etc/sysconfig/dhcrelay before starting the server. %package devel Summary: Development headers and libraries for the dhcpctl API Group: Development/Other Requires: dhcp-common = %{epoch}:%{version}-%{release} %description devel DHCP devel contains all of the libraries and headers for developing with the Internet Software Consortium (ISC) dhcpctl API. %prep %setup -q -n %{name}-%{major_version}-%{patch_version} %patch100 -p1 -b .ifup %patch101 -p1 -b .format_not_a_string_literal_and_no_format_arguments %patch102 -p1 -b .prevent_wireless_deassociation # Handle Xen partial UDP checksums %patch8 -p1 -b .xen # If the ipv6 kernel module is missing, do not segfault # (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #19367]) %patch15 -p1 -b .noipv6 # Handle cases in add_timeout() where the function is called with a NULL # value for the 'when' parameter %patch17 -p1 -b .dracut # Ensure 64-bit platforms parse lease file dates & times correctly %patch18 -p1 -b .64-bit_lease_parse install -m0644 %{SOURCE10} doc %build %serverbuild %configure2_5x --enable-paranoia --enable-early-chroot \ --with-ldapcrypto \ --with-srv-lease-file=%{_var}/lib/dhcp/dhcpd.leases \ --with-srv6-lease-file=%{_var}/lib/dhcp/dhcpd6.leases \ --with-cli-lease-file=%{_var}/lib/dhcp/dhclient.leases \ --with-cli6-lease-file=%{_var}/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 %make %install rm -rf %{buildroot} install -d %{buildroot}%{_bindir} install -d %{buildroot}%{_sysconfdir}/sysconfig install -d %{buildroot}%{_initrddir} install -d %{buildroot}/lib/systemd/system install -d %{buildroot}%{_var}/lib/dhcp install -d %{buildroot}%{_var}/run/dhcpd %makeinstall_std # Install correct dhclient-script %{__mkdir} -p %{buildroot}/sbin %{__mv} %{buildroot}%{_sbindir}/dhclient %{buildroot}/sbin/dhclient %{__install} -p -m 0755 client/scripts/linux %{buildroot}/sbin/dhclient-script install -m0755 %{SOURCE11} %{buildroot}%{_initrddir}/dhcpd install -m0755 %{SOURCE13} %{buildroot}%{_initrddir}/dhcpd6 install -m0755 %{SOURCE15} %{buildroot}%{_initrddir}/dhcrelay install -m 644 %{SOURCE12} %{buildroot}/lib/systemd/system/dhcpd.service install -m 644 %{SOURCE14} %{buildroot}/lib/systemd/system/dhcpd6.service install -m 644 %{SOURCE16} %{buildroot}/lib/systemd/system/dhcrelay.service install -m0755 %{SOURCE7} %{SOURCE8} %{buildroot}%{_sbindir}/ install -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/ install -m0755 contrib/ldap/dhcpd-conf-to-ldap %{buildroot}%{_sbindir}/ # install exit-hooks script to /etc/ install -m0755 %{SOURCE9} %{buildroot}%{_sysconfdir}/ cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcpd < %{buildroot}%{_sysconfdir}/sysconfig/dhcrelay <