APP=procps-ng
VERSION=3.3.12
BUILD=1sml
PSMISCVERSION=23.3
HOMEPAGE='http://sourceforge.net/projects/procps-ng/'
DESC="utilities for displaying process information"
REQUIRES="musl"

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

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

  patch -p1 < $SRCDIR/procps-ng-netbsd-curses.patch

  STRIP=false \
  CPPFLAGS="$CFLAGS -DGLOB_TILDE=0 -DAF_INET6=10 -DAF_INET=2" \
  ./configure \
    --prefix="" \
    --sysconfdir=/etc \
    --bindir=/bin \
    --sbindir=/bin \
    --disable-nls 

  make V=1 LDFLAGS="-all-static"
  make install DESTDIR=$PKG

  cp COPYING* $PKGDOCS/

  tar xf $SRCDIR/psmisc-$PSMISCVERSION.tar.?z*
  cd psmisc-$PSMISCVERSION

  LDFLAGS="-static" \
  ./configure \
    --prefix=""

  make 
  make install DESTDIR=$PKG

  cp COPYING $PKGDOCS/COPYING.psmisc

  mkfinalpkg
}

SHA512SUMS="
2fcdd0773d980f54b18146086beb24a4b3e44e495a5d3fdaf0b5239b6b555cc330d326eab048cc8439162490d03d426c6dfdf27539d3aebd76a2c7e150db8a7f  procps-ng-3.3.12.tar.lz
791ffef78d87b092d653da98710b338017466a9e1e1935968b9f0194ccef8da941317aa0c39d821d46b20d95d6539ccf78e5ebb71ad1032ae62337a397180d58  psmisc-23.3.tar.xz
f33f577194c5699d0f4d57f4f8dfbdb8ef1373368d3ac6d5d3207e59ff044273bcef9421f1f67bf2f372fdd96fdf1c80d228a0b41d001c08f5544237897c4d26  procps-ng-netbsd-curses.patch
"
