1{ fetchurl, stdenv, tcp_wrappers, utillinux, libcap, libtirpc, libevent, libnfsidmap
2, lvm2, e2fsprogs, python, sqlite
3}:
4
5stdenv.mkDerivation rec {
6 name = "nfs-utils-1.3.2"; # NOTE: when updating, remove the HACK BUG FIX below
7
8 src = fetchurl {
9 url = "mirror://sourceforge/nfs/${name}.tar.bz2";
10 sha256 = "1xwilpdr1vizq2yhpzxpwqqr9f8kn0dy2wcpc626mf30ybp7572v";
11 };
12
13 buildInputs =
14 [ tcp_wrappers utillinux libcap libtirpc libevent libnfsidmap
15 lvm2 e2fsprogs python sqlite
16 ];
17
18 # FIXME: Add the dependencies needed for NFSv4 and TI-RPC.
19 configureFlags =
20 [ "--disable-gss"
21 "--with-statedir=/var/lib/nfs"
22 "--with-tirpcinclude=${libtirpc}/include/tirpc"
23 ]
24 ++ stdenv.lib.optional (stdenv ? glibc) "--with-rpcgen=${stdenv.glibc}/bin/rpcgen";
25
26 patchPhase =
27 ''
28 for i in "tests/"*.sh
29 do
30 sed -i "$i" -e's|/bin/bash|/bin/sh|g'
31 chmod +x "$i"
32 done
33 sed -i s,/usr/sbin,$out/sbin, utils/statd/statd.c
34
35 # HACK BUG FIX: needed for 1.3.2
36 # http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=commit;h=17a3e5bffb7110d46de1bf42b64b90713ff5ea50
37 sed -e 's,daemon_init(!,daemon_init(,' -i utils/statd/statd.c
38 '';
39
40 preBuild =
41 ''
42 makeFlags="sbindir=$out/sbin"
43 installFlags="statedir=$TMPDIR statdpath=$TMPDIR" # hack to make `make install' work
44 '';
45
46 # One test fails on mips.
47 doCheck = !stdenv.isMips;
48
49 meta = {
50 description = "Linux user-space NFS utilities";
51
52 longDescription = ''
53 This package contains various Linux user-space Network File
54 System (NFS) utilities, including RPC `mount' and `nfs'
55 daemons.
56 '';
57
58 homepage = http://nfs.sourceforge.net/;
59 license = stdenv.lib.licenses.gpl2;
60
61 platforms = stdenv.lib.platforms.linux;
62 maintainers = [ ];
63 };
64}