app=rpcbind
version=1.2.5
build=1sml
homepage="http://sourceforge.net/projects/rpcbind/"
download="https://sourceforge.net/projects/rpcbind/files/rpcbind/1.2.5/rpcbind-1.2.5.tar.bz2"
desc="Daemon to manage NFS and RPC connections"
requires="bash libtirpc"

build() {
  mkandenterbuilddir
  rm -rf $app-$version

  tar xf $srcdir/$app-$version.tar.?z*
  cd $app-$version 
  fixbuilddirpermissions

  applypatch $srcdir/0001-rpcinfo-Fix-stack-buffer-overflow.patch

  ./configure \
    --prefix="" \
    --bindir=/bin \
    --sbindir=/bin \
    --enable-warmstarts \
    --with-statedir=/var/run/rpcbind \
    --with-rpcuser=rpc \
    --without-systemdsystemunitdir

  make
  make install DESTDIR=$pkg 

  cp COPYING $pkgdocs/

  install -Dm 644 $srcdir/rc.rpc $pkg/etc/rc.d/rc.rpc.new
  install -Dm 644 $srcdir/rpc.default $pkg/etc/default/rpc.new

  mkfinalpkg
}

sha512sums="
e4f9ee36bd5b1b45ba65056fe57571ca5aa895f682bd8220b0fbc5f7d783fa125c40d67b90f934ee50bc11e16ca58fc74fe9b83dab3933dcc9067f60022a8735  rpcbind-1.2.5.tar.lz
84289e99b918fd138e6327a39481e74c80581746087d2e7e55d0c0bdbe068875b6136a6296c0d24a1be01d54b38a9d446794a3d08b53e7d884804a2b375519a2  0001-rpcinfo-Fix-stack-buffer-overflow.patch
"
