############################################################################### # IPFire.org - An Open Source Firewall Solution # # Copyright (C) - IPFire Development Team # ############################################################################### name = dhcp version = 4.2.2 release = 1 groups = Networking/Daemons url = http://isc.org/products/DHCP/ license = ISC summary = Dynamic host configuration protocol software. 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. end source_dl = ftp://ftp.isc.org/isc/dhcp/ # Apply patches in a special order. patches = \ dhcp-4.2.2-remove-bind.patch \ dhcp-4.2.0-errwarn-message.patch \ dhcp-4.2.2-options.patch \ dhcp-4.2.0-release-by-ifup.patch \ dhcp-4.2.0-dhclient-decline-backoff.patch \ dhcp-4.2.0-unicast-bootp.patch \ dhcp-4.2.2-dhclient-usage.patch \ dhcp-4.2.0-default-requested-options.patch \ dhcp-4.2.2-xen-checksum.patch \ dhcp-4.2.1-manpages.patch \ dhcp-4.2.0-paths.patch \ dhcp-4.2.2-CLOEXEC.patch \ dhcp-4.2.0-inherit-leases.patch \ dhcp-4.2.0-garbage-chars.patch \ dhcp-4.2.0-missing-ipv6-not-fatal.patch \ dhcp-4.2.0-add_timeout_when_NULL.patch \ dhcp-4.2.1-64_bit_lease_parse.patch \ dhcp-4.2.2-capability.patch \ dhcp-4.2.0-logpid.patch \ dhcp-4.2.0-UseMulticast.patch \ dhcp-4.2.1-sendDecline.patch \ dhcp-4.2.1-retransmission.patch \ dhcp-4.2.2-rfc3442-classless-static-routes.patch \ dhcp-4.2.0-honor-expired.patch \ dhcp-4.2.0-noprefixavail.patch \ dhcp-4.2.2-sharedlib.patch \ dhcp-4.2.0-PPP.patch \ dhcp-4.2.2-lpf-ib.patch \ dhcp-4.2.2-improved-xid.patch \ dhcp-4.2.2-gpxe-cid.patch \ dhcp-4.2.2-systemtap.patch build requires autoconf automake bind-devel>=9 bind-devel<10 groff libtool openldap-devel libcap-ng-devel end CFLAGS += \ -fno-strict-aliasing \ -D_GNU_SOURCE \ -Wl,--as-needed configure_options += \ --sysconfdir=/etc \ --with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases \ --with-srv6-lease-file=/var/lib/dhcpd/dhcp6.leases \ --with-cli-lease-file=/var/lib/dhclient/dhclient.leases \ --with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases \ --with-srv-pid-file=/run/dhcpd.pid \ --with-srv6-pid-file=/run/dhcpd6.pid \ --with-cli-pid-file=/run/dhclient.pid \ --with-cli6-pid-file=/run/dhclient6.pid \ --with-relay-pid-file=/run/dhcrelay.pid \ --with-ldap \ --with-ldapcrypto \ --with-libbind=/usr/include/ \ --with-libbind-libs=/usr/lib/ \ --disable-static \ --enable-paranoia \ --enable-early-chroot prepare_cmds # Remove bundled BIND source rm -rvf %{DIR_APP}/bind/bind.tar.gz # Regenerate build environment libtoolize --copy --force autoreconf --verbose --force --install end install_cmds rm -vf %{BUILDROOT}/etc/dhclient.conf # Move the client to /sbin, create dirs # and remove the default config. mkdir -pv %{BUILDROOT}/sbin mv -v %{BUILDROOT}/usr/sbin/dhclient %{BUILDROOT}/sbin/dhclient install -v -m 755 %{DIR_SOURCE}/dhclient-script \ %{BUILDROOT}/sbin/dhclient-script # Create runtime folders. mkdir -pv %{BUILDROOT}/var/lib/dhclient mkdir -pv %{BUILDROOT}/var/lib/dhcpd # Create empty lease files. touch %{BUILDROOT}/var/lib/dhclient/dhclient.leases touch %{BUILDROOT}/var/lib/dhclient/dhclient6.leases touch %{BUILDROOT}/var/lib/dhcpd/dhcpd.leases touch %{BUILDROOT}/var/lib/dhcpd/dhcpd6.leases end end packages package %{name} requires dhcp-common end prerequires += shadow-utils script prein getent group dhcpd >/dev/null || groupadd -r dhcpd getent passwd dhcpd >/dev/null || \ useradd -r -g dhcpd -d /var/lib/dhcpd -s /sbin/nologin \ -c "User for the DHCP server" dhcpd exit 0 end # Just search for new unit files that were just installed. script postin /bin/systemctl daemon-reload >/dev/null 2>&1 || : end # Disable the service that is to be removed and stop it if it is still running. script preun /bin/systemctl --no-reload disable dhcpd.service >/dev/null 2>&1 || : /bin/systemctl --no-reload disable dhcpd6.service >/dev/null 2>&1 || : /bin/systemctl --no-reload disable dhcrelay.service >/dev/null 2>&1 || : /bin/systemctl stop dhcpd.service >/dev/null 2>&1 || : /bin/systemctl stop dhcpd6.service >/dev/null 2>&1 || : /bin/systemctl stop dhcrelay.service >/dev/null 2>&1 || : end # Just tell systemd that unitfiles have been removed. script postun /bin/systemctl daemon-reload >/dev/null 2>&1 || : end # Try to restart the service if it is running. script postup /bin/systemctl daemon-reload >/dev/null 2>&1 || : /bin/systemctl try-restart dhcpd.service >/dev/null 2>&1 || : /bin/systemctl try-restart dhcpd6.service >/dev/null 2>&1 || : /bin/systemctl try-restart dhcrelay.service >/dev/null 2>&1 || : end end package dhclient summary = DHCP client daemon and dhclient-script. description = %{summary} requires dhcp-common end files /sbin /usr/share/man/man5/dhclient* /usr/share/man/man8/dhclient* /var/lib/dhclient end end package %{name}-common summary = Common files used by the dhcp client and server. description = %{summary} files /usr/bin/ /usr/share/man/man1/omshell.1* /usr/share/man/man5/dhcp-options.5* /usr/share/man/man5/dhcp-eval.5* end end package %{name}-libs template LIBS end package %{name}-devel template DEVEL end package %{name}-debuginfo template DEBUGINFO end end