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 configure_options += \
41 --sysconfdir=%{sysconfdir}/dhcp \
42 --with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases \
43 --with-srv6-lease-file=/var/lib/dhcpd/dhcpd6.leases \
44 --with-cli-lease-file=/var/lib/dhclient/dhclient.leases \
45 --with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases \
46 --with-srv-pid-file=/run/dhcpd.pid \
47 --with-srv6-pid-file=/run/dhcpd6.pid \
48 --with-cli-pid-file=/run/dhclient.pid \
49 --with-cli6-pid-file=/run/dhclient6.pid \
50 --with-relay-pid-file=/run/dhcrelay.pid \
53 --with-libbind=/usr/include/ \
54 --with-libbind-libs=/usr/lib/ \
57 --enable-early-chroot \
58 --enable-binary-leases \
62 # Remove bundled BIND source
63 rm -rvf %{DIR_APP}/bind/bind.tar.gz
65 # Regenerate build environment
66 autoreconf --verbose --force --install
68 # Change DHCLIENT_DEFAULT_PREFIX_LEN 64 -> 128
69 sed -i -e 's|DHCLIENT_DEFAULT_PREFIX_LEN 64|DHCLIENT_DEFAULT_PREFIX_LEN 128|g' \
72 # Update PATH in all manpages
73 for page in client/dhclient.conf.5 client/dhclient.leases.5 \
74 client/dhclient-script.8 client/dhclient.8 ; do
76 sed -i -e 's|CLIENTBINDIR|%{sbindir}|g' \
77 -e 's|RUNDIR|/run|g' \
78 -e 's|DBDIR|%{localstatedir}/lib/dhclient|g' \
79 -e 's|ETCDIR|%{dhcpconfdir}|g' $page
82 for page in server/dhcpd.conf.5 server/dhcpd.leases.5 server/dhcpd.8 ; do
83 sed -i -e 's|CLIENTBINDIR|%{sbindir}|g' \
84 -e 's|RUNDIR|/run|g' \
85 -e 's|DBDIR|%{localstatedir}/lib/dhcpd|g' \
86 -e 's|ETCDIR|%{dhcpconfdir}|g' $page
91 rm -vf %{BUILDROOT}%{sysconfdir}/dhcp/dhclient.conf
93 # Create runtime folders.
94 mkdir -pv %{BUILDROOT}/var/lib/dhclient
95 mkdir -pv %{BUILDROOT}/var/lib/dhcpd
97 # Create empty lease files.
98 touch %{BUILDROOT}/var/lib/dhclient/dhclient.leases
99 touch %{BUILDROOT}/var/lib/dhclient/dhclient6.leases
100 touch %{BUILDROOT}/var/lib/dhcpd/dhcpd.leases
101 touch %{BUILDROOT}/var/lib/dhcpd/dhcpd6.leases
108 dhcp-common = %{thisver}
109 dhcp-libs = %{thisver}
110 /usr/lib/network/helpers/dhcpd-config-helper
113 prerequires += shadow-utils
120 getent group dhcpd >/dev/null || groupadd -r dhcpd
121 getent passwd dhcpd >/dev/null || \
122 useradd -r -g dhcpd -d /var/lib/dhcpd -s /sbin/nologin \
123 -c "User for the DHCP server" dhcpd
126 # Just search for new unit files that were just installed.
128 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
131 # Disable the service that is to be removed and stop it if it is still running.
133 /bin/systemctl --no-reload disable dhcpd.service >/dev/null 2>&1 || :
134 /bin/systemctl --no-reload disable dhcpd6.service >/dev/null 2>&1 || :
135 /bin/systemctl --no-reload disable dhcrelay.service >/dev/null 2>&1 || :
136 /bin/systemctl stop dhcpd.service >/dev/null 2>&1 || :
137 /bin/systemctl stop dhcpd6.service >/dev/null 2>&1 || :
138 /bin/systemctl stop dhcrelay.service >/dev/null 2>&1 || :
141 # Just tell systemd that unitfiles have been removed.
143 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
146 # Try to restart the service if it is running.
148 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
149 /bin/systemctl try-restart dhcpd.service >/dev/null 2>&1 || :
150 /bin/systemctl try-restart dhcpd6.service >/dev/null 2>&1 || :
151 /bin/systemctl try-restart dhcrelay.service >/dev/null 2>&1 || :
156 summary = DHCP client daemon and dhclient-script.
157 description = %{summary}
160 dhcp-common = %{thisver}
161 dhcp-libs = %{thisver}
162 %{sbindir}/dhclient-script
166 %{unitdir}/dhclient*.service
168 /usr/share/man/man5/dhclient*
169 /usr/share/man/man8/dhclient*
174 systemctl daemon-reload >/dev/null 2>&1 || :
178 systemctl daemon-reload >/dev/null 2>&1 || :
182 systemctl daemon-reload >/dev/null 2>&1 || :
187 package %{name}-common
188 summary = Common files used by the dhcp client and server.
189 description = %{summary}
192 dhcp-libs = %{thisver}
197 /usr/share/man/man1/omshell.1*
198 /usr/share/man/man5/dhcp-options.5*
199 /usr/share/man/man5/dhcp-eval.5*
207 package %{name}-devel
211 package %{name}-debuginfo