]> git.ipfire.org Git - ipfire-3.x.git/blobdiff - dhcp/dhcp.nm
dhcp: Fix some configuration paths.
[ipfire-3.x.git] / dhcp / dhcp.nm
index 246ad17a1ec53f3fe028e8da4591de7729a4455a..d0ffab831e7d0d823969c2beb3144fc21ac3c60e 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = dhcp
 version    = 4.2.2
-release    = 2
+release    = 5
 
 groups     = Networking/Daemons
 url        = http://isc.org/products/DHCP/
@@ -66,6 +66,7 @@ build
                libtool
                openldap-devel
                libcap-ng-devel
+               systemd-units
        end
 
        CFLAGS += \
@@ -74,9 +75,9 @@ build
                -Wl,--as-needed
 
        configure_options += \
-               --sysconfdir=/etc \
+               --sysconfdir=%{sysconfdir}/dhcp \
                --with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases \
-               --with-srv6-lease-file=/var/lib/dhcpd/dhcp6.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 \
@@ -102,7 +103,7 @@ build
        end
 
        install_cmds
-               rm -vf %{BUILDROOT}/etc/dhclient.conf
+               rm -vf %{BUILDROOT}%{sysconfdir}/dhcp/dhclient.conf
 
                # Move the client to /sbin, create dirs
                # and remove the default config.
@@ -126,19 +127,23 @@ end
 
 packages
        package %{name}
-
                requires
-                       dhcp-common
+                       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
-                       exit  0
                end
 
                # Just search for new unit files that were just installed.
@@ -175,21 +180,40 @@ packages
                description = %{summary}
 
                requires
-                       dhcp-common
+                       dhcp-common = %{thisver}
+                       dhcp-libs = %{thisver}
                end
 
                files
+                       %{unitdir}/dhclient*.service
                        /sbin
                        /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*