%define major_version 4.4.1 %define patch_version %{nil} %define var_dhcpd %{_var}/lib/dhcpd %define var_dhclient %{_var}/lib/dhclient Name: dhcp Epoch: 3 Version: %{major_version}%{patch_version} Release: 4 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}%{patch_version}/%{name}-%{major_version}%{patch_version}.tar.gz #Source1: ftp://ftp.isc.org/isc/%{name}/%{major_version}%{patch_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 Source12: dhcpd.service Source14: dhcpd6.service Source16: dhcrelay.service Source17: dhcpd.tmpfiles Source18: dhclient.tmpfiles Source19: dhcrelay.tmpfiles # sysusers.d(5) (systemd-sysusers) Source20: isc-dhcpd.conf #Source21: isc-dhcp-client.conf # Per-interface dhclient service from Arch Linux (modified) Source22: dhclient@.service Source100: ROSA-NEWS Patch17: dhcp-4.2.0-add_timeout_when_NULL.patch Patch18: dhcp-4.3.0-64_bit_lease_parse.patch Patch19: Arch-0002-iproute2.patch # Starting from dhcp 4.x built in Bind libs are used #BuildRequires: bind-devel BuildRequires: groff-base BuildRequires: groff-for-man BuildRequires: libtool BuildRequires: openldap-devel BuildRequires: systemd-units # --with-ldap-gssapi BuildRequires: krb5-devel BuildRequires: pkgconfig(libcap-ng) Requires(post,preun): rpm-helper Requires: bash %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 = %{EVRD} Requires(post): systemd-units Requires(post,preun): rpm-helper %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 = %{EVRD} Requires(post): systemd-units %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 = %{EVRD} Requires(post): systemd-units Requires(post,preun): rpm-helper %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 = %{EVRD} %description devel DHCP devel contains all of the libraries and headers for developing with the Internet Software Consortium (ISC) dhcpctl API. %package -n openldap-schemas-%{name} summary: OpenLDAP schema files from %{name}-%{EVRD} source tree Group: Databases BuildArch: noarch Requires(pre): openldap-config %prep %setup -q -n %{name}-%{major_version}%{patch_version} #%setup pushd bind ; tar -xvf bind.tar.gz >/dev/null ; popd # 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 # change ipconfig to modern ip (from Arch) %patch19 -p1 # change hardcoded paths from /sbin/dhc* to /usr/sbin/dhc*, if there are any sed -i 'includes/dhcpd.h' -e 's,\"/sbin/dhc,\"/usr/sbin/dhc,g' || true %build %serverbuild_hardened %configure2_5x \ --with-srv-lease-file=%{var_dhcpd}/dhcpd.leases \ --with-srv6-lease-file=%{var_dhcpd}/dhcpd6.leases \ --with-cli-lease-file=%{var_dhclient}/dhclient.leases \ --with-cli6-lease-file=%{var_dhclient}/dhclient6.leases \ --with-srv-pid-file=/run/dhcpd/dhcpd.pid \ --with-srv6-pid-file=/run/dhcpd/dhcpd6.pid \ --with-cli-pid-file=/run/dhclient/dhclient.pid \ --with-cli6-pid-file=/run/dhclient/dhclient6.pid \ --with-relay-pid-file=/run/dhcrelay/dhcrelay.pid \ --enable-paranoia \ --enable-early-chroot \ --with-ldap \ --with-ldapcrypto \ --with-ldap-gssapi make %install %makeinstall_std install -m0644 %{SOURCE10} doc install -m0644 %{SOURCE100} ROSA-NEWS install -d %{buildroot}/sbin mv %{buildroot}%{_sbindir}/dhclient %{buildroot}/sbin/dhclient install -m 755 client/scripts/linux %{buildroot}/sbin/dhclient-script install -d %{buildroot}%{_unitdir} install -m 644 %{SOURCE12} %{buildroot}%{_unitdir}/dhcpd.service install -m 644 %{SOURCE14} %{buildroot}%{_unitdir}/dhcpd6.service install -m 644 %{SOURCE16} %{buildroot}%{_unitdir}/dhcrelay.service install -m 644 %{SOURCE22} %{buildroot}%{_unitdir}/ install -D -p -m 644 %{SOURCE17} %{buildroot}%{_tmpfilesdir}/dhcpd.conf install -D -p -m 644 %{SOURCE18} %{buildroot}%{_tmpfilesdir}/dhclient.conf install -D -p -m 644 %{SOURCE19} %{buildroot}%{_tmpfilesdir}/dhcrelay.conf install -d %{buildroot}%{_sysusersdir} install -m 644 %{SOURCE20} %{buildroot}%{_sysusersdir}/ #install -m 644 %{SOURCE21} %{buildroot}%{_sysusersdir}/ install -m 755 %{SOURCE7} %{SOURCE8} %{buildroot}%{_sbindir} install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir} install -m 755 contrib/ldap/dhcpd-conf-to-ldap %{buildroot}%{_sbindir} # install exit-hooks script to /etc/ install -m 755 %{SOURCE9} %{buildroot}%{_sysconfdir} install -d %{buildroot}%{_sysconfdir}/sysconfig cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcpd < %{buildroot}%{_sysconfdir}/sysconfig/dhcrelay < %{buildroot}%{_sysconfdir}/openldap/slapd.d/%{name}.conf <&1 >/dev/null || true %files common %doc README ROSA-NEWS contrib/ldap/README.ldap RELNOTES %doc contrib/3.0b1-lease-convert %{_mandir}/man5/dhcp-options.5* %files doc %doc doc/* %files server %doc server/dhcpd.conf.example tests/failover contrib/ldap/dhcp.schema %{_unitdir}/dhcpd.service %{_unitdir}/dhcpd6.service %{_tmpfilesdir}/dhcpd.conf %config(noreplace) %{_sysconfdir}/dhcpd.conf %config(noreplace) %{_sysconfdir}/dhclient-exit-hooks %config(noreplace) %{_sysconfdir}/sysconfig/dhcpd %{_sbindir}/dhcpd %{_sbindir}/dhcpreport.pl %{_sbindir}/dhcpd-conf-to-ldap %{_sbindir}/dhcpd-chroot.sh %{_bindir}/omshell %{_mandir}/man1/omshell.1* %{_mandir}/man3/omapi.3* %{_mandir}/man5/dhcpd.conf.5* %{_mandir}/man5/dhcpd.leases.5* %{_mandir}/man5/dhcp-eval.5* %{_mandir}/man8/dhcpd.8* %config %{_sysusersdir}/isc-dhcpd.conf %files relay %{_unitdir}/dhcrelay.service %{_tmpfilesdir}/dhcrelay.conf %config(noreplace) %{_sysconfdir}/sysconfig/dhcrelay %{_sbindir}/dhcrelay %{_mandir}/man8/dhcrelay.8* %files client %doc client/dhclient.conf.example %attr (0755,root,root) /sbin/dhclient-script %{_tmpfilesdir}/dhclient.conf %{_unitdir}/dhclient@.service /sbin/dhclient %{_mandir}/man5/dhclient.conf.5* %{_mandir}/man5/dhclient.leases.5* %{_mandir}/man8/dhclient.8* %{_mandir}/man8/dhclient-script.8* %files devel %{_includedir}/* %{_mandir}/man3/* %exclude %{_mandir}/man3/omapi.3* %files -n openldap-schemas-%{name} %config(noreplace) %{_sysconfdir}/openldap/schema/* %attr(750,ldap,ldap) %config(noreplace) %{_sysconfdir}/openldap/slapd.d/%{name}.conf