makedepends=(libtirpc systemd)

description="portmap replacement which supports RPC over various protocols"
url="http://rpcbind.sourceforge.net/"

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

name=rpcbind
version=1.2.6
release=5
grat_os_version=1.0-RC1

PKGMK_GROUPS=(man)

source=(https://repo.grat-os.fr/files/grat-os-${grat_os_version}.tar.xz
  http://downloads.sourceforge.net/rpcbind/rpcbind-$version.tar.bz2
  http://www.linuxfromscratch.org/patches/blfs/svn/rpcbind-$version-vulnerability_fixes-1.patch)

build() {
  cd rpcbind-$version

  sed -i "/servname/s:rpcbind:sunrpc:" src/rpcbind.c

  patch -Np1 -i ../rpcbind-$version-vulnerability_fixes-1.patch

  ./configure --prefix=/usr       \
              --bindir=/usr/bin   \
              --sbindir=/usr/sbin \
              --with-rpcuser=rpc  \
              --enable-warmstarts

  make
  make DESTDIR=$PKG install

  cd ../grat-os-${grat_os_version}
  make DESTDIR=$PKG install-rpcbind
}
