# Created by: Tony Shadwick <tshadwick@oss-solutions.com>
# $FreeBSD: tags/RELEASE_10_1_0/sysutils/htop/Makefile 364090 2014-08-05 12:12:00Z adamw $

PORTNAME=	htop
PORTVERSION=	1.0.2
PORTREVISION=	1
CATEGORIES=	sysutils
MASTER_SITES=	SF

MAINTAINER=	gaod@hychen.org
COMMENT=	Better top(1) - interactive process viewer

OPTIONS_DEFINE=	LSOF
OPTIONS_DEFAULT=LSOF

NOT_FOR_ARCHS=	ia64 powerpc sparc64

GNU_CONFIGURE=	yes
CPPFLAGS+=	-I${LOCALBASE}/include
LIBS+=		-L${LOCALBASE}/lib -lexecinfo

CONFIGURE_ARGS=	--with-proc=/compat/linux/proc --enable-unicode
USES=		ncurses libtool execinfo
USE_AUTOTOOLS=	autoconf aclocal automake
ACLOCAL_ARGS=	-I ${ACLOCAL_DIR}

USE_PYTHON_BUILD=	yes

LSOF_RUN_DEPENDS=	lsof:${PORTSDIR}/sysutils/lsof

post-patch:
	@${REINPLACE_CMD} -e 's:/usr/bin/python:${PYTHON_CMD}:' ${WRKSRC}/scripts/MakeHeader.py

pre-configure:
	@[ -f /compat/linux/proc/stat ] || { ${CAT} ${PKGMESSAGE}; ${FALSE}; }

.include <bsd.port.mk>
