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