]> git.pld-linux.org Git - packages/dhcp.git/blob - dhcp.spec
- rel .2
[packages/dhcp.git] / dhcp.spec
1 #
2 # Conditional build:
3 %bcond_without  ldap    # without support for ldap storage
4 #
5 Summary:        DHCP Server
6 Summary(es.UTF-8):      Servidor DHCP
7 Summary(pl.UTF-8):      Serwer DHCP
8 Summary(pt_BR.UTF-8):   Servidor DHCP (Protocolo de configuração dinâmica de hosts)
9 Name:           dhcp
10 %define _pre    a3
11 Version:        3.1.0
12 Release:        0.%{_pre}.2
13 Epoch:          4
14 License:        distributable
15 Group:          Networking/Daemons
16 Source0:        ftp://ftp.isc.org/isc/dhcp/%{name}-%{version}%{_pre}.tar.gz
17 # Source0-md5:  d09be1a80982b78482e8fbd416924468
18 Source1:        %{name}.init
19 Source2:        %{name}-relay.init
20 Source3:        %{name}.sysconfig
21 Source4:        %{name}-relay.sysconfig
22 Patch0:         %{name}-dhclient.script.patch
23 Patch1:         %{name}-if_buffer_size.patch
24 # http://home.ntelos.net/~masneyb/dhcp-3.0.5-ldap-patch
25 Patch2:         %{name}-ldap.patch
26 Patch3:         %{name}-client-script-redhat.patch
27 Patch4:         %{name}-3.0.3-x-option.patch
28 Patch5:         %{name}-typo.patch
29 Patch6:         %{name}-arg-concat.patch
30 Patch7:         %{name}-split-VARDB.patch
31 URL:            http://www.isc.org/sw/dhcp/
32 BuildRequires:  groff
33 %{?with_ldap:BuildRequires:     openldap-devel}
34 %{?with_ldap:BuildRequires:     openssl-devel}
35 BuildRequires:  rpmbuild(macros) >= 1.304
36 Requires(post): coreutils
37 Requires(post,preun):   /sbin/chkconfig
38 Requires:       rc-scripts >= 0.2.0
39 Provides:       dhcpd
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %define         schemadir       /usr/share/openldap/schema
43
44 %description
45 DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
46 individual devices on an IP network to get their own network
47 configuration information (IP address, subnetmask, broadcast address,
48 etc.) from a DHCP server. The overall purpose of DHCP is to make it
49 easier to administer a large network.
50
51 %description -l es.UTF-8
52 DHCP permite que hosts en una red TCP/IP soliciten y tengan sus
53 direcciones IP alocadas dinámicamente, permite también descubrir
54 información sobre la red en que están conectados. BOOTP provee una
55 funcionalidad similar, con ciertas restricciones. Este servidor
56 también las atiende.
57
58 %description -l pl.UTF-8
59 Serwer DHCP (Dynamic Host Configuration Protocol).
60
61 DHCP to protokół pozwalający urządzeniom pracującym w sieci IP na
62 pobieranie ich konfiguracji IP (adresu, maski podsieci, adresu
63 rozgłoszeniowego itp.) z serwera DHCP. Ułatwia on administrowanie
64 dużymi sieciami IP.
65
66 %description -l pt_BR.UTF-8
67 DHCP permite que hosts numa rede TCP/IP requisitem e tenham seus
68 endereços IP alocados dinamicamente, permite também descobrir
69 informações sobre a rede em que estão conectados. BOOTP provê uma
70 funcionalidade similar, com certas restrições. Este servidor também
71 atende aquelas requisições. Esta versão é ainda considerada um
72 software BETA.
73
74 %package -n openldap-schema-dhcp
75 Summary:        LDAP Schema for DHCP Server
76 Summary(pl.UTF-8):      Schemat LDAP dla serwera DHCP
77 Group:          Networking/Daemons
78 Requires(post,postun):  sed >= 4.0
79 Requires:       openldap-servers
80
81 %description -n openldap-schema-dhcp
82 This package contains LDAPv3 schema for use with the DHCP Server.
83
84 %description -n openldap-schema-dhcp -l pl.UTF-8
85 Ten pakiet zawiera schemat LDAPv3 do używania z serwerem DHCP.
86
87 %package client
88 Summary:        DHCP Client
89 Summary(pl.UTF-8):      Klient DHCP
90 Group:          Networking/Daemons
91 Requires:       coreutils
92 Requires:       iproute2
93 Requires:       net-tools
94 Obsoletes:      dhclient
95
96 %description client
97 Dynamic Host Configuration Protocol Client.
98
99 %description client -l pl.UTF-8
100 Klient DHCP (Dynamic Host Configuration Protocol).
101
102 %package relay
103 Summary:        DHCP Relay Agent
104 Summary(pl.UTF-8):      Agent przekazywania informacji DHCP
105 Group:          Networking/Daemons
106 Requires(post): coreutils
107 Requires(post,preun):   /sbin/chkconfig
108 Requires:       rc-scripts >= 0.2.0
109
110 %description relay
111 Dhcp relay is a relay agent for DHCP packets. It is used on a subnet
112 with DHCP clients to "relay" their requests to a subnet that has a
113 DHCP server on it. Because DHCP packets can be broadcast, they will
114 not be routed off of the local subnet. The DHCP relay takes care of
115 this for the client.
116
117 %description relay -l pl.UTF-8
118 Agent przekazywania DHCP (Dynamic Host Configuration Protocol) między
119 podsieciami. Ponieważ komunikaty DHCP mogą być przekazywane w formie
120 rozgłoszeniowej, bez tego agenta nie zostaną przerutowane do innej
121 podsieci.
122
123 %package devel
124 Summary:        DHCP development includes and libs
125 Summary(pl.UTF-8):      Pliki nagłówkowe i biblioteki dla oprogramowania DHCP
126 Group:          Development/Libraries
127
128 %description devel
129 Includes OMAPI and dhcptl libraries.
130
131 OMAPI is an programming layer designed for controlling remote
132 applications, and for querying them for their state. It is currently
133 used by the ISC DHCP server.
134
135 The dhcpctl set of functions provide an API that can be used to
136 communicate with and manipulate a running ISC DHCP server.
137
138 %description devel -l pl.UTF-8
139 Zawiera biblioteki OMAPI oraz dhcpctl.
140
141 OMAPI to warstwa programowa stworzona do kontroli zdalnych aplikacji i
142 odpytywania o ich stan. Aktualnie jest używana przez serwer ISC DHCP.
143
144 dhcpctl to zbiór funkcji tworzących API, które może być używane do
145 komunikacji z działającym serwerem ISC DHCP i jego kontroli.
146
147 %prep
148 %setup -q -n %{name}-%{version}%{_pre}
149 %patch0 -p1
150 %patch1 -p1
151 %{?with_ldap:%patch2 -p1}
152 # These two patches are required for dhcdbd to function
153 %patch3 -p1
154 %patch4 -p1
155 #
156 %patch5 -p1
157 %patch6 -p1
158 %patch7 -p1
159
160 %build
161 # NOTE: this is not autoconf configure - do not change it to %%configure
162 ./configure
163
164 %{__make} \
165         CC="%{__cc}" \
166         CC_OPTIONS="%{rpmcflags} \
167                 -D_PATH_DHCPD_DB=\\\"/var/lib/%{name}/dhcpd.leases\\\" \
168                 -DEXTENDED_NEW_OPTION_INFO \
169                 -D_PATH_DHCLIENT_DB=\\\"/var/lib/dhclient/dhclient.leases\\\" \
170         "
171         LFLAGS="%{rpmldflags}" \
172         DEBUG="" \
173         VARDBS="/var/lib/%{name}"
174         VARDBC="/var/lib/dhclient"
175
176 %install
177 rm -rf $RPM_BUILD_ROOT
178 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/{rc.d/init.d,sysconfig},%{schemadir}}
179
180 %{__make} install \
181         DESTDIR=$RPM_BUILD_ROOT \
182         CLIENTBINDIR=/sbin \
183         BINDIR=%{_sbindir} \
184         LIBDIR=%{_libdir} \
185         INCDIR=%{_includedir} \
186         ADMMANDIR=%{_mandir}/man8 \
187         ADMMANEXT=.8 \
188         FFMANDIR=%{_mandir}/man5 \
189         LIBMANDIR=%{_mandir}/man3 \
190         LIBMANEXT=.3 \
191         USRMANDIR=%{_mandir}/man1 \
192         USRMANEXT=.1 \
193         VARDBS=/var/lib/%{name} \
194         VARDBC=/var/lib/dhclient \
195         FFMANEXT=.5
196
197 rm $RPM_BUILD_ROOT%{_mandir}/man3/omshell.3*
198
199 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcpd
200 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcp-relay
201 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/dhcpd
202 install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/dhcp-relay
203
204 install server/dhcpd.conf $RPM_BUILD_ROOT%{_sysconfdir}
205 %if %{with ldap}
206 install contrib/dhcp.schema $RPM_BUILD_ROOT%{schemadir}
207 %endif
208
209 touch $RPM_BUILD_ROOT%{_sysconfdir}/dhclient.conf
210
211 touch $RPM_BUILD_ROOT/var/lib/%{name}/dhcpd.leases
212 touch $RPM_BUILD_ROOT/var/lib/dhclient/dhclient.leases
213
214 %clean
215 rm -rf $RPM_BUILD_ROOT
216
217 %post
218 /sbin/chkconfig --add dhcpd
219 touch /var/lib/%{name}/dhcpd.leases
220 %service dhcpd restart "dhcpd daemon"
221
222 %preun
223 if [ "$1" = "0" ];then
224         %service dhcpd stop
225         /sbin/chkconfig --del dhcpd
226 fi
227
228 %post -n openldap-schema-dhcp
229 %openldap_schema_register %{schemadir}/dhcp.schema -d core
230 %service -q ldap restart
231
232 %postun -n openldap-schema-dhcp
233 if [ "$1" = "0" ]; then
234         %openldap_schema_unregister %{schemadir}/dhcp.schema
235         %service -q ldap restart
236 fi
237
238 %post client
239 if [ -f /var/lib/dhcp/dhclient.leases.rpmsave ]; then
240         mv /var/lib/dhcp/dhclient.leases.rpmsave /var/lib/dhclient/dhclient.leases
241 fi
242
243 %post relay
244 /sbin/chkconfig --add dhcp-relay
245 if [ -f /var/lock/subsys/dhcrelay ]; then
246         mv -f /var/lock/subsys/{dhcrelay,dhcp-relay}
247 fi
248 %service dhcp-relay restart "dhcrelay daemon"
249
250 %preun relay
251 if [ "$1" = "0" ];then
252         %service dhcp-relay stop
253         /sbin/chkconfig --del dhcp-relay
254 fi
255
256 %triggerpostun -- dhcp < 3.0
257 if [ "`grep ddns-update-style /etc/dhcpd.conf`" = "" ]; then
258         umask 027
259         echo "ddns-update-style none;" > /etc/dhcpd.conf.tmp
260         echo "" >> /etc/dhcpd.conf.tmp
261         cat /etc/dhcpd.conf >>/etc/dhcpd.conf.tmp
262         mv -f /etc/dhcpd.conf.tmp /etc/dhcpd.conf
263 fi
264
265 %files
266 %defattr(644,root,root,755)
267 %doc doc/* README RELNOTES server/dhcpd.conf LICENSE
268 %doc contrib/ms2isc
269 %{?with_ldap:%doc README.ldap Changelog-LDAP contrib/dhcpd-conf-to-ldap.pl}
270 %{_mandir}/man1/*
271 %{_mandir}/man5/dhcp*
272 %{_mandir}/man8/dhcp*
273 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dhcpd
274 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dhcpd.conf
275 %attr(755,root,root) %{_bindir}/omshell
276 %attr(755,root,root) %{_sbindir}/dhcpd
277 %attr(754,root,root) /etc/rc.d/init.d/dhcpd
278 %attr(750,root,root) %dir /var/lib/%{name}
279 %ghost /var/lib/%{name}/dhcpd.leases
280
281 %if %{with ldap}
282 %files -n openldap-schema-dhcp
283 %defattr(644,root,root,755)
284 %doc contrib/dhcpd-conf-to-ldap.pl
285 %{schemadir}/*.schema
286 %endif
287
288 %files client
289 %defattr(644,root,root,755)
290 %doc contrib/sethostname.sh
291 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dhclient.conf
292 %attr(755,root,root) /sbin/dhclient
293 %attr(755,root,root) /sbin/dhclient-script
294 %{_mandir}/man[58]/dhclient*
295 %attr(750,root,root) %dir /var/lib/dhclient
296 %ghost /var/lib/dhclient/dhclient.leases
297
298 %files relay
299 %defattr(644,root,root,755)
300 %{_mandir}/man8/dhcrelay*
301 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dhcp-relay
302 %attr(755,root,root) %{_sbindir}/dhcrelay
303 %attr(754,root,root) /etc/rc.d/init.d/dhcp-relay
304
305 %files devel
306 %defattr(644,root,root,755)
307 %{_mandir}/man3/*
308 %{_libdir}/*.a
309 %{_includedir}/*
This page took 0.041727 seconds and 3 git commands to generate.