makedepends=(libtirpc libcap sqlite lvm2 rpcsvc-proto systemd libevent keyutils)
run=(rpcbind)

description="Userspace server and client tools necessary to use the kernel's NFS abilities."
url="http://nfs.sourceforge.net"

packager="Grat-OS Team"
maintainer="Grat-OS Team"

name=nfs-utils
version=2.6.4
release=4

grat_os_version=1.0-RC1

source=(http://downloads.sourceforge.net/nfs/$name-$version.tar.bz2
        https://repo.grat-os.fr/files/grat-os-${grat_os_version}.tar.xz)

build() {
  cd $name-$version

  sed -i "s|sbindir = /sbin|sbindir = /usr/sbin|g" utils/*/Makefile.am

  autoreconf -fiv

  ./configure --prefix=/usr       \
              --sysconfdir=/etc   \
              --sbindir=/usr/sbin \
              --disable-gss       \
              --with-systemd

  make

  make DESTDIR=$PKG install

  chmod u+w,go+r $PKG/usr/sbin/mount.nfs
  chown nobody.nogroup $PKG/var/lib/nfs

  # Services
  cd ../grat-os-${grat_os_version}
  make DESTDIR=$PKG install-nfs-server
}
