]> git.pld-linux.org Git - packages/dhcp.git/blob - dhcp.spec
- added dhcp-dhcpd_lease_time.patch to not send lease time in 64bit
[packages/dhcp.git] / dhcp.spec
1 #
2 # Conditional build:
3 %bcond_with     ldap    # with support for ldap storage
4 #
5 Summary:        DHCP Server
6 Summary(es):    Servidor DHCP
7 Summary(pl):    Serwer DHCP
8 Summary(pt_BR): Servidor DHCP (Protocolo de configuração dinâmica de hosts)
9 Name:           dhcp
10 Version:        3.0.4
11 Release:        2
12 Epoch:          3
13 License:        distributable
14 Group:          Networking/Daemons
15 Source0:        ftp://ftp.isc.org/isc/dhcp/%{name}-%{version}.tar.gz
16 # Source0-md5:  004ef935fd54b8046b16bdde31a9e151
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 Patch3:         %{name}-client-script-redhat.patch
26 Patch4:         %{name}-dhcpd_lease_time.patch
27 URL:            http://www.isc.org/sw/dhcp/
28 BuildRequires:  groff
29 %{?with_ldap:BuildRequires:     openldap-devel}
30 BuildRequires:  rpmbuild(macros) >= 1.268
31 Requires(post): fileutils
32 Requires(post,preun):   /sbin/chkconfig
33 Requires:       rc-scripts >= 0.2.0
34 Provides:       dhcpd
35 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
37 %description
38 DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
39 individual devices on an IP network to get their own network
40 configuration information (IP address, subnetmask, broadcast address,
41 etc.) from a DHCP server. The overall purpose of DHCP is to make it
42 easier to administer a large network.
43
44 %description -l es
45 DHCP permite que hosts en una red TCP/IP soliciten y tengan sus
46 direcciones IP alocadas dinámicamente, permite también descubrir
47 información sobre la red en que están conectados. BOOTP provee una
48 funcionalidad similar, con ciertas restricciones. Este servidor
49 también las atiende.
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:      dhclient
73 Obsoletes:      pump
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 Requires(post): fileutils
86 Requires(post,preun):   /sbin/chkconfig
87 Requires:       rc-scripts >= 0.2.0
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
128 install %{SOURCE4} .
129 %patch0 -p1
130 %{?with_ldap:%patch1 -p1}
131 %{?with_ldap:%patch2 -p1}
132 %patch3 -p1
133 %patch4 -p1
134
135 cd doc
136 echo "dhcpd complies with the following RFCs:" > rfc-compliance
137 ls rfc*.txt >> rfc-compliance
138 rm -f rfc*.txt
139 cd ..
140
141 %build
142 # Notice: this is not autoconf configure!!!!!!!
143 #         do not change it to %%configure
144 ./configure
145
146 %{__make} \
147         CC="%{__cc}" \
148         COPTS="%{rpmcflags} \
149         -D_PATH_DHCPD_DB=\\\"/var/lib/%{name}/dhcpd.leases\\\" \
150         -D_PATH_DHCLIENT_DB=\\\"/var/lib/%{name}/dhclient.leases\\\" \
151         -DUSE_SOCKET_FALLBACK" \
152         DEBUG="" VARDB="/var/lib/%{name}"
153
154 %install
155 rm -rf $RPM_BUILD_ROOT
156 install -d $RPM_BUILD_ROOT{/sbin,%{_sbindir},%{_bindir},%{_mandir}/man{5,8}} \
157         $RPM_BUILD_ROOT{/var/lib/%{name},%{_sysconfdir}/{rc.d/init.d,sysconfig}}
158
159 %{__make} install \
160         DESTDIR=$RPM_BUILD_ROOT \
161         CLIENTBINDIR=/sbin \
162         BINDIR=%{_sbindir} \
163         LIBDIR=%{_libdir} \
164         INCDIR=%{_includedir} \
165         ADMMANDIR=%{_mandir}/man8 \
166         ADMMANEXT=.8 \
167         FFMANDIR=%{_mandir}/man5 \
168         LIBMANDIR=%{_mandir}/man3 \
169         LIBMANEXT=.3 \
170         USRMANDIR=%{_mandir}/man1 \
171         USRMANEXT=.1 \
172         VARDB=/var/lib/%{name} \
173         FFMANEXT=.5
174
175 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcpd
176 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcp-relay
177 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/dhcp-relay
178 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/dhcpd.conf
179 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/dhcpd
180
181 mv $RPM_BUILD_ROOT%{_mandir}/man3/omshell.3 \
182         $RPM_BUILD_ROOT%{_mandir}/man1/omshell.1
183
184 install client/scripts/linux $RPM_BUILD_ROOT%{_sbindir}/dhclient-script
185
186 touch $RPM_BUILD_ROOT/var/lib/%{name}/{dhcpd,dhclient}.leases
187
188 %clean
189 rm -rf $RPM_BUILD_ROOT
190
191 %post
192 /sbin/chkconfig --add dhcpd
193 touch /var/lib/%{name}/dhcpd.leases
194 if [ ! -d /var/lib/dhcp ]; then
195         install -d /var/lib/dhcp
196 fi
197 %service dhcpd restart "dhcpd daemon"
198
199 %preun
200 if [ "$1" = "0" ];then
201         %service dhcpd stop
202         /sbin/chkconfig --del dhcpd
203 fi
204
205 %post client
206 if [ ! -d /var/lib/dhcp ]; then
207         install -d /var/lib/dhcp
208 fi
209
210 %post relay
211 /sbin/chkconfig --add dhcp-relay
212 if [ -f /var/lock/subsys/dhcrelay ]; then
213         mv -f /var/lock/subsys/{dhcrelay,dhcp-relay}
214 fi
215 %service dhcp-relay restart "dhcrelay daemon"
216
217 %preun relay
218 if [ "$1" = "0" ];then
219         %service dhcp-relay stop
220         /sbin/chkconfig --del dhcp-relay
221 fi
222
223 %triggerpostun -- dhcp < 3.0
224 if [ "`grep ddns-update-style /etc/dhcpd.conf`" = "" ]; then
225         umask 027
226         echo "ddns-update-style none;" > /etc/dhcpd.conf.tmp
227         echo "" >> /etc/dhcpd.conf.tmp
228         cat /etc/dhcpd.conf >>/etc/dhcpd.conf.tmp
229         mv -f /etc/dhcpd.conf.tmp /etc/dhcpd.conf
230 fi
231
232 %files
233 %defattr(644,root,root,755)
234 %doc doc/* README RELNOTES dhcpd.conf.sample
235 %{?with_ldap:%doc contrib/*}
236 %{_mandir}/man1/*
237 %{_mandir}/man5/dhcp*
238 %{_mandir}/man8/dhcp*
239 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dhcpd
240 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dhcpd.conf
241 %attr(755,root,root) %{_bindir}/*
242 %attr(755,root,root) %{_sbindir}/dhcpd
243 %attr(754,root,root) /etc/rc.d/init.d/dhcpd
244 %attr(750,root,root) %dir /var/lib/%{name}
245 %ghost /var/lib/%{name}/dhcpd.leases
246
247 %files client
248 %defattr(644,root,root,755)
249 %attr(755,root,root) /sbin/dhclient
250 %attr(755,root,root) /sbin/dhclient-script
251 %{_mandir}/man[58]/dhclient*
252 %ghost /var/lib/%{name}/dhclient.leases
253
254 %files relay
255 %defattr(644,root,root,755)
256 %{_mandir}/man8/dhcrelay*
257 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dhcp-relay
258 %attr(755,root,root) %{_sbindir}/dhcrelay
259 %attr(754,root,root) /etc/rc.d/init.d/dhcp-relay
260
261 %files devel
262 %defattr(644,root,root,755)
263 %{_mandir}/man3/*
264 %{_libdir}/*.a
265 %{_includedir}/*
This page took 0.193162 seconds and 4 git commands to generate.