]> git.pld-linux.org Git - packages/dhcp.git/blob - dhcp.spec
33d8714823ab904198223bb28f1465bedb98360e
[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.3
11 Release:        3
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:  f91416a0b8ed3fd0601688cf0b7df58f
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 URL:            http://www.isc.org/sw/dhcp/
27 BuildRequires:  groff
28 %{?with_ldap:BuildRequires:     openldap-devel}
29 BuildRequires:  rpmbuild(macros) >= 1.268
30 Requires(post): fileutils
31 Requires(post,preun):   /sbin/chkconfig
32 Requires:       rc-scripts >= 0.2.0
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.
49
50 %description -l pl
51 Serwer DHCP (Dynamic Host Configuration Protocol).
52
53 DHCP to protokó³ pozwalaj±cy urz±dzeniom pracuj±cym w sieci IP na
54 pobieranie ich konfiguracji IP (adresu, maski podsieci, adresu
55 rozg³oszeniowego itp.) z serwera DHCP. U³atwia on administrowanie
56 du¿ymi sieciami IP.
57
58 %description -l pt_BR
59 DHCP permite que hosts numa rede TCP/IP requisitem e tenham seus
60 endereços IP alocados dinamicamente, permite também descobrir
61 informações sobre a rede em que estão conectados. BOOTP provê uma
62 funcionalidade similar, com certas restrições. Este servidor também
63 atende aquelas requisições. Esta versão é ainda considerada um
64 software BETA.
65
66 %package client
67 Summary:        DHCP Client
68 Summary(pl):    Klient DHCP
69 Group:          Networking/Daemons
70 Requires(post): fileutils
71 Obsoletes:      dhclient
72 Obsoletes:      pump
73
74 %description client
75 Dynamic Host Configuration Protocol Client.
76
77 %description client -l pl
78 Klient DHCP (Dynamic Host Configuration Protocol).
79
80 %package relay
81 Summary:        DHCP Relay Agent
82 Summary(pl):    Agent przekazywania informacji DHCP
83 Group:          Networking/Daemons
84 Requires(post): fileutils
85 Requires(post,preun):   /sbin/chkconfig
86 Requires:       rc-scripts >= 0.2.0
87
88 %description relay
89 Dhcp relay is a relay agent for DHCP packets. It is used on a subnet
90 with DHCP clients to "relay" their requests to a subnet that has a
91 DHCP server on it. Because DHCP packets can be broadcast, they will
92 not be routed off of the local subnet. The DHCP relay takes care of
93 this for the client.
94
95 %description relay -l pl
96 Agent przekazywania DHCP (Dynamic Host Configuration Protocol) miêdzy
97 podsieciami. Poniewa¿ komunikaty DHCP mog± byæ przekazywane w formie
98 rozg³oszeniowej, bez tego agenta nie zostan± przerutowane do innej
99 podsieci.
100
101 %package devel
102 Summary:        DHCP development includes and libs
103 Summary(pl):    Pliki nag³ówkowe i biblioteki dla oprogramowania DHCP
104 Group:          Development/Libraries
105
106 %description devel
107 Includes OMAPI and dhcptl libraries.
108
109 OMAPI is an programming layer designed for controlling remote
110 applications, and for querying them for their state. It is currently
111 used by the ISC DHCP server.
112
113 The dhcpctl set of functions provide an API that can be used to
114 communicate with and manipulate a running ISC DHCP server.
115
116 %description devel -l pl
117 Zawiera biblioteki OMAPI oraz dhcpctl.
118
119 OMAPI to warstwa programowa stworzona do kontroli zdalnych aplikacji i
120 odpytywania o ich stan. Aktualnie jest u¿ywana przez serwer ISC DHCP.
121
122 dhcpctl to zbiór funkcji tworz±cych API, które mo¿e byæ u¿ywane do
123 komunikacji z dzia³aj±cym serwerem ISC DHCP i jego kontroli.
124
125 %prep
126 %setup -q
127 install %{SOURCE4} .
128 %patch0 -p1
129 %{?with_ldap:%patch1 -p1}
130 %{?with_ldap:%patch2 -p1}
131 %patch3 -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         CC="%{__cc}" \
146         COPTS="%{rpmcflags} \
147         -D_PATH_DHCPD_DB=\\\"/var/lib/%{name}/dhcpd.leases\\\" \
148         -D_PATH_DHCLIENT_DB=\\\"/var/lib/%{name}/dhclient.leases\\\" \
149         -DUSE_SOCKET_FALLBACK" \
150         DEBUG="" VARDB="/var/lib/%{name}"
151
152 %install
153 rm -rf $RPM_BUILD_ROOT
154 install -d $RPM_BUILD_ROOT{/sbin,%{_sbindir},%{_bindir},%{_mandir}/man{5,8}} \
155         $RPM_BUILD_ROOT{/var/lib/%{name},%{_sysconfdir}/{rc.d/init.d,sysconfig}}
156
157 %{__make} install \
158         DESTDIR=$RPM_BUILD_ROOT \
159         CLIENTBINDIR=/sbin \
160         BINDIR=%{_sbindir} \
161         LIBDIR=%{_libdir} \
162         INCDIR=%{_includedir} \
163         ADMMANDIR=%{_mandir}/man8 \
164         ADMMANEXT=.8 \
165         FFMANDIR=%{_mandir}/man5 \
166         LIBMANDIR=%{_mandir}/man3 \
167         LIBMANEXT=.3 \
168         USRMANDIR=%{_mandir}/man1 \
169         USRMANEXT=.1 \
170         VARDB=/var/lib/%{name} \
171         FFMANEXT=.5
172
173 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcpd
174 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcp-relay
175 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/dhcp-relay
176 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/dhcpd.conf
177 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/dhcpd
178
179 mv $RPM_BUILD_ROOT%{_mandir}/man3/omshell.3 \
180         $RPM_BUILD_ROOT%{_mandir}/man1/omshell.1
181
182 install client/scripts/linux $RPM_BUILD_ROOT%{_sbindir}/dhclient-script
183
184 touch $RPM_BUILD_ROOT/var/lib/%{name}/{dhcpd,dhclient}.leases
185
186 %clean
187 rm -rf $RPM_BUILD_ROOT
188
189 %post
190 /sbin/chkconfig --add dhcpd
191 touch /var/lib/%{name}/dhcpd.leases
192 if [ ! -d /var/lib/dhcp ]; then
193         install -d /var/lib/dhcp
194 fi
195 %service dhcpd restart "dhcpd daemon"
196
197 %preun
198 if [ "$1" = "0" ];then
199         %service dhcpd stop
200         /sbin/chkconfig --del dhcpd
201 fi
202
203 %post client
204 if [ ! -d /var/lib/dhcp ]; then
205         install -d /var/lib/dhcp
206 fi
207
208 %post relay
209 /sbin/chkconfig --add dhcp-relay
210 if [ -f /var/lock/subsys/dhcrelay ]; then
211         mv -f /var/lock/subsys/{dhcrelay,dhcp-relay}
212 fi
213 %service dhcp-relay restart "dhcrelay daemon"
214
215 %preun relay
216 if [ "$1" = "0" ];then
217         %service dhcp-relay stop
218         /sbin/chkconfig --del dhcp-relay
219 fi
220
221 %triggerpostun -- dhcp < 3.0
222 if [ "`grep ddns-update-style /etc/dhcpd.conf`" = "" ]; then
223         umask 027
224         echo "ddns-update-style none;" > /etc/dhcpd.conf.tmp
225         echo "" >> /etc/dhcpd.conf.tmp
226         cat /etc/dhcpd.conf >>/etc/dhcpd.conf.tmp
227         mv -f /etc/dhcpd.conf.tmp /etc/dhcpd.conf
228 fi
229
230 %files
231 %defattr(644,root,root,755)
232 %doc doc/* README RELNOTES dhcpd.conf.sample
233 %{?with_ldap:%doc contrib/*}
234 %{_mandir}/man1/*
235 %{_mandir}/man5/dhcp*
236 %{_mandir}/man8/dhcp*
237 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dhcpd
238 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dhcpd.conf
239 %attr(755,root,root) %{_bindir}/*
240 %attr(755,root,root) %{_sbindir}/dhcpd
241 %attr(754,root,root) /etc/rc.d/init.d/dhcpd
242 %attr(750,root,root) %dir /var/lib/%{name}
243 %ghost /var/lib/%{name}/dhcpd.leases
244
245 %files client
246 %defattr(644,root,root,755)
247 %attr(755,root,root) /sbin/dhclient
248 %attr(755,root,root) /sbin/dhclient-script
249 %{_mandir}/man[58]/dhclient*
250 %ghost /var/lib/%{name}/dhclient.leases
251
252 %files relay
253 %defattr(644,root,root,755)
254 %{_mandir}/man8/dhcrelay*
255 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dhcp-relay
256 %attr(755,root,root) %{_sbindir}/dhcrelay
257 %attr(754,root,root) /etc/rc.d/init.d/dhcp-relay
258
259 %files devel
260 %defattr(644,root,root,755)
261 %{_mandir}/man3/*
262 %{_libdir}/*.a
263 %{_includedir}/*
This page took 0.092468 seconds and 3 git commands to generate.