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