]> git.ipfire.org Git - ipfire-3.x.git/blobdiff - dhcp/dhcp.nm
kernel: Update to 5.1
[ipfire-3.x.git] / dhcp / dhcp.nm
index a60868ddbf6cb720f56e6e7387b1a0534c4e69b2..421c6ca4fa039bd2cc2150f0bd2fb7ad9ac56c28 100644 (file)
@@ -4,8 +4,8 @@
 ###############################################################################
 
 name       = dhcp
-version    = 4.2.1-P1
-release    = 2
+version    = 4.4.1
+release    = 1
 
 groups     = Networking/Daemons
 url        = http://isc.org/products/DHCP/
@@ -13,34 +13,79 @@ 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 \
+       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  =
+source_dl  = ftp://ftp.isc.org/isc/dhcp/%{version}/
 
 build
+       requires
+               autoconf
+               automake
+               bind-devel>=9.9.9-P6
+               bind-devel<10
+               groff
+               libtool
+               openldap-devel
+               libcap-ng-devel
+               systemd-devel
+       end
+
+       CFLAGS += -fno-strict-aliasing
+
+       PARALLELISMFLAGS = # No parallel build.
+
        configure_options += \
-               --sysconfdir=/etc \
+               --sysconfdir=%{sysconfdir}/dhcp \
                --with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases \
+               --with-srv6-lease-file=/var/lib/dhcpd/dhcpd6.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-relay-pid-file=/run/dhcrelay.pid
+               --with-cli6-pid-file=/run/dhclient6.pid \
+               --with-relay-pid-file=/run/dhcrelay.pid \
+               --with-ldap \
+               --with-ldapcrypto \
+               --disable-static \
+               --enable-paranoia \
+               --enable-early-chroot \
+               --enable-binary-leases \
+               --with-systemd
 
-       install_cmds
-               rm -vf %{BUILDROOT}/etc/dhclient.conf
+       prepare_cmds
+               # Regenerate build environment
+               autoreconf --verbose --force --install
 
-               # 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
+               # Change DHCLIENT_DEFAULT_PREFIX_LEN  64 -> 128
+               sed -i -e 's|DHCLIENT_DEFAULT_PREFIX_LEN 64|DHCLIENT_DEFAULT_PREFIX_LEN 128|g' \
+                       includes/site.h
+
+               # Update PATH in all manpages
+               for page in client/dhclient.conf.5 client/dhclient.leases.5 \
+                       client/dhclient-script.8 client/dhclient.8 ; do
+
+                       sed -i -e 's|CLIENTBINDIR|%{sbindir}|g' \
+                               -e 's|RUNDIR|/run|g' \
+                               -e 's|DBDIR|%{localstatedir}/lib/dhclient|g' \
+                               -e 's|ETCDIR|%{dhcpconfdir}|g' $page
+               done
+
+               for page in server/dhcpd.conf.5 server/dhcpd.leases.5 server/dhcpd.8 ; do
+                       sed -i -e 's|CLIENTBINDIR|%{sbindir}|g' \
+                               -e 's|RUNDIR|/run|g' \
+                               -e 's|DBDIR|%{localstatedir}/lib/dhcpd|g' \
+                               -e 's|ETCDIR|%{dhcpconfdir}|g' $page
+               done
+       end
 
-               install -v -m 755 %{DIR_SOURCE}/dhclient-script \
-                       %{BUILDROOT}/sbin/dhclient-script
+       install_cmds
+               rm -vf %{BUILDROOT}%{sysconfdir}/dhcp/dhclient.conf
 
                # Create runtime folders.
                mkdir -pv %{BUILDROOT}/var/lib/dhclient
@@ -48,15 +93,119 @@ build
 
                # 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
-
-               # Remove header files.
-               # There is nothing that makes use out of them.
-               rm -rfv %{BUILDROOT}/usr/include
+               touch %{BUILDROOT}/var/lib/dhcpd/dhcpd6.leases
        end
 end
 
 packages
        package %{name}
+               requires
+                       dhcp-common = %{thisver}
+                       dhcp-libs = %{thisver}
+                       /usr/lib/network/helpers/dhcpd-config-helper
+               end
+
+               prerequires += shadow-utils
+
+               configfiles
+                       %{sysconfdir}/dhcp
+               end
+
+               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
+               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 = %{thisver}
+                       dhcp-libs = %{thisver}
+                       %{sbindir}/dhclient-script
+               end
+
+               files
+                       %{unitdir}/dhclient*.service
+                       %{sbindir}/dhclient
+                       /usr/share/man/man5/dhclient*
+                       /usr/share/man/man8/dhclient*
+                       /var/lib/dhclient
+               end
+
+               script postin
+                       systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script postun
+                       systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script postup
+                       systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+       end
+
+       package %{name}-common
+               summary = Common files used by the dhcp client and server.
+               description = %{summary}
+
+               requires
+                       dhcp-libs = %{thisver}
+               end
+
+               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