#!/usr/bin/bash
# JOBoRun		: Jwm OpenBox Obarun RUNit
# Maintainer	: Joe Bo Run <joborun@disroot.org>
# PkgSource		: url="https://gittea.disroot.org/joborun-pkg/jobcore/$pkgname"
# Website		: https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------

pkgname=procps-ng
pkgver=4.0.3
pkgrel=01
pkgdesc='Utilities for monitoring your system and its processes w/o systemd'
url='https://gitlab.com/procps-ng/procps'
depends=(glibc ncurses libncursesw.so)

conflicts=(procps sysvinit-tools)
provides=(procps sysvinit-tools libproc2.so)
replaces=(procps sysvinit-tools)
options=('!emptydirs')
source=(https://downloads.sourceforge.net/project/$pkgname/Production/${pkgname}-${pkgver}.tar.xz{,.asc}
	'sysctl.conf')

prepare() {
  cd procps-ng-$pkgver
  sed 's:<ncursesw/:<:g' -i src/watch.c
}

build() {
  cd procps-ng-$pkgver
  ./configure \
    --prefix=/usr \
    --exec-prefix=/ \
    --sysconfdir=/etc \
    --libdir=/usr/lib \
    --bindir=/usr/bin \
    --sbindir=/usr/bin \
    --enable-watch8bit \
    --without-systemd \
    --disable-modern-top \
    --disable-kill

  make
}

package() {
  cd procps-ng-$pkgver
  make DESTDIR="$pkgdir" install
    install -Dm644 "${srcdir}/sysctl.conf" "$pkgdir/etc/sysctl.conf"
}

#---- arch license gpg-key & sha256sums ----

arch=(x86_64)

license=(GPL LGPL)

validpgpkeys=(5D2FB320B825D93904D205193938F96BDF50FEA5) # Craig Small <csmall@debian.org>

sha256sums=(303c8ec4f96ae18d8eaef86c2bd0986938764a45dc505fe0a0af868c674dba92  # procps-ng-4.0.3.tar.xz
	954700968c51367407cfdd0e13398038a127b716a5cb0996c354928b646a6700  # procps-ng-4.0.3.tar.xz.asc
	1bba9d009539f9fe18c19f5c4f4272da276f5c13c8b21e7291baf2374deb5d24) # sysctl.conf

##  33084a1a5031f4285dc1a788627724be4c435835ed8fab6a916511ed6dfb8997  procps-ng-4.0.3-01-x86_64.pkg.tar.lz
