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