1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
10 groups = Networking/Daemons
11 url = http://isc.org/products/DHCP/
13 summary = Dynamic host configuration protocol software.
16 DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
17 individual devices on an IP network to get their own network
18 configuration information (IP address, subnetmask, broadcast address,
19 etc.) from a DHCP server. The overall purpose of DHCP is to make it
20 easier to administer a large network.
23 source_dl = ftp://ftp.isc.org/isc/dhcp/%{version}/
38 CFLAGS += -fno-strict-aliasing
40 PARALLELISMFLAGS = # No parallel build.
42 configure_options += \
43 --sysconfdir=%{sysconfdir}/dhcp \
44 --with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases \
45 --with-srv6-lease-file=/var/lib/dhcpd/dhcpd6.leases \
46 --with-cli-lease-file=/var/lib/dhclient/dhclient.leases \
47 --with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases \
48 --with-srv-pid-file=/run/dhcpd.pid \
49 --with-srv6-pid-file=/run/dhcpd6.pid \
50 --with-cli-pid-file=/run/dhclient.pid \
51 --with-cli6-pid-file=/run/dhclient6.pid \
52 --with-relay-pid-file=/run/dhcrelay.pid \
57 --enable-early-chroot \
58 --enable-binary-leases \
62 # Regenerate build environment
63 autoreconf --verbose --force --install
65 # Change DHCLIENT_DEFAULT_PREFIX_LEN 64 -> 128
66 sed -i -e 's|DHCLIENT_DEFAULT_PREFIX_LEN 64|DHCLIENT_DEFAULT_PREFIX_LEN 128|g' \
69 # Update PATH in all manpages
70 for page in client/dhclient.conf.5 client/dhclient.leases.5 \
71 client/dhclient-script.8 client/dhclient.8 ; do
73 sed -i -e 's|CLIENTBINDIR|%{sbindir}|g' \
74 -e 's|RUNDIR|/run|g' \
75 -e 's|DBDIR|%{localstatedir}/lib/dhclient|g' \
76 -e 's|ETCDIR|%{dhcpconfdir}|g' $page
79 for page in server/dhcpd.conf.5 server/dhcpd.leases.5 server/dhcpd.8 ; do
80 sed -i -e 's|CLIENTBINDIR|%{sbindir}|g' \
81 -e 's|RUNDIR|/run|g' \
82 -e 's|DBDIR|%{localstatedir}/lib/dhcpd|g' \
83 -e 's|ETCDIR|%{dhcpconfdir}|g' $page
88 rm -vf %{BUILDROOT}%{sysconfdir}/dhcp/dhclient.conf
90 # Create runtime folders.
91 mkdir -pv %{BUILDROOT}/var/lib/dhclient
92 mkdir -pv %{BUILDROOT}/var/lib/dhcpd
94 # Create empty lease files.
95 touch %{BUILDROOT}/var/lib/dhclient/dhclient.leases
96 touch %{BUILDROOT}/var/lib/dhclient/dhclient6.leases
97 touch %{BUILDROOT}/var/lib/dhcpd/dhcpd.leases
98 touch %{BUILDROOT}/var/lib/dhcpd/dhcpd6.leases
105 dhcp-common = %{thisver}
106 dhcp-libs = %{thisver}
107 /usr/lib/network/helpers/dhcpd-config-helper
110 prerequires += shadow-utils
117 getent group dhcpd >/dev/null || groupadd -r dhcpd
118 getent passwd dhcpd >/dev/null || \
119 useradd -r -g dhcpd -d /var/lib/dhcpd -s /sbin/nologin \
120 -c "User for the DHCP server" dhcpd
123 # Just search for new unit files that were just installed.
125 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
128 # Disable the service that is to be removed and stop it if it is still running.
130 /bin/systemctl --no-reload disable dhcpd.service >/dev/null 2>&1 || :
131 /bin/systemctl --no-reload disable dhcpd6.service >/dev/null 2>&1 || :
132 /bin/systemctl --no-reload disable dhcrelay.service >/dev/null 2>&1 || :
133 /bin/systemctl stop dhcpd.service >/dev/null 2>&1 || :
134 /bin/systemctl stop dhcpd6.service >/dev/null 2>&1 || :
135 /bin/systemctl stop dhcrelay.service >/dev/null 2>&1 || :
138 # Just tell systemd that unitfiles have been removed.
140 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
143 # Try to restart the service if it is running.
145 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
146 /bin/systemctl try-restart dhcpd.service >/dev/null 2>&1 || :
147 /bin/systemctl try-restart dhcpd6.service >/dev/null 2>&1 || :
148 /bin/systemctl try-restart dhcrelay.service >/dev/null 2>&1 || :
153 summary = DHCP client daemon and dhclient-script.
154 description = %{summary}
157 dhcp-common = %{thisver}
158 dhcp-libs = %{thisver}
159 %{sbindir}/dhclient-script
163 %{unitdir}/dhclient*.service
165 /usr/share/man/man5/dhclient*
166 /usr/share/man/man8/dhclient*
171 systemctl daemon-reload >/dev/null 2>&1 || :
175 systemctl daemon-reload >/dev/null 2>&1 || :
179 systemctl daemon-reload >/dev/null 2>&1 || :
184 package %{name}-common
185 summary = Common files used by the dhcp client and server.
186 description = %{summary}
189 dhcp-libs = %{thisver}
194 /usr/share/man/man1/omshell.1*
195 /usr/share/man/man5/dhcp-options.5*
196 /usr/share/man/man5/dhcp-eval.5*
204 package %{name}-devel
208 package %{name}-debuginfo