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