/[packages]/cauldron/dhcp/current/SPECS/dhcp.spec
ViewVC logotype

Contents of /cauldron/dhcp/current/SPECS/dhcp.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1734015 - (show annotations) (download)
Sun Jun 27 19:10:31 2021 UTC (4 weeks, 6 days ago) by luigiwalser
File size: 13523 byte(s)
add patch from fedora to fix CVE-2021-25217
1 %define _catdir /var/cache/man
2
3 %define major_version 4.4.2
4 #%%define patch_version P1
5
6 Name: dhcp
7 Epoch: 3
8 Version: %{major_version}
9 #Version: %{major_version}%{patch_version}
10 Release: %mkrel 12
11 Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server/relay agent/client
12 License: Distributable
13 Group: System/Servers
14 URL: https://www.isc.org/dhcp/
15 Source0: ftp://ftp.isc.org/isc/%{name}/%{major_version}/%{name}-%{major_version}.tar.gz
16 Source1: ftp://ftp.isc.org/isc/%{name}/%{major_version}/%{name}-%{major_version}.tar.gz.sha512.asc
17 #Source0: ftp://ftp.isc.org/isc/%{name}/%{major_version}-%{patch_version}/%{name}-%{major_version}-%{patch_version}.tar.gz
18 #Source1: ftp://ftp.isc.org/isc/%{name}/%{major_version}-%{patch_version}/%{name}-%{major_version}-%{patch_version}.tar.gz.sha512.asc
19 Source2: dhcpd.conf
20 Source3: dhcpd6.conf
21 Source4: dhcp-dynamic-dns-examples.tar.bz2
22 Source7: dhcpreport.pl
23 Source8: dhcpd-chroot.sh
24 # (eugeni) dhclient-exit-hooks script
25 Source9: dhclient-exit-hooks
26 Source11: dhclient-hook-static-routes
27 Source10: draft-ietf-dhc-ldap-schema-01.txt
28 Source12: dhcpd.service
29 Source14: dhcpd6.service
30 Source16: dhcrelay.service
31 Source17: dhcpd.tmpfiles
32 Source18: dhclient.tmpfiles
33 Source19: dhcrelay.tmpfiles
34 # mageia patches
35 Patch100: dhcp-4.2.2-ifup.patch
36 Patch101: dhcp-4.3.4-fix-format-errors.patch
37 Patch103: dhcp-4.2.5-P1-man.patch
38 # fedora patches
39 Patch7: dhcp-4.2.0-default-requested-options.patch
40 Patch15: dhcp-4.2.2-missing-ipv6-not-fatal.patch
41 Patch17: dhcp-4.2.0-add_timeout_when_NULL.patch
42 Patch18: dhcp-4.3.0-64_bit_lease_parse.patch
43
44 # Change /var/run to /run to please systemd
45 # 2019-05-15 (kekePower)
46 Patch19: dhcp-4.4.1-var-run-to-run.patch
47
48 Patch20: dhcp-4.4.2-gcc10.patch
49
50 Patch27: 0027-Add-missed-sd-notify-patch-to-manage-dhcpd-with-syst.patch
51
52 Patch50: dhcp-statement_parser.patch
53
54 BuildRequires: bind-devel
55 BuildRequires: pkgconfig(krb5)
56 BuildRequires: groff-for-man
57 BuildRequires: openldap-devel
58 BuildRequires: pkgconfig(libsystemd)
59 Requires(preun): rpm-helper >= 0.24.8-1
60
61 %description
62 DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
63 individual devices on an IP network to get their own network configuration
64 information (IP address, subnetmask, broadcast address, etc.) from a DHCP
65 server. The overall purpose of DHCP is to make it easier to administer a
66 large network. The dhcp package includes the DHCP server and a DHCP relay
67 agent. You will also need to install the dhcp-client or dhcpcd package,
68 or pump or dhcpxd, which provides the DHCP client daemon, on client machines.
69
70 If you want the DHCP server and/or relay, you will also need to install the
71 dhcp-server and/or dhcp-relay packages.
72
73 %package common
74 Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server
75 Group: System/Servers
76
77 %description common
78 DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
79 individual devices on an IP network to get their own network
80 configuration information (IP address, subnetmask, broadcast address,
81 etc.) from a DHCP server. The overall purpose of DHCP is to make it
82 easier to administer a large network. The dhcp package includes the
83 DHCP server and a DHCP relay agent.
84
85 You will also need to install the dhcp-client or dhcpcd package, or pump or
86 dhcpxd, which provides the DHCP client daemon, on client machines. If you
87 want the DHCP server and/or relay, you will also need to install the
88 dhcp-server and/or dhcp-relay packages.
89
90 %package doc
91 Summary: Documentation about the ISC DHCP server/client
92 Group: System/Servers
93
94 %description doc
95 This package contains RFC/API/protocol documentation about the ISC
96 DHCP server and client.
97
98 DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
99 individual devices on an IP network to get their own network
100 configuration information (IP address, subnetmask, broadcast address,
101 etc.) from a DHCP server. The overall purpose of DHCP is to make it
102 easier to administer a large network. The dhcp package includes the
103 DHCP server and a DHCP relay agent.
104
105 %package server
106 Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server
107 Group: System/Servers
108 Requires: dhcp-common = %{epoch}:%{version}-%{release}
109 Requires(post): systemd >= %{systemd_required_version}
110 Requires(post): rpm-helper >= 0.24.8-1
111 Requires(preun): rpm-helper >= 0.24.8-1
112
113 %description server
114 DHCP server is the Internet Software Consortium (ISC) DHCP server for various
115 UNIX operating systems. It allows a UNIX mac hine to serve DHCP requests from
116 the network.
117
118 You should install dhcp-server if you want to set up a DHCP server on your
119 network. You will also need to install the base dhcp package.
120
121 %package client
122 Summary: The ISC DHCP (Dynamic Host Configuration Protocol) client
123 Group: System/Servers
124 Requires: dhcp-common = %{epoch}:%{version}-%{release}
125 Requires(post): systemd >= %{systemd_required_version}
126 # dhclient-exit-hooks was in server package
127 Conflicts: dhcp-server < 4.3.1-2
128
129 %description client
130 DHCP client is the Internet Software Consortium (ISC) DHCP client for various
131 UNIX operating systems. It allows a UNIX mac hine to obtain it's networking
132 parameters from a DHCP server.
133
134 You should install dhcp-client if you want to use the ISC DHCP client instead
135 of the Red Hat DHCP client, pump, or dhcpcd, or dhcpxd. You will also need to
136 install the base dhcp package.
137
138 %package relay
139 Summary: The ISC DHCP (Dynamic Host Configuration Protocol) relay
140 Group: System/Servers
141 Requires: dhcp-common = %{epoch}:%{version}-%{release}
142 Requires(post): systemd >= %{systemd_required_version}
143 Requires(post): rpm-helper >= 0.24.8-1
144 Requires(preun): rpm-helper >= 0.24.8-1
145
146 %description relay
147 DHCP relay is the Internet Software Consortium (ISC) relay agent for DHCP
148 packets. It is used on a subnet with DHCP clients to "relay" their requests
149 to a subnet that has a DHCP server on it. Because DHCP packets can be
150 broadcast, they will not be routed off of the local subnet. The DHCP relay
151 takes care of this for the client.
152
153 %package devel
154 Summary: Development headers and libraries for the dhcpctl API
155 Group: Development/Other
156 Requires: dhcp-common = %{epoch}:%{version}-%{release}
157
158 %description devel
159 DHCP devel contains all of the libraries and headers for developing with the
160 Internet Software Consortium (ISC) dhcpctl API.
161
162 %prep
163 #%%setup -q -n %{name}-%{major_version}-%{patch_version}
164 %setup -q -n %{name}-%{major_version}
165 %patch101 -p1 -b .format_not_a_string_literal_and_no_format_arguments
166 %patch103 -p1 -b .man
167
168 # Add NIS domain, NIS servers, NTP servers, interface-mtu and domain-search
169 # to the list of default requested DHCP options
170 %patch7 -p1 -b .requested
171 # Handle cases in add_timeout() where the function is called with a NULL
172 # value for the 'when' parameter
173 %patch17 -p1 -b .dracut
174 # Ensure 64-bit platforms parse lease file dates & times correctly
175 %patch18 -p1 -b .64-bit_lease_parse
176
177 %patch19 -p1 -b .var_run_to_run
178 %patch20 -p1 -b .gcc10
179
180 %patch27 -p1
181
182 %patch50 -p1
183
184 install -m0644 %{SOURCE10} doc
185
186 %build
187 autoreconf -fi
188 %serverbuild
189 %configure --enable-paranoia --enable-early-chroot --enable-binary-leases \
190 --with-ldap --with-ldapcrypto --with-ldap-gssapi \
191 --with-srv-lease-file=%{_var}/lib/dhcpd/dhcpd.leases \
192 --with-srv6-lease-file=%{_var}/lib/dhcpd/dhcpd6.leases \
193 --with-cli-lease-file=%{_var}/lib/dhclient/dhclient.leases \
194 --with-cli6-lease-file=%{_var}/lib/dhclient/dhclient6.leases \
195 --with-srv-pid-file=/run/dhcpd/dhcpd.pid \
196 --with-srv6-pid-file=/run/dhcpd/dhcpd6.pid \
197 --with-cli-pid-file=/run/dhclient/dhclient.pid \
198 --with-cli6-pid-file=/run/dhclient/dhclient6.pid \
199 --with-relay-pid-file=/run/dhcrelay/dhcrelay.pid \
200 --with-systemd
201 # Do not use make_build here as not parallelized
202 make
203
204 %install
205 %make_install
206
207 # Install correct dhclient-script
208 install -d %{buildroot}/sbin
209 mv %{buildroot}%{_sbindir}/dhclient %{buildroot}/sbin/dhclient
210 install -m 755 client/scripts/linux %{buildroot}/sbin/dhclient-script
211
212 install -d %{buildroot}%{_unitdir}
213 install -m 644 %{SOURCE12} %{buildroot}%{_unitdir}/dhcpd.service
214 install -m 644 %{SOURCE14} %{buildroot}%{_unitdir}/dhcpd6.service
215 install -m 644 %{SOURCE16} %{buildroot}%{_unitdir}/dhcrelay.service
216
217 install -D -p -m 644 %{SOURCE17} %{buildroot}%{_tmpfilesdir}/dhcpd.conf
218 install -D -p -m 644 %{SOURCE18} %{buildroot}%{_tmpfilesdir}/dhclient.conf
219 install -D -p -m 644 %{SOURCE19} %{buildroot}%{_tmpfilesdir}/dhcrelay.conf
220
221 install -m 755 %{SOURCE7} %{SOURCE8} %{buildroot}%{_sbindir}
222 install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}
223 install -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}
224 install -m 755 contrib/ldap/dhcpd-conf-to-ldap %{buildroot}%{_sbindir}
225
226 # install exit-hooks script to /etc/
227 install -m 755 %{SOURCE9} %{buildroot}%{_sysconfdir}
228 install -d %{buildroot}%{_sysconfdir}/dhclient-exit-hooks.d
229 install -m 755 %{SOURCE11} %{buildroot}%{_sysconfdir}/dhclient-exit-hooks.d/static-routes.sh
230
231 install -d %{buildroot}%{_sysconfdir}/sysconfig
232 cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcpd <<EOF
233 # You can set here various option for dhcpd
234
235 # Which configuration file to use.
236 # CONFIGFILE="/etc/dhcpd.conf"
237
238 # Where to store the lease state information.
239 # LEASEFILE="/var/lib/dhcpd/dhcpd.leases"
240
241 # Define INTERFACES to limit which network interfaces dhcpd listens on.
242 # The default null value causes dhcpd to listen on all interfaces.
243 #INTERFACES=""
244
245 # Define OPTIONS with any other options to pass to the dhcpd server.
246 # See dhcpd(8) for available options and syntax.
247 OPTIONS="-q"
248 EOF
249
250 cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcpd6 <<EOF
251 # You can set here various option for dhcpd
252
253 # Which configuration file to use.
254 # CONFIGFILE="/etc/dhcpd6.conf"
255
256 # Where to store the lease state information.
257 # LEASEFILE="/var/lib/dhcpd/dhcpd6.leases"
258
259 # Define INTERFACES to limit which network interfaces dhcpd listens on.
260 # The default null value causes dhcpd to listen on all interfaces.
261 #INTERFACES=""
262
263 # Define OPTIONS with any other options to pass to the dhcpd server.
264 # See dhcpd(8) for available options and syntax.
265 OPTIONS="-q"
266 EOF
267
268 install -d %{buildroot}%{_var}/lib/dhcpd
269 touch %{buildroot}%{_var}/lib/dhcpd/dhcpd.leases
270 touch %{buildroot}%{_var}/lib/dhcpd/dhcpd6.leases
271 install -d %{buildroot}%{_var}/lib/dhclient
272 touch %{buildroot}%{_var}/lib/dhclient/dhclient.leases
273
274 # Copy sample conf files into position (called by doc macro)
275 cp -p doc/examples/dhclient-dhcpv6.conf client/dhclient6.conf.example
276 cp -p doc/examples/dhcpd-dhcpv6.conf server/dhcpd6.conf.example
277
278 cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcrelay <<EOF
279 # Define DHCRELAYARGS with any other options to pass to the dhcrelay server.
280 # See dhcrelay(8) for available options and syntax.
281 # Define at the end the servers with a list of one or more DHCP servers where
282 # DHCP packets are to be relayed to and from. This is mandatory. Replace xxxx with them
283 #DHCRELAYARGS="-q -iu eth0 -id eth1 192.168.1.1"
284 DHCRELAYARGS="-q"
285 EOF
286
287 find . -type d -exec chmod 0755 {} \;
288 find . -type f -exec chmod 0644 {} \;
289
290 rm -rf doc/ja_JP.eucJP
291
292 # remove empty files
293 find -size 0 |grep ldap | xargs rm -rf
294
295 # remove unwanted file
296 rm -f %{buildroot}%{_sysconfdir}/dhclient.conf.example
297 rm -f %{buildroot}%{_sysconfdir}/dhcpd.conf.example
298 rm -f %{buildroot}%{_libdir}/*.a
299
300 %pre server
301 %_pre_useradd dhcpd /dev/null /bin/false
302
303 %post server
304 %_post_service dhcpd
305 %_post_service dhcpd6
306 %_tmpfilescreate dhcpd
307 # New dhcpd lease file
308 if [ ! -f %{_var}/lib/dhcpd/dhcpd.leases ]; then
309 touch %{_var}/lib/dhcpd/dhcpd.leases
310 fi
311 if [ ! -f %{_var}/lib/dhcpd/dhcpd6.leases ]; then
312 touch %{_var}/lib/dhcpd/dhcpd6.leases
313 fi
314
315 %postun server
316 %_postun_userdel dhcpd
317
318 %post relay
319 %_post_service dhcrelay
320 %_tmpfilescreate dhcrelay
321
322 %preun server
323 %_preun_service dhcpd
324 %_preun_service dhcpd6
325
326 %preun relay
327 %_preun_service dhcrelay
328
329 %post client
330 touch %{_var}/lib/dhclient/dhclient.leases
331 %_tmpfilescreate dhclient
332
333 %postun client
334 rm -rf %{_var}/lib/dhclient/dhclient.leases
335
336 %files common
337 %doc README contrib/ldap/README.ldap RELNOTES
338 %doc contrib/3.0b1-lease-convert
339 %{_mandir}/man5/dhcp-options.5*
340
341 %files doc
342 %doc doc/*
343
344 %files server
345 %doc server/dhcpd*.conf.example tests/failover contrib/ldap/dhcp.schema
346 %{_unitdir}/dhcpd.service
347 %{_unitdir}/dhcpd6.service
348 %{_tmpfilesdir}/dhcpd.conf
349 %config(noreplace) %{_sysconfdir}/dhcpd.conf
350 %config(noreplace) %{_sysconfdir}/dhcpd6.conf
351 %config(noreplace) %{_sysconfdir}/sysconfig/dhcpd
352 %config(noreplace) %{_sysconfdir}/sysconfig/dhcpd6
353 %{_sbindir}/dhcpd
354 %{_sbindir}/dhcpreport.pl
355 %{_sbindir}/dhcpd-conf-to-ldap
356 %{_sbindir}/dhcpd-chroot.sh
357 %{_bindir}/omshell
358 %{_mandir}/man1/omshell.1*
359 %{_mandir}/man3/omapi.3*
360 %{_mandir}/man5/dhcpd.conf.5*
361 %{_mandir}/man5/dhcpd.leases.5*
362 %{_mandir}/man5/dhcp-eval.5*
363 %{_mandir}/man8/dhcpd.8*
364 %dir %{_var}/lib/dhcpd
365 %config(noreplace) %ghost %{_var}/lib/dhcpd/dhcpd.leases
366 %config(noreplace) %ghost %{_var}/lib/dhcpd/dhcpd6.leases
367
368 %files relay
369 %{_unitdir}/dhcrelay.service
370 %{_tmpfilesdir}/dhcrelay.conf
371 %config(noreplace) %{_sysconfdir}/sysconfig/dhcrelay
372 %{_sbindir}/dhcrelay
373 %{_mandir}/man8/dhcrelay.8*
374
375 %files client
376 %doc client/dhclient*.conf.example
377 %{_sysconfdir}/dhclient-exit-hooks
378 %{_sysconfdir}/dhclient-exit-hooks.d
379 %attr (0755,root,root) /sbin/dhclient-script
380 %{_tmpfilesdir}/dhclient.conf
381 /sbin/dhclient
382 %{_mandir}/man5/dhclient.conf.5*
383 %{_mandir}/man5/dhclient.leases.5*
384 %{_mandir}/man8/dhclient.8*
385 %{_mandir}/man8/dhclient-script.8*
386 %dir %{_var}/lib/dhclient
387 %config(noreplace) %ghost %{_var}/lib/dhclient/dhclient.leases
388
389 %files devel
390 %{_includedir}/*
391 %{_mandir}/man3/*

  ViewVC Help
Powered by ViewVC 1.1.28