]>
Commit | Line | Data |
---|---|---|
54205346 AG |
1 | # note: isc dhcp is now eol |
2 | # https://www.isc.org/blogs/isc-dhcp-eol/ | |
fa424e73 JB |
3 | # |
4 | # Conditional build: | |
967af251 | 5 | %bcond_without ldap # without support for ldap storage |
6db0fb84 | 6 | %bcond_without static_libs # don't build static library |
1830ecd4 | 7 | %bcond_without systemd # without systemd units |
ceee8beb | 8 | |
15c1a831 | 9 | %define ver 4.4.3 |
54205346 | 10 | %if 1 |
990742a8 JR |
11 | %define pverdot .P1 |
12 | %define pverdir -P1 | |
13 | %else | |
14 | %define pverdot %{nil} | |
15 | %define pverdir %{nil} | |
16 | %endif | |
17 | ||
ceee8beb ER |
18 | # vendor string |
19 | %define vvendor PLD/Linux | |
8dc004f7 | 20 | Summary: DHCP Server |
6e8d2260 ER |
21 | Summary(es.UTF-8): Servidor DHCP |
22 | Summary(pl.UTF-8): Serwer DHCP | |
23 | Summary(pt_BR.UTF-8): Servidor DHCP (Protocolo de configuração dinâmica de hosts) | |
cd3ce1e4 | 24 | Name: dhcp |
990742a8 | 25 | Version: %{ver}%{pverdot} |
54205346 | 26 | Release: 1 |
9598ee90 | 27 | Epoch: 4 |
6acbb058 | 28 | License: MIT |
cd3ce1e4 | 29 | Group: Networking/Daemons |
990742a8 | 30 | Source0: ftp://ftp.isc.org/isc/dhcp/%{ver}%{pverdir}/%{name}-%{ver}%{pverdir}.tar.gz |
54205346 | 31 | # Source0-md5: 36c6ca77212373b0cff478ae9e5d32af |
a4dfcb55 | 32 | Source1: %{name}.init |
6e6494f3 AM |
33 | Source2: %{name}6.init |
34 | Source3: %{name}-relay.init | |
35 | Source4: %{name}.sysconfig | |
36 | Source5: %{name}-relay.sysconfig | |
1830ecd4 JP |
37 | Source6: dhcpd.service |
38 | Source7: dhcpd6.service | |
39 | Source8: dhcp-relay.service | |
03a6f6c6 | 40 | Source10: %{name}.schema |
ceee8beb ER |
41 | Source11: %{name}-README.ldap |
42 | Source12: draft-ietf-dhc-ldap-schema-01.txt | |
77e9a55a | 43 | Source13: %{name}d-conf-to-ldap |
4ca0a88e | 44 | Patch0: %{name}-release-by-ifup.patch |
12777244 JK |
45 | Patch1: %{name}-3.0.3-x-option.patch |
46 | Patch2: %{name}-paths.patch | |
47 | Patch3: %{name}-timeouts.patch | |
48 | Patch4: %{name}-options.patch | |
49 | Patch5: %{name}-errwarn-message.patch | |
50 | Patch6: %{name}-memory.patch | |
3ae1beff PZ |
51 | Patch7: %{name}-unicast-bootp.patch |
52 | Patch8: %{name}-default-requested-options.patch | |
53 | Patch9: %{name}-manpages.patch | |
54 | Patch10: %{name}-extravars.patch | |
1830ecd4 | 55 | Patch11: systemd-notify.patch |
15c1a831 MK |
56 | Patch12: %{name}-CLOEXEC.patch |
57 | Patch13: %{name}-garbage-in-format-string-error.patch | |
58 | Patch14: %{name}-handle-null-timouet.patch | |
59 | Patch15: %{name}-capabilities.patch | |
60 | Patch16: %{name}-rfc3442-classless-static-routes.patch | |
61 | Patch17: %{name}-ppp.patch | |
62 | Patch18: %{name}-lpf-ib.patch | |
63 | Patch19: %{name}-add-guid-duid-to-logs.patch | |
64 | Patch20: %{name}-duid_uuid.patch | |
65 | Patch21: %{name}-client-request-release-bind-iface.patch | |
66 | Patch22: %{name}-no-subnet-error2info.patch | |
67 | Patch23: %{name}-stateless-duid-llt.patch | |
68 | Patch24: %{name}-hwaddress.patch | |
69 | Patch25: %{name}-confparse.patch | |
70 | Patch26: %{name}-link-local-address.patch | |
71 | Patch27: %{name}-option97-pxe-client-id.patch | |
72 | Patch28: %{name}-detect-time-changes.patch | |
73 | Patch29: bind-detect-time-changes.patch | |
74 | Patch30: bind-system-getaddrinfo.patch | |
067d19b4 | 75 | URL: https://www.isc.org/dhcp/ |
03a6f6c6 AM |
76 | BuildRequires: autoconf |
77 | BuildRequires: automake | |
bca716bd | 78 | BuildRequires: groff |
d812b9c4 JP |
79 | %ifarch %{arm} |
80 | BuildRequires: libatomic-devel | |
81 | %endif | |
ceee8beb | 82 | BuildRequires: libtool |
01b31b42 | 83 | %{?with_ldap:BuildRequires: openldap-devel} |
5bf1b3cd | 84 | %{?with_ldap:BuildRequires: openssl-devel} |
1830ecd4 JP |
85 | BuildRequires: rpmbuild(macros) >= 1.644 |
86 | %{?with_systemd:BuildRequires: systemd-devel} | |
967af251 | 87 | Requires(post): coreutils |
ac30bae3 ER |
88 | Requires(post,preun): /sbin/chkconfig |
89 | Requires: rc-scripts >= 0.2.0 | |
1830ecd4 | 90 | %{?with_systemd:Requires: systemd-units >= 38} |
73612d9c | 91 | Provides: dhcpd |
990742a8 | 92 | Obsoletes: dhcpv6-server |
bf74a63f | 93 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
cd3ce1e4 | 94 | |
6e6494f3 | 95 | %define _sbindir /sbin |
967af251 JR |
96 | %define schemadir /usr/share/openldap/schema |
97 | ||
cd3ce1e4 | 98 | %description |
0770f14a | 99 | DHCP (Dynamic Host Configuration Protocol) is a protocol which allows |
37bec083 | 100 | individual devices on an IP network to get their own network |
101 | configuration information (IP address, subnetmask, broadcast address, | |
102 | etc.) from a DHCP server. The overall purpose of DHCP is to make it | |
103 | easier to administer a large network. | |
0770f14a | 104 | |
39cd54ba | 105 | %description -l es.UTF-8 |
1f522308 | 106 | DHCP permite que hosts en una red TCP/IP soliciten y tengan sus |
39cd54ba JR |
107 | direcciones IP alocadas dinámicamente, permite también descubrir |
108 | información sobre la red en que están conectados. BOOTP provee una | |
1f522308 | 109 | funcionalidad similar, con ciertas restricciones. Este servidor |
39cd54ba | 110 | también las atiende. |
1f522308 | 111 | |
39cd54ba | 112 | %description -l pl.UTF-8 |
b7cc5fa2 | 113 | Serwer DHCP (Dynamic Host Configuration Protocol). |
cd3ce1e4 | 114 | |
39cd54ba | 115 | DHCP to protokół pozwalający urządzeniom pracującym w sieci IP na |
cd42af6b | 116 | pobieranie ich konfiguracji IP (adresu, maski podsieci, adresu |
39cd54ba JR |
117 | rozgłoszeniowego itp.) z serwera DHCP. Ułatwia on administrowanie |
118 | dużymi sieciami IP. | |
cd42af6b | 119 | |
39cd54ba | 120 | %description -l pt_BR.UTF-8 |
1f522308 | 121 | DHCP permite que hosts numa rede TCP/IP requisitem e tenham seus |
39cd54ba JR |
122 | endereços IP alocados dinamicamente, permite também descobrir |
123 | informações sobre a rede em que estão conectados. BOOTP provê uma | |
124 | funcionalidade similar, com certas restrições. Este servidor também | |
125 | atende aquelas requisições. Esta versão é ainda considerada um | |
1f522308 | 126 | software BETA. |
127 | ||
b62eae95 | 128 | %package -n openldap-schema-dhcp |
967af251 JR |
129 | Summary: LDAP Schema for DHCP Server |
130 | Summary(pl.UTF-8): Schemat LDAP dla serwera DHCP | |
131 | Group: Networking/Daemons | |
132 | Requires(post,postun): sed >= 4.0 | |
133 | Requires: openldap-servers | |
5c93787f | 134 | BuildArch: noarch |
967af251 | 135 | |
b62eae95 | 136 | %description -n openldap-schema-dhcp |
967af251 JR |
137 | This package contains LDAPv3 schema for use with the DHCP Server. |
138 | ||
b62eae95 | 139 | %description -n openldap-schema-dhcp -l pl.UTF-8 |
967af251 JR |
140 | Ten pakiet zawiera schemat LDAPv3 do używania z serwerem DHCP. |
141 | ||
3bb4bab9 | 142 | %package client |
143 | Summary: DHCP Client | |
6e8d2260 | 144 | Summary(pl.UTF-8): Klient DHCP |
3bb4bab9 | 145 | Group: Networking/Daemons |
132c7fb0 | 146 | Requires: bash |
eda193cb | 147 | Requires: coreutils |
132c7fb0 JP |
148 | Requires: grep |
149 | Requires: hostname | |
eda193cb | 150 | Requires: iproute2 |
132c7fb0 JP |
151 | Requires: sed |
152 | Requires: util-linux | |
51ba29e1 | 153 | Suggests: avahi-autoipd |
77e9a55a | 154 | Provides: dhclient = %{epoch}:%{version}-%{release} |
dd3090a5 | 155 | Obsoletes: dhclient |
990742a8 | 156 | Obsoletes: dhcpv6-client |
96d6b603 JR |
157 | Obsoletes: libdhcp4client |
158 | Obsoletes: libdhcp4client-devel | |
159 | Obsoletes: libdhcp4client-static | |
3bb4bab9 | 160 | |
161 | %description client | |
0770f14a | 162 | Dynamic Host Configuration Protocol Client. |
3bb4bab9 | 163 | |
39cd54ba | 164 | %description client -l pl.UTF-8 |
0770f14a | 165 | Klient DHCP (Dynamic Host Configuration Protocol). |
3bb4bab9 | 166 | |
e8a49f77 | 167 | %package client-dirs |
168 | Summary: DHCP Client common dirs | |
169 | Summary(pl.UTF-8): Katalogi klienta DHCP | |
170 | Group: Networking/Daemons | |
171 | ||
172 | %description client-dirs | |
173 | Directories for scripts for dhcp-client. | |
174 | ||
e4a792b4 | 175 | %description client-dirs -l pl.UTF-8 |
e8a49f77 | 176 | Katalog przeznaczony na skrypty dla klienta dhcp. |
177 | ||
45ef0575 | 178 | %package relay |
179 | Summary: DHCP Relay Agent | |
6e8d2260 | 180 | Summary(pl.UTF-8): Agent przekazywania informacji DHCP |
45ef0575 | 181 | Group: Networking/Daemons |
967af251 | 182 | Requires(post): coreutils |
ac30bae3 ER |
183 | Requires(post,preun): /sbin/chkconfig |
184 | Requires: rc-scripts >= 0.2.0 | |
990742a8 | 185 | Obsoletes: dhcpv6-relay |
45ef0575 | 186 | |
187 | %description relay | |
a4dfcb55 | 188 | Dhcp relay is a relay agent for DHCP packets. It is used on a subnet |
189 | with DHCP clients to "relay" their requests to a subnet that has a | |
190 | DHCP server on it. Because DHCP packets can be broadcast, they will | |
191 | not be routed off of the local subnet. The DHCP relay takes care of | |
192 | this for the client. | |
193 | ||
39cd54ba JR |
194 | %description relay -l pl.UTF-8 |
195 | Agent przekazywania DHCP (Dynamic Host Configuration Protocol) między | |
196 | podsieciami. Ponieważ komunikaty DHCP mogą być przekazywane w formie | |
197 | rozgłoszeniowej, bez tego agenta nie zostaną przerutowane do innej | |
cd42af6b | 198 | podsieci. |
45ef0575 | 199 | |
1d526f5b JK |
200 | %package devel |
201 | Summary: DHCP development includes and libs | |
6e8d2260 | 202 | Summary(pl.UTF-8): Pliki nagłówkowe i biblioteki dla oprogramowania DHCP |
1d526f5b JK |
203 | Group: Development/Libraries |
204 | ||
205 | %description devel | |
206 | Includes OMAPI and dhcptl libraries. | |
207 | ||
208 | OMAPI is an programming layer designed for controlling remote | |
209 | applications, and for querying them for their state. It is currently | |
210 | used by the ISC DHCP server. | |
211 | ||
212 | The dhcpctl set of functions provide an API that can be used to | |
213 | communicate with and manipulate a running ISC DHCP server. | |
214 | ||
39cd54ba | 215 | %description devel -l pl.UTF-8 |
1d526f5b JK |
216 | Zawiera biblioteki OMAPI oraz dhcpctl. |
217 | ||
218 | OMAPI to warstwa programowa stworzona do kontroli zdalnych aplikacji i | |
39cd54ba | 219 | odpytywania o ich stan. Aktualnie jest używana przez serwer ISC DHCP. |
1d526f5b | 220 | |
39cd54ba JR |
221 | dhcpctl to zbiór funkcji tworzących API, które może być używane do |
222 | komunikacji z działającym serwerem ISC DHCP i jego kontroli. | |
1d526f5b | 223 | |
cd3ce1e4 | 224 | %prep |
990742a8 | 225 | %setup -q -n %{name}-%{ver}%{pverdir} |
37332297 | 226 | %patch0 -p1 |
4ca0a88e | 227 | # This patch is required for dhcdbd to function |
ceee8beb ER |
228 | # CHECK ME: adds -x (formerly -y): |
229 | #The -x argument enables extended option information to be created in the | |
230 | #-s dhclient-script environment, which would allow applications running | |
231 | #in that environment to handle options they do not know about in advance - | |
232 | #this is a Red Hat extension to support dhcdbd and NetworkManager. | |
f805880f | 233 | # however, fedora doesn't have this patch anymore, so can drop? |
12777244 JK |
234 | #%%patch1 -p1 |
235 | %patch2 -p1 | |
4ca0a88e | 236 | %patch3 -p1 |
12777244 | 237 | %patch4 -p1 |
92eb981e | 238 | %patch5 -p1 |
74b36fbe | 239 | %patch6 -p1 |
12777244 JK |
240 | %patch7 -p1 |
241 | %patch8 -p1 | |
03a6f6c6 AM |
242 | %patch9 -p1 |
243 | %patch10 -p1 | |
1830ecd4 | 244 | %patch11 -p1 |
15c1a831 MK |
245 | %patch12 -p1 |
246 | %patch13 -p1 | |
247 | %patch14 -p1 | |
248 | %patch15 -p1 | |
249 | %patch16 -p1 | |
250 | %patch17 -p1 | |
251 | %patch18 -p1 | |
252 | %patch19 -p1 | |
253 | %patch20 -p1 | |
254 | %patch21 -p1 | |
255 | %patch22 -p1 | |
256 | %patch23 -p1 | |
257 | %patch24 -p1 | |
258 | %patch25 -p1 | |
259 | %patch26 -p1 | |
260 | %patch27 -p1 | |
261 | %patch28 -p1 | |
262 | ||
263 | cd bind | |
264 | tar -xvf bind.tar.gz | |
265 | ln -s bind-9* bind | |
266 | cd .. | |
267 | ||
268 | %patch29 -p1 | |
269 | %patch30 -p1 | |
ceee8beb ER |
270 | |
271 | # Copy in documentation and example scripts for LDAP patch to dhcpd | |
272 | cp -a %{SOURCE11} README.ldap | |
273 | cp -a %{SOURCE12} doc | |
274 | cp -a %{SOURCE13} contrib | |
275 | ||
ceee8beb ER |
276 | # Replace @PRODUCTNAME@ |
277 | %{__sed} -i -e 's|@PRODUCTNAME@|%{vvendor}|g' common/dhcp-options.5 | |
278 | %{__sed} -i -e 's|@PRODUCTNAME@|%{vvendor}|g' configure.ac | |
279 | ||
280 | # Update paths in all man pages | |
281 | for page in client/dhclient.conf.5 client/dhclient.leases.5 client/dhclient-script.8 client/dhclient.8; do | |
282 | %{__sed} -i -e 's|CLIENTBINDIR|/sbin|g' \ | |
283 | -e 's|RUNDIR|%{_localstatedir}/run|g' \ | |
284 | -e 's|DBDIR|%{_localstatedir}/db/dhclient|g' \ | |
285 | -e 's|ETCDIR|%{_sysconfdir}|g' $page | |
286 | done | |
287 | ||
288 | for page in server/dhcpd.conf.5 server/dhcpd.leases.5 server/dhcpd.8; do | |
289 | %{__sed} -i -e 's|CLIENTBINDIR|/sbin|g' \ | |
290 | -e 's|RUNDIR|%{_localstatedir}/run|g' \ | |
291 | -e 's|DBDIR|%{_localstatedir}/db/dhcpd|g' \ | |
292 | -e 's|ETCDIR|%{_sysconfdir}|g' $page | |
293 | done | |
294 | ||
0770f14a | 295 | %build |
03a6f6c6 AM |
296 | %{__libtoolize} |
297 | %{__aclocal} | |
298 | %{__autoconf} | |
299 | %{__autoheader} | |
300 | %{__automake} | |
4a7f1e32 | 301 | CFLAGS="%{rpmcflags} -fPIC -D_GNU_SOURCE=1" |
6e6494f3 | 302 | %configure \ |
d812b9c4 JP |
303 | %ifarch %{arm} |
304 | LIBS="-latomic" \ | |
305 | %endif | |
6db0fb84 | 306 | %{!?with_static_libs:--disable-static} \ |
6e6494f3 | 307 | --enable-dhcpv6 \ |
9f600e9f | 308 | --with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases \ |
309 | --with-cli-lease-file=/var/lib/dhclient/dhclient.leases \ | |
310 | --with-srv-pid-file=/var/run/dhcpd.pid \ | |
311 | --with-cli-pid-file=/var/run/dhclient.pid \ | |
312 | --with-relay-pid-file=/var/run/dhcrelay.pid \ | |
1830ecd4 JP |
313 | --with%{!?with_ldap:out}-ldap \ |
314 | --with%{!?with_systemd:out}-systemd | |
19507c9d | 315 | %{__make} -j1 |
cd3ce1e4 | 316 | |
317 | %install | |
318 | rm -rf $RPM_BUILD_ROOT | |
51ba29e1 | 319 | install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig,dhclient-enter-hooks.d,dhclient-exit-hooks.d},%{_pkgconfigdir},/var/lib/{dhcpd,dhclient}} |
cd3ce1e4 | 320 | |
771aee8c | 321 | %{__make} install \ |
6e6494f3 | 322 | DESTDIR=$RPM_BUILD_ROOT |
967af251 | 323 | |
cd3ce1e4 | 324 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcpd |
6e6494f3 AM |
325 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcpd6 |
326 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcp-relay | |
327 | install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/dhcpd | |
328 | install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/dhcp-relay | |
12777244 | 329 | |
1830ecd4 JP |
330 | %if %{with systemd} |
331 | install -d $RPM_BUILD_ROOT%{systemdunitdir} | |
332 | cp -p %{SOURCE6} %{SOURCE7} %{SOURCE8} $RPM_BUILD_ROOT%{systemdunitdir} | |
333 | %endif | |
334 | ||
12777244 | 335 | install client/scripts/linux $RPM_BUILD_ROOT/sbin/dhclient-script |
cd3ce1e4 | 336 | |
96d6b603 JR |
337 | install server/dhcpd.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/dhcpd.conf |
338 | install doc/examples/dhcpd-dhcpv6.conf $RPM_BUILD_ROOT%{_sysconfdir}/dhcpd6.conf | |
ceee8beb | 339 | |
967af251 | 340 | %if %{with ldap} |
ceee8beb | 341 | install -d $RPM_BUILD_ROOT%{schemadir} |
03a6f6c6 | 342 | install %{SOURCE10} $RPM_BUILD_ROOT%{schemadir} |
967af251 | 343 | %endif |
1d526f5b | 344 | |
4ca0a88e | 345 | :> $RPM_BUILD_ROOT%{_sysconfdir}/dhclient.conf |
9da55644 | 346 | |
ceee8beb | 347 | touch $RPM_BUILD_ROOT/var/lib/dhcpd/dhcpd.leases |
b0caeee3 | 348 | touch $RPM_BUILD_ROOT/var/lib/dhclient/dhclient.leases |
3bb4bab9 | 349 | |
ceee8beb | 350 | touch $RPM_BUILD_ROOT/var/lib/dhcpd/dhcpd6.leases |
8f0f47ea AM |
351 | touch $RPM_BUILD_ROOT/var/lib/dhclient/dhclient6.leases |
352 | ||
6db0fb84 ER |
353 | %if %{with static_libs} |
354 | # HACK: strip doesn't like .a inside .a | |
ceee8beb | 355 | install -d stripworkdir |
6db0fb84 ER |
356 | cd stripworkdir |
357 | for a in $RPM_BUILD_ROOT%{_libdir}/*.a; do | |
358 | archives=$(ar t $a | grep '\.a$' || :) | |
359 | [ "$archives" ] || continue | |
360 | ||
361 | # hope we don't have to recurse here | |
362 | for ar in $archives; do | |
363 | rm -f *.o *.a | |
364 | ar x $a $ar | |
365 | ar x $ar | |
366 | ar d $a $ar | |
367 | ar cr $a *.o | |
368 | done | |
369 | done | |
370 | cd - | |
371 | %endif | |
372 | ||
82fbb222 JB |
373 | %clean |
374 | rm -rf $RPM_BUILD_ROOT | |
375 | ||
cd3ce1e4 | 376 | %post |
ceee8beb | 377 | touch /var/lib/dhcpd/dhcpd.leases |
7089f517 | 378 | touch /var/lib/dhcpd/dhcpd6.leases |
3a01d42c | 379 | /sbin/chkconfig --add dhcpd |
30c45ada | 380 | %service dhcpd restart "dhcpd daemon" |
ceee8beb | 381 | /sbin/chkconfig --add dhcpd6 |
6e6494f3 | 382 | %service dhcpd6 restart "dhcpd IPv6 daemon" |
1830ecd4 | 383 | %{?with_systemd:%systemd_post dhcpd.service dhcpd6.service} |
cd3ce1e4 | 384 | |
208108e2 JB |
385 | %preun |
386 | if [ "$1" = "0" ];then | |
30c45ada | 387 | %service dhcpd stop |
208108e2 | 388 | /sbin/chkconfig --del dhcpd |
ceee8beb | 389 | %service dhcpd6 stop |
6e6494f3 | 390 | /sbin/chkconfig --del dhcpd6 |
208108e2 | 391 | fi |
1830ecd4 JP |
392 | %{?with_systemd:%systemd_preun dhcpd.service dhcpd6.service} |
393 | ||
394 | %postun | |
395 | %{?with_systemd:%systemd_reload} | |
208108e2 | 396 | |
1830ecd4 | 397 | %triggerpostun -- dhcp < 4.4.2-2 |
ceee8beb ER |
398 | if ! grep -q ddns-update-style /etc/dhcpd.conf; then |
399 | %{__sed} -i -e '1iddns-update-style none;' /etc/dhcpd.conf | |
6acbb058 | 400 | fi |
1830ecd4 | 401 | %systemd_trigger dhcpd.service dhcpd6.service |
6acbb058 | 402 | |
b62eae95 | 403 | %post -n openldap-schema-dhcp |
967af251 JR |
404 | %openldap_schema_register %{schemadir}/dhcp.schema -d core |
405 | %service -q ldap restart | |
406 | ||
b62eae95 | 407 | %postun -n openldap-schema-dhcp |
967af251 JR |
408 | if [ "$1" = "0" ]; then |
409 | %openldap_schema_unregister %{schemadir}/dhcp.schema | |
410 | %service -q ldap restart | |
411 | fi | |
412 | ||
7940deed | 413 | %post relay |
3a01d42c | 414 | /sbin/chkconfig --add dhcp-relay |
3a01d42c | 415 | if [ -f /var/lock/subsys/dhcrelay ]; then |
30c45ada | 416 | mv -f /var/lock/subsys/{dhcrelay,dhcp-relay} |
3a01d42c | 417 | fi |
30c45ada | 418 | %service dhcp-relay restart "dhcrelay daemon" |
1830ecd4 | 419 | %{?with_systemd:%systemd_post dhcp-relay.service} |
7940deed | 420 | |
7940deed | 421 | %preun relay |
3a01d42c | 422 | if [ "$1" = "0" ];then |
30c45ada | 423 | %service dhcp-relay stop |
3a01d42c | 424 | /sbin/chkconfig --del dhcp-relay |
425 | fi | |
1830ecd4 JP |
426 | %{?with_systemd:%systemd_preun dhcp-relay.service} |
427 | ||
428 | %postun relay | |
429 | %{?with_systemd:%systemd_reload} | |
430 | ||
431 | %triggerpostun -- dhcp-relay < 4.4.2-2 | |
432 | %systemd_trigger dhcp-relay.service | |
7940deed | 433 | |
51ba29e1 JK |
434 | %triggerun client -- %{name}-client < 4:4.0.2-2 |
435 | if [ -f /etc/dhclient-enter-hooks ] ; then | |
436 | mv /etc/dhclient-enter-hooks /etc/dhclient-enter-hooks.d/ | |
437 | fi | |
438 | if [ -f /etc/dhclient-exit-hooks ] ; then | |
439 | mv /etc/dhclient-exit-hooks /etc/dhclient-exit-hooks.d/ | |
440 | fi | |
441 | ||
cd3ce1e4 | 442 | %files |
443 | %defattr(644,root,root,755) | |
96d6b603 | 444 | %doc doc/* README RELNOTES server/dhcpd.conf.example LICENSE |
9f600e9f | 445 | %doc contrib/ms2isc %{?with_ldap:contrib/dhcpd-conf-to-ldap README.ldap} |
ac30bae3 ER |
446 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dhcpd |
447 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dhcpd.conf | |
a5aaaa8f | 448 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dhcpd6.conf |
967af251 | 449 | %attr(755,root,root) %{_bindir}/omshell |
cd3ce1e4 | 450 | %attr(755,root,root) %{_sbindir}/dhcpd |
d3d402da | 451 | %attr(754,root,root) /etc/rc.d/init.d/dhcpd |
6e6494f3 | 452 | %attr(754,root,root) /etc/rc.d/init.d/dhcpd6 |
1830ecd4 JP |
453 | %if %{with systemd} |
454 | %{systemdunitdir}/dhcpd.service | |
455 | %{systemdunitdir}/dhcpd6.service | |
456 | %endif | |
ceee8beb ER |
457 | %attr(750,root,root) %dir /var/lib/dhcpd |
458 | %ghost /var/lib/dhcpd/dhcpd.leases | |
459 | %ghost /var/lib/dhcpd/dhcpd6.leases | |
6acbb058 JB |
460 | %{_mandir}/man1/omshell.1* |
461 | %{_mandir}/man5/dhcp-eval.5* | |
462 | %{_mandir}/man5/dhcp-options.5* | |
463 | %{_mandir}/man5/dhcpd.conf.5* | |
464 | %{_mandir}/man5/dhcpd.leases.5* | |
465 | %{_mandir}/man8/dhcpd.8* | |
3bb4bab9 | 466 | |
467 | %files client | |
ccf64540 | 468 | %defattr(644,root,root,755) |
96d6b603 | 469 | %doc contrib/sethostname.sh client/dhclient.conf.example |
967af251 | 470 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dhclient.conf |
3bb4bab9 | 471 | %attr(755,root,root) /sbin/dhclient |
ceee8beb | 472 | %attr(755,root,root) /sbin/dhclient-script |
6acbb058 JB |
473 | %{_mandir}/man5/dhclient.conf.5* |
474 | %{_mandir}/man5/dhclient.leases.5* | |
475 | %{_mandir}/man8/dhclient.8* | |
476 | %{_mandir}/man8/dhclient-script.8* | |
ceee8beb | 477 | %dir %attr(750,root,root) /var/lib/dhclient |
b0caeee3 | 478 | %ghost /var/lib/dhclient/dhclient.leases |
8f0f47ea | 479 | %ghost /var/lib/dhclient/dhclient6.leases |
45ef0575 | 480 | |
e8a49f77 | 481 | %files client-dirs |
482 | %defattr(644,root,root,755) | |
483 | %dir %{_sysconfdir}/dhclient-enter-hooks.d | |
484 | %dir %{_sysconfdir}/dhclient-exit-hooks.d | |
485 | ||
45ef0575 | 486 | %files relay |
487 | %defattr(644,root,root,755) | |
ac30bae3 | 488 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dhcp-relay |
45ef0575 | 489 | %attr(755,root,root) %{_sbindir}/dhcrelay |
3ac86cff | 490 | %attr(754,root,root) /etc/rc.d/init.d/dhcp-relay |
1830ecd4 | 491 | %{?with_systemd:%{systemdunitdir}/dhcp-relay.service} |
6acbb058 | 492 | %{_mandir}/man8/dhcrelay.8* |
1d526f5b JK |
493 | |
494 | %files devel | |
495 | %defattr(644,root,root,755) | |
3ae1beff | 496 | %{_libdir}/libdhcp.a |
6acbb058 JB |
497 | %{_libdir}/libdhcpctl.a |
498 | %{_libdir}/libomapi.a | |
6e6494f3 | 499 | %{_includedir}/dhcpctl |
6acbb058 JB |
500 | %{_includedir}/omapip |
501 | %{_mandir}/man3/dhcpctl.3* | |
502 | %{_mandir}/man3/omapi.3* | |
c494ae74 | 503 | |
ceee8beb ER |
504 | %if %{with ldap} |
505 | %files -n openldap-schema-dhcp | |
506 | %defattr(644,root,root,755) | |
507 | %{schemadir}/dhcp.schema | |
508 | %endif |