APP=libtirpc
VERSION=1.2.6
BUILD=1sml
HOMEPAGE='http://sourceforge.net/projects/libtirpc/'
DOWNLOAD='https://downloads.sourceforge.net/libtirpc/libtirpc-1.2.6.tar.bz2'
DESC="Transport-Independent RPC library"
REQUIRES="musl"

build() {
  mkandenterbuilddir
  rm -rf $APP-$VERSION

  tar xf $SRCDIR/$APP-$VERSION.tar.?z*
  cd $APP-$VERSION 
  fixbuilddirpermissions

  patch -p1 < $SRCDIR/soname-suffix.patch

  ./configure \
    --prefix="" \
    --sysconfdir=/etc \
    --disable-static \
    --disable-gssapi 

  make
  make install DESTDIR=$PKG 

  cp COPYING $PKGDOCS/

  # Don't use .3t man page suffix:
  if [ -d $PKG/share/man/man3 ]; then
    ( cd $PKG/share/man/man3
      for file in *.3t ; do
        mv $file $(basename $file .3t).3
      done
    )
  fi

  mv $PKG/etc/netconfig $PKG/etc/netconfig.new

  mkfinalpkg
}

SHA512SUMS="
bcb6b5c062c1301aa1246ec93ae0a5c1d221b8421126d020863517cb814b43ed038fb6c0c2faf4e68ff133b69abefe4f4d42bfc870671da6c27ca941a30b155a  libtirpc-1.2.6.tar.bz2
ccb6352c3c3b896765581595b9a0e45a527c34cbc16495d3890f996a2bc077a02ceae0ddd63505b3420a8414b93a267c82a11bc75997de8f9ca0a22e4c4daa5c  soname-suffix.patch
"
