# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgname=psmisc
pkgver=23.4
pkgrel=1
pkgdesc="Miscellaneous procfs tools"
arch=('i686' 'x86_64')
url="https://gitlab.com/psmisc/psmisc"
license=('GPL')
groups=('sys-utils')
depends=('gcc-libs' 'ncurses' 'libiconv' 'libintl')
makedepends=('gcc' 'ncurses-devel' 'libiconv-devel' 'gettext-devel')
source=(${pkgname}-${pkgver}.tar.gz::https://gitlab.com/psmisc/psmisc/-/archive/v${pkgver}/${pkgname}-v${pkgver}.tar.gz)
sha256sums=('3b8ea0262d4c56578f13a1b930cda5721e1137d4e59c8afcc2832a31b85f2682')

prepare() {
  cd ${pkgname}-v${pkgver}
  echo ${pkgver} > .tarball-version
  ./autogen.sh
}

build() {
  cd ${pkgname}-v${pkgver}
  ./configure \
    --prefix=/usr \
    --without-libiconv-prefix \
    --without-libintl-prefix \
    --disable-harden-flags \
    CPPFLAGS="${CPPFLAGS} -I/usr/include/ncursesw"
  make
}

package() {
  cd ${pkgname}-v${pkgver}
  make DESTDIR=${pkgdir} install
}
