# $Id$
# Maintainer: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Eric BĂ©langer <eric@archlinux.org>

pkgname=procps-ng
pkgver=3.3.11
pkgrel=2
pkgdesc='Utilities for monitoring your system and its processes'
url='https://gitlab.com/procps-ng/procps'
license=('GPL' 'LGPL')
arch=('i686' 'x86_64')
makedepends=('systemd')
depends=('ncurses' 'libsystemd')
source=("http://downloads.sourceforge.net/project/${pkgname}/Production/${pkgname}-${pkgver}.tar.xz")
sha1sums=('1bdca65547df9ed019bd83649b0f8b8eaa017e25')

groups=('base')

conflicts=('procps' 'sysvinit-tools')
provides=('procps' 'sysvinit-tools')
replaces=('procps' 'sysvinit-tools')

install=install

prepare() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	sed 's:<ncursesw/:<:g' -i watch.c
}

build() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	./configure \
		--prefix=/usr \
		--exec-prefix=/ \
		--sysconfdir=/etc \
		--libdir=/usr/lib \
		--bindir=/usr/bin \
		--sbindir=/usr/bin \
		--enable-watch8bit \
		--with-systemd \

	make
}

package() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	make DESTDIR="${pkgdir}" install

	# provided by util-linux
	rm "${pkgdir}/usr/bin/kill"
	rm "${pkgdir}/usr/share/man/man1/kill.1"
}