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