]>
Commit | Line | Data |
---|---|---|
1 | # TODO | |
2 | # - should unmount /proc/fs/nfsd and /var/lib/nfs/rpc_pipefs at package | |
3 | # uninstall (or in service nfs stop) | |
4 | # | |
5 | # Conditional build: | |
6 | %bcond_without nfs4 # without NFSv4 support | |
7 | %bcond_without mount # don't build mount.nfs program | |
8 | # | |
9 | Summary: Kernel NFS server | |
10 | Summary(pl.UTF-8): Działający na poziomie jądra serwer NFS | |
11 | Summary(pt_BR.UTF-8): Os utilitários para o cliente e servidor NFS do Linux | |
12 | Summary(ru.UTF-8): Утилиты для NFS и демоны поддержки для NFS-сервера ядра | |
13 | Summary(uk.UTF-8): Утиліти для NFS та демони підтримки для NFS-сервера ядра | |
14 | Name: nfs-utils | |
15 | Version: 1.1.0 | |
16 | %define _pre rc1 | |
17 | Release: 0.%{_pre}.1 | |
18 | License: GPL | |
19 | Group: Networking/Daemons | |
20 | Source0: http://dl.sourceforge.net/nfs/%{name}-%{version}-%{_pre}.tar.gz | |
21 | # Source0-md5: 924dd05dc3958d4da585d74808bb84c4 | |
22 | Source1: ftp://ftp.linuxnfs.sourceforge.org/pub/nfs/nfs.doc.tar.gz | |
23 | # Source1-md5: ae7db9c61c5ad04f83bb99e5caed73da | |
24 | Source2: nfs.init | |
25 | Source3: nfslock.init | |
26 | Source4: nfsfs.init | |
27 | Source5: rpcidmapd.init | |
28 | Source6: rpcgssd.init | |
29 | Source7: rpcsvcgssd.init | |
30 | Source8: nfs.sysconfig | |
31 | Source9: nfslock.sysconfig | |
32 | Source10: nfsfs.sysconfig | |
33 | Patch0: %{name}-eepro-support.patch | |
34 | Patch1: %{name}-install.patch | |
35 | # http://www.citi.umich.edu/projects/nfsv4/linux/nfs-utils-patches/ | |
36 | #Patch2: %{name}-1.0.11-CITI_NFS4_ALL-1.dif | |
37 | Patch2: %{name}-CITI_NFS4.patch | |
38 | Patch3: %{name}-statdpath.patch | |
39 | Patch4: %{name}-mount-fake.patch | |
40 | Patch5: %{name}-mountd.patch | |
41 | Patch6: %{name}-idmapd.conf.patch | |
42 | Patch7: %{name}-keytab-path.patch | |
43 | Patch8: %{name}-subsys.patch | |
44 | URL: http://nfs.sourceforge.net/ | |
45 | BuildRequires: autoconf >= 2.59 | |
46 | BuildRequires: automake | |
47 | BuildRequires: cpp | |
48 | BuildRequires: e2fsprogs-devel >= 1.39-5 | |
49 | %if %{with nfs4} | |
50 | BuildRequires: krb5-devel >= 1.6 | |
51 | BuildRequires: libevent-devel >= 1.2 | |
52 | BuildRequires: libnfsidmap-devel | |
53 | BuildRequires: librpcsecgss-devel >= 0.11-3 | |
54 | %endif | |
55 | BuildRequires: libtool | |
56 | BuildRequires: libwrap-devel | |
57 | BuildRequires: pkgconfig | |
58 | BuildRequires: sed >= 4.0 | |
59 | Requires(post): fileutils | |
60 | Requires(post): sed >= 4.0 | |
61 | Requires(post,preun): /sbin/chkconfig | |
62 | Requires: %{name}-common = %{version}-%{release} | |
63 | Requires: portmap >= 4.0 | |
64 | Requires: rc-scripts >= 0.4.1.5 | |
65 | Requires: setup >= 2.4.6-7 | |
66 | Provides: nfsdaemon | |
67 | Obsoletes: knfsd | |
68 | Obsoletes: nfs-server | |
69 | Obsoletes: nfsdaemon | |
70 | Conflicts: kernel < 2.2.5 | |
71 | ExcludeArch: armv4l | |
72 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
73 | ||
74 | %description | |
75 | This is the *new* kernel NFS server and related tools. It provides a | |
76 | much higher level of performance than the traditional Linux user-land | |
77 | NFS server. | |
78 | ||
79 | %description -l pl.UTF-8 | |
80 | To jest *nowy* działający na poziomie jądra serwer NFS oraz związane z | |
81 | nim narzędzia. Serwer ten dostarcza znacznie większą wydajność niż | |
82 | tradycyjny, działający na poziomie użytkownika serwer NFS. | |
83 | ||
84 | %description -l pt_BR.UTF-8 | |
85 | O pacote nfs-utils provê os utilitários para o cliente e servidor NFS | |
86 | do Linux. | |
87 | ||
88 | %description -l ru.UTF-8 | |
89 | Пакет nfs-utils предоставляет демона для NFS-сервера, включенного в | |
90 | ядро, и сопутствующие утилиты, которые обеспечивают намного большую | |
91 | производительность, чем традиционные Linux NFS-сервера, используемые | |
92 | большинством пользователей. | |
93 | ||
94 | %description -l uk.UTF-8 | |
95 | Пакет nfs-utils надає демона для NFS-сервера, вбудованого в ядро, та | |
96 | супутні утиліти, які забезпечують набагато більшу продуктивність, ніж | |
97 | традиційні Linux NFS-сервери, які використовує більшість користувачів. | |
98 | ||
99 | %package clients | |
100 | Summary: Clients for connecting to a remote NFS server | |
101 | Summary(pl.UTF-8): Klienci do łączenia się ze zdalnym serwerem NFS | |
102 | Group: Networking | |
103 | Requires(post,preun): /sbin/chkconfig | |
104 | Requires: %{name}-common = %{version}-%{release} | |
105 | Requires: psmisc | |
106 | Requires: rc-scripts | |
107 | Provides: nfs-server-clients | |
108 | Provides: nfsclient | |
109 | Obsoletes: knfsd-clients | |
110 | Obsoletes: nfs-server-clients | |
111 | Obsoletes: nfsclient | |
112 | ||
113 | %description clients | |
114 | The nfs-server-clients package contains the showmount program. | |
115 | Showmount queries the mount daemon on a remote host for information | |
116 | about the NFS (Network File System) server on the remote host. For | |
117 | example, showmount can display the clients which are mounted on that | |
118 | host. This package is not needed to mount NFS volumes. | |
119 | ||
120 | %description clients -l pl.UTF-8 | |
121 | Pakiet zawiera program showmount służący do odpytywania serwera NFS. | |
122 | Showmount pyta demona na zdalnej maszynie o informacje NFS na zdalnym | |
123 | hoście. Na przykład, showmount potrafi pokazać klientów, którzy są | |
124 | zamountowani na tym serwerze. Ten pakiet nie jest konieczny do | |
125 | zamountowania zasobów NFS. | |
126 | ||
127 | %package lock | |
128 | Summary: Programs for NFS file locking | |
129 | Summary(pl.UTF-8): Programy do obsługi blokowania plików poprzez NFS (lock) | |
130 | Group: Networking | |
131 | Requires(post,preun): /sbin/chkconfig | |
132 | Requires: portmap >= 4.0 | |
133 | Requires: rc-scripts | |
134 | Provides: group(rpcstatd) | |
135 | Provides: user(rpcstatd) | |
136 | Provides: nfslockd | |
137 | Obsoletes: knfsd-lock | |
138 | Obsoletes: nfslockd | |
139 | ||
140 | %description lock | |
141 | The nfs-lock pacage contains programs which support the NFS file lock. | |
142 | Install nfs-lock if you want to use file lock over NFS. | |
143 | ||
144 | %description lock -l pl.UTF-8 | |
145 | Ten pakiet zawiera programy umożliwiające wykonywanie blokowania | |
146 | plików (file locking) poprzez NFS. | |
147 | ||
148 | %package common | |
149 | Summary: Common programs for NFS | |
150 | Summary(pl.UTF-8): Wspólne programy do obsługi NFS | |
151 | Group: Networking | |
152 | ||
153 | %description common | |
154 | Common programs for NFS. | |
155 | ||
156 | %description common -l pl.UTF-8 | |
157 | Wspólne programy do obsługi NFS. | |
158 | ||
159 | %prep | |
160 | %setup -q -a1 -n %{name}-%{version}-%{_pre} | |
161 | %patch0 -p1 | |
162 | %patch1 -p1 | |
163 | %patch2 -p1 | |
164 | %patch3 -p1 | |
165 | %patch4 -p1 | |
166 | %patch5 -p1 | |
167 | %patch6 -p1 | |
168 | %patch7 -p1 | |
169 | %patch8 -p1 | |
170 | ||
171 | %build | |
172 | %configure \ | |
173 | %if %{with nfs4} | |
174 | --enable-gss \ | |
175 | --with-krb5=%{_prefix} \ | |
176 | --enable-nfsv4 \ | |
177 | %else | |
178 | --disable-gss \ | |
179 | --disable-nfsv4 \ | |
180 | %endif | |
181 | %{?with_mount:--enable-mount} \ | |
182 | --disable-rquotad \ | |
183 | --enable-nfsv3 \ | |
184 | --enable-secure-statd \ | |
185 | --with-statedir=/var/lib/nfs \ | |
186 | --with-tcp-wrappers | |
187 | ||
188 | %{__make} all | |
189 | ||
190 | %install | |
191 | rm -rf $RPM_BUILD_ROOT | |
192 | install -d $RPM_BUILD_ROOT{/sbin,%{_sbindir},%{_mandir}/man{5,8}} \ | |
193 | $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig} \ | |
194 | $RPM_BUILD_ROOT%{_var}/lib/nfs/{rpc_pipefs,v4recovery,statd} | |
195 | ||
196 | %{__make} install \ | |
197 | DESTDIR=$RPM_BUILD_ROOT | |
198 | ||
199 | cat >$RPM_BUILD_ROOT%{_sbindir}/start-statd <<EOF | |
200 | #!/bin/sh | |
201 | # mount.nfs calls this script when mounting a filesystem with locking | |
202 | # enabled, but when statd does not seem to be running (based on | |
203 | # /var/run/rpc.statd.pid). | |
204 | exec /sbin/service nfslock start | |
205 | EOF | |
206 | ||
207 | sed -e "s|#!/bin/bash|#!/bin/sh|" utils/gssd/gss_destroy_creds > $RPM_BUILD_ROOT%{_sbindir}/gss_destroy_creds | |
208 | ||
209 | mv $RPM_BUILD_ROOT%{_sbindir}/rpcdebug $RPM_BUILD_ROOT/sbin | |
210 | install utils/idmapd/idmapd.conf $RPM_BUILD_ROOT%{_sysconfdir}/ | |
211 | ||
212 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/nfs | |
213 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/nfslock | |
214 | install %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/nfsfs | |
215 | install %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/idmapd | |
216 | install %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/gssd | |
217 | install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/svcgssd | |
218 | install %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/nfsd | |
219 | install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/nfslock | |
220 | install %{SOURCE10} $RPM_BUILD_ROOT/etc/sysconfig/nfsfs | |
221 | ||
222 | > $RPM_BUILD_ROOT%{_var}/lib/nfs/rmtab | |
223 | > $RPM_BUILD_ROOT%{_sysconfdir}/exports | |
224 | ||
225 | rm $RPM_BUILD_ROOT%{_mandir}/man8/rpc.{mountd,nfsd,statd,svcgssd,gssd,idmapd,sm-notify}.8 | |
226 | echo ".so mountd.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.mountd.8 | |
227 | echo ".so nfsd.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.nfsd.8 | |
228 | echo ".so statd.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.statd.8 | |
229 | echo ".so sm-notify.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.sm-notify.8 | |
230 | %if %{with nfs4} | |
231 | echo ".so gssd.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.gssd.8 | |
232 | echo ".so idmapd.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.idmapd.8 | |
233 | echo ".so svcgssd.8" > $RPM_BUILD_ROOT%{_mandir}/man8/rpc.svcgssd.8 | |
234 | %endif | |
235 | ||
236 | touch $RPM_BUILD_ROOT/var/lib/nfs/xtab | |
237 | ||
238 | ln -sf /bin/true $RPM_BUILD_ROOT/sbin/fsck.nfs | |
239 | ||
240 | cp -a nfs html | |
241 | ||
242 | %clean | |
243 | rm -rf $RPM_BUILD_ROOT | |
244 | ||
245 | %post | |
246 | /sbin/chkconfig --add nfs | |
247 | %service nfs restart "NFS daemon" | |
248 | %if %{with nfs4} | |
249 | /sbin/chkconfig --add svcgssd | |
250 | %service svcgssd restart "RPC svcgssd" | |
251 | %endif | |
252 | ||
253 | %preun | |
254 | if [ "$1" = "0" ]; then | |
255 | %service nfs stop | |
256 | /sbin/chkconfig --del nfs | |
257 | %if %{with nfs4} | |
258 | %service svcgssd stop | |
259 | /sbin/chkconfig --del svcgssd | |
260 | %endif | |
261 | fi | |
262 | ||
263 | %post clients | |
264 | /sbin/chkconfig --add nfsfs | |
265 | %service nfsfs restart | |
266 | %if %{with nfs4} | |
267 | /sbin/chkconfig --add gssd | |
268 | %service gssd restart "RPC gssd" | |
269 | %endif | |
270 | ||
271 | %preun clients | |
272 | if [ "$1" = "0" ]; then | |
273 | %service nfsfs stop | |
274 | /sbin/chkconfig --del nfsfs | |
275 | %if %{with nfs4} | |
276 | %service gssd stop | |
277 | /sbin/chkconfig --del gssd | |
278 | %endif | |
279 | fi | |
280 | ||
281 | %pre lock | |
282 | %groupadd -g 191 rpcstatd | |
283 | %useradd -u 191 -d /var/lib/nfs/statd -s /bin/false -c "RPC statd user" -g rpcstatd rpcstatd | |
284 | ||
285 | %post lock | |
286 | /sbin/chkconfig --add nfslock | |
287 | %service nfslock restart "RPC statd" | |
288 | ||
289 | %preun lock | |
290 | if [ "$1" = "0" ]; then | |
291 | %service nfslock stop | |
292 | /sbin/chkconfig --del nfslock | |
293 | fi | |
294 | ||
295 | %postun lock | |
296 | if [ "$1" = "0" ]; then | |
297 | %userremove rpcstatd | |
298 | %groupremove rpcstatd | |
299 | fi | |
300 | ||
301 | %if %{with nfs4} | |
302 | %post common | |
303 | /sbin/chkconfig --add idmapd | |
304 | %service idmapd restart "RPC idmapd" | |
305 | ||
306 | %preun common | |
307 | if [ "$1" = "0" ]; then | |
308 | %service idmapd stop | |
309 | /sbin/chkconfig --del idmapd | |
310 | fi | |
311 | %endif | |
312 | ||
313 | %triggerpostun -- %{name} <= 1.1.0-0.rc1.1 | |
314 | /sbin/chkconfig nfs reset | |
315 | %if %{with nfs4} | |
316 | /sbin/chkconfig svcgssd reset | |
317 | %endif | |
318 | ||
319 | %triggerpostun lock -- %{name}-lock <= 1.1.0-0.rc1.1 | |
320 | /sbin/chkconfig nfslock reset | |
321 | ||
322 | %triggerpostun clients -- %{name}-clients < 1.1.0-0.rc1.1 | |
323 | if [ -f /etc/sysconfig/nfsclient.rpmsave ]; then | |
324 | mv -f /etc/sysconfig/nfsfs{,.rpmnew} | |
325 | mv -f /etc/sysconfig/nfsclient.rpmsave /etc/sysconfig/nfsfs | |
326 | fi | |
327 | /sbin/chkconfig nfsfs reset | |
328 | %if %{with nfs4} | |
329 | /sbin/chkconfig gssd reset | |
330 | %endif | |
331 | ||
332 | %if %{with nfs4} | |
333 | %triggerpostun common -- %{name}-common <= 1.1.0-0.rc1.1 | |
334 | /sbin/chkconfig idmapd reset | |
335 | %endif | |
336 | ||
337 | %files | |
338 | %defattr(644,root,root,755) | |
339 | %doc ChangeLog README html | |
340 | %attr(755,root,root) /sbin/rpcdebug | |
341 | %attr(755,root,root) /sbin/fsck.nfs | |
342 | %attr(755,root,root) %{_sbindir}/exportfs | |
343 | %attr(755,root,root) %{_sbindir}/rpc.mountd | |
344 | %attr(755,root,root) %{_sbindir}/rpc.nfsd | |
345 | %attr(755,root,root) %{_sbindir}/nfsstat | |
346 | ||
347 | %attr(754,root,root) /etc/rc.d/init.d/nfs | |
348 | ||
349 | %attr(664,root,fileshare) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/exports | |
350 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/nfsd | |
351 | %config(noreplace) %verify(not md5 mtime size) %{_var}/lib/nfs/xtab | |
352 | %config(noreplace) %verify(not md5 mtime size) %{_var}/lib/nfs/etab | |
353 | %config(noreplace) %verify(not md5 mtime size) %{_var}/lib/nfs/rmtab | |
354 | ||
355 | %{_mandir}/man5/exports.5* | |
356 | %{_mandir}/man7/nfsd.7* | |
357 | %{_mandir}/man8/exportfs.8* | |
358 | %{_mandir}/man8/mountd.8* | |
359 | %{_mandir}/man8/nfsd.8* | |
360 | %{_mandir}/man8/nfsstat.8* | |
361 | %{_mandir}/man8/rpc.mountd.8* | |
362 | %{_mandir}/man8/rpc.nfsd.8* | |
363 | %{_mandir}/man8/rpcdebug.8* | |
364 | %if %{with nfs4} | |
365 | %attr(754,root,root) /etc/rc.d/init.d/svcgssd | |
366 | %attr(755,root,root) %{_sbindir}/rpc.svcgssd | |
367 | %{_mandir}/man8/*svcgss* | |
368 | %endif | |
369 | ||
370 | %files lock | |
371 | %defattr(644,root,root,755) | |
372 | %attr(700,rpcstatd,rpcstatd) %dir %{_var}/lib/nfs/statd | |
373 | %attr(755,root,root) %{_sbindir}/rpc.statd | |
374 | %attr(755,root,root) %{_sbindir}/sm-notify | |
375 | %attr(755,root,root) %{_sbindir}/start-statd | |
376 | %attr(754,root,root) /etc/rc.d/init.d/nfslock | |
377 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/nfslock | |
378 | %{_mandir}/man8/*statd.8* | |
379 | %{_mandir}/man8/*sm-notify.8* | |
380 | %config(noreplace) %verify(not md5 mtime size) %{_var}/lib/nfs/state | |
381 | ||
382 | %files clients | |
383 | %defattr(644,root,root,755) | |
384 | %attr(754,root,root) /etc/rc.d/init.d/nfsfs | |
385 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/nfsfs | |
386 | %attr(755,root,root) %{_sbindir}/showmount | |
387 | %{_mandir}/man8/showmount.8* | |
388 | %if %{with mount} | |
389 | %attr(4755,root,root) /sbin/mount.nfs | |
390 | %attr(4755,root,root) /sbin/mount.nfs4 | |
391 | %attr(4755,root,root) /sbin/umount.nfs | |
392 | %attr(4755,root,root) /sbin/umount.nfs4 | |
393 | %{_mandir}/man8/*mount.nfs.8* | |
394 | %endif | |
395 | %if %{with nfs4} | |
396 | %attr(754,root,root) /etc/rc.d/init.d/gssd | |
397 | %attr(755,root,root) %{_sbindir}/rpc.gssd | |
398 | %{_mandir}/man8/rpc.gssd* | |
399 | %{_mandir}/man8/gssd* | |
400 | %endif | |
401 | ||
402 | %files common | |
403 | %defattr(644,root,root,755) | |
404 | %attr(755,root,root) %dir %{_var}/lib/nfs | |
405 | %attr(755,root,root) %dir %{_var}/lib/nfs/rpc_pipefs | |
406 | %attr(755,root,root) %dir %{_var}/lib/nfs/v4recovery | |
407 | %{_mandir}/man5/nfs* | |
408 | %if %{with nfs4} | |
409 | %attr(754,root,root) /etc/rc.d/init.d/idmapd | |
410 | %attr(755,root,root) %{_sbindir}/gss_* | |
411 | %attr(755,root,root) %{_sbindir}/rpc.idmapd | |
412 | %attr(660,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/idmapd.conf | |
413 | %{_mandir}/man[58]/*idmap* | |
414 | %endif |