]> git.ipfire.org Git - ipfire-3.x.git/blame - dhcp/dhcp.nm
dhcp: Fix some configuration paths.
[ipfire-3.x.git] / dhcp / dhcp.nm
CommitLineData
cc52c523 1###############################################################################
802ea3af
MT
2# IPFire.org - An Open Source Firewall Solution #
3# Copyright (C) - IPFire Development Team <info@ipfire.org> #
cc52c523
MT
4###############################################################################
5
802ea3af 6name = dhcp
6df985df 7version = 4.2.2
b781eae5 8release = 5
cc52c523 9
802ea3af
MT
10groups = Networking/Daemons
11url = http://isc.org/products/DHCP/
12license = ISC
13summary = Dynamic host configuration protocol software.
cc52c523 14
802ea3af 15description
6df985df
SS
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,
1f9bc2f0 19 etc.) from a DHCP server. The overall purpose of DHCP is to make it
cc52c523 20 easier to administer a large network.
802ea3af
MT
21end
22
6df985df
SS
23source_dl = ftp://ftp.isc.org/isc/dhcp/
24
25# Apply patches in a special order.
26patches = \
27 dhcp-4.2.2-remove-bind.patch \
28 dhcp-4.2.0-errwarn-message.patch \
29 dhcp-4.2.2-options.patch \
30 dhcp-4.2.0-release-by-ifup.patch \
31 dhcp-4.2.0-dhclient-decline-backoff.patch \
32 dhcp-4.2.0-unicast-bootp.patch \
33 dhcp-4.2.2-dhclient-usage.patch \
34 dhcp-4.2.0-default-requested-options.patch \
35 dhcp-4.2.2-xen-checksum.patch \
36 dhcp-4.2.1-manpages.patch \
37 dhcp-4.2.0-paths.patch \
38 dhcp-4.2.2-CLOEXEC.patch \
39 dhcp-4.2.0-inherit-leases.patch \
40 dhcp-4.2.0-garbage-chars.patch \
41 dhcp-4.2.0-missing-ipv6-not-fatal.patch \
42 dhcp-4.2.0-add_timeout_when_NULL.patch \
43 dhcp-4.2.1-64_bit_lease_parse.patch \
44 dhcp-4.2.2-capability.patch \
45 dhcp-4.2.0-logpid.patch \
46 dhcp-4.2.0-UseMulticast.patch \
47 dhcp-4.2.1-sendDecline.patch \
48 dhcp-4.2.1-retransmission.patch \
49 dhcp-4.2.2-rfc3442-classless-static-routes.patch \
50 dhcp-4.2.0-honor-expired.patch \
51 dhcp-4.2.0-noprefixavail.patch \
52 dhcp-4.2.2-sharedlib.patch \
53 dhcp-4.2.0-PPP.patch \
54 dhcp-4.2.2-lpf-ib.patch \
55 dhcp-4.2.2-improved-xid.patch \
56 dhcp-4.2.2-gpxe-cid.patch \
57 dhcp-4.2.2-systemtap.patch
802ea3af
MT
58
59build
6df985df
SS
60 requires
61 autoconf
62 automake
63 bind-devel>=9
64 bind-devel<10
65 groff
66 libtool
67 openldap-devel
68 libcap-ng-devel
0111cbc9 69 systemd-units
6df985df
SS
70 end
71
72 CFLAGS += \
73 -fno-strict-aliasing \
74 -D_GNU_SOURCE \
75 -Wl,--as-needed
76
802ea3af 77 configure_options += \
b781eae5 78 --sysconfdir=%{sysconfdir}/dhcp \
802ea3af 79 --with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases \
b781eae5 80 --with-srv6-lease-file=/var/lib/dhcpd/dhcpd6.leases \
802ea3af 81 --with-cli-lease-file=/var/lib/dhclient/dhclient.leases \
6df985df 82 --with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases \
3dd085a5 83 --with-srv-pid-file=/run/dhcpd.pid \
6df985df 84 --with-srv6-pid-file=/run/dhcpd6.pid \
3dd085a5 85 --with-cli-pid-file=/run/dhclient.pid \
6df985df
SS
86 --with-cli6-pid-file=/run/dhclient6.pid \
87 --with-relay-pid-file=/run/dhcrelay.pid \
88 --with-ldap \
89 --with-ldapcrypto \
90 --with-libbind=/usr/include/ \
91 --with-libbind-libs=/usr/lib/ \
92 --disable-static \
93 --enable-paranoia \
94 --enable-early-chroot
95
96 prepare_cmds
97 # Remove bundled BIND source
98 rm -rvf %{DIR_APP}/bind/bind.tar.gz
99
100 # Regenerate build environment
101 libtoolize --copy --force
102 autoreconf --verbose --force --install
103 end
802ea3af
MT
104
105 install_cmds
b781eae5 106 rm -vf %{BUILDROOT}%{sysconfdir}/dhcp/dhclient.conf
802ea3af
MT
107
108 # Move the client to /sbin, create dirs
109 # and remove the default config.
110 mkdir -pv %{BUILDROOT}/sbin
111 mv -v %{BUILDROOT}/usr/sbin/dhclient %{BUILDROOT}/sbin/dhclient
112
113 install -v -m 755 %{DIR_SOURCE}/dhclient-script \
114 %{BUILDROOT}/sbin/dhclient-script
3dd085a5
SS
115
116 # Create runtime folders.
802ea3af 117 mkdir -pv %{BUILDROOT}/var/lib/dhclient
3dd085a5
SS
118 mkdir -pv %{BUILDROOT}/var/lib/dhcpd
119
120 # Create empty lease files.
121 touch %{BUILDROOT}/var/lib/dhclient/dhclient.leases
6df985df 122 touch %{BUILDROOT}/var/lib/dhclient/dhclient6.leases
3dd085a5 123 touch %{BUILDROOT}/var/lib/dhcpd/dhcpd.leases
6df985df 124 touch %{BUILDROOT}/var/lib/dhcpd/dhcpd6.leases
802ea3af
MT
125 end
126end
127
128packages
129 package %{name}
6df985df 130 requires
b781eae5
MT
131 dhcp-common = %{thisver}
132 dhcp-libs = %{thisver}
133 /usr/lib/network/helpers/dhcpd-config-helper
6df985df
SS
134 end
135
136 prerequires += shadow-utils
137
b781eae5
MT
138 configfiles
139 %{sysconfdir}/dhcp
140 end
141
6df985df
SS
142 script prein
143 getent group dhcpd >/dev/null || groupadd -r dhcpd
144 getent passwd dhcpd >/dev/null || \
145 useradd -r -g dhcpd -d /var/lib/dhcpd -s /sbin/nologin \
146 -c "User for the DHCP server" dhcpd
6df985df
SS
147 end
148
149 # Just search for new unit files that were just installed.
150 script postin
151 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
152 end
153
154 # Disable the service that is to be removed and stop it if it is still running.
155 script preun
156 /bin/systemctl --no-reload disable dhcpd.service >/dev/null 2>&1 || :
157 /bin/systemctl --no-reload disable dhcpd6.service >/dev/null 2>&1 || :
158 /bin/systemctl --no-reload disable dhcrelay.service >/dev/null 2>&1 || :
159 /bin/systemctl stop dhcpd.service >/dev/null 2>&1 || :
160 /bin/systemctl stop dhcpd6.service >/dev/null 2>&1 || :
161 /bin/systemctl stop dhcrelay.service >/dev/null 2>&1 || :
162 end
163
164 # Just tell systemd that unitfiles have been removed.
165 script postun
166 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
167 end
168
169 # Try to restart the service if it is running.
170 script postup
171 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
172 /bin/systemctl try-restart dhcpd.service >/dev/null 2>&1 || :
173 /bin/systemctl try-restart dhcpd6.service >/dev/null 2>&1 || :
174 /bin/systemctl try-restart dhcrelay.service >/dev/null 2>&1 || :
175 end
176 end
177
178 package dhclient
179 summary = DHCP client daemon and dhclient-script.
180 description = %{summary}
181
182 requires
b781eae5
MT
183 dhcp-common = %{thisver}
184 dhcp-libs = %{thisver}
6df985df
SS
185 end
186
187 files
0111cbc9 188 %{unitdir}/dhclient*.service
6df985df
SS
189 /sbin
190 /usr/share/man/man5/dhclient*
191 /usr/share/man/man8/dhclient*
192 /var/lib/dhclient
193 end
0111cbc9
MT
194
195 script postin
196 systemctl daemon-reload >/dev/null 2>&1 || :
197 end
198
199 script postun
200 systemctl daemon-reload >/dev/null 2>&1 || :
201 end
202
203 script postup
204 systemctl daemon-reload >/dev/null 2>&1 || :
205 end
206
6df985df
SS
207 end
208
209 package %{name}-common
210 summary = Common files used by the dhcp client and server.
211 description = %{summary}
1f9bc2f0 212
b781eae5
MT
213 requires
214 dhcp-libs = %{thisver}
215 end
216
6df985df
SS
217 files
218 /usr/bin/
219 /usr/share/man/man1/omshell.1*
220 /usr/share/man/man5/dhcp-options.5*
221 /usr/share/man/man5/dhcp-eval.5*
222 end
223 end
224
225 package %{name}-libs
226 template LIBS
227 end
228
229 package %{name}-devel
230 template DEVEL
802ea3af 231 end
1f9bc2f0
MT
232
233 package %{name}-debuginfo
234 template DEBUGINFO
235 end
802ea3af 236end