# $Id: Portfile 87751 2011-12-04 08:20:53Z ryandesign@macports.org $

PortSystem 1.0
name	   	watch
version	    	3.2.8
revision	1
categories  	sysutils
maintainers 	yahoo.com:mjhsieh
description    	watch executes a program periodically, showing output fullscreen
long_description	watch is like "top" for arbitrary commands. It runs \
			command repeatedly, displaying its output (the first \
			screen full). This  allows you to watch the program \
			output change over time. This is part of the  linux \
			"procps" package

homepage	http://sourceforge.net/projects/procps/
master_sites	http://procps.sourceforge.net/
distname	procps-${version}
platforms	darwin
checksums	md5 9532714b6846013ca9898984ba4cd7e0 \
		sha1 a0c86790569dec26b5d9037e8868ca907acc9829

use_configure	no

depends_lib	port:ncurses

variant universal {}
if {[variant_isset universal]} {
	set archflags ${configure.universal_cflags}
} else {
	set archflags ${configure.cc_archflags}
}

build.target	watch
build.args	CC="${configure.cc} ${archflags}" \
		LDFLAGS="${configure.ldflags}" \
		PKG_LDFLAGS=""

pre-build {
    build.args-append   CPPFLAGS="[exec ${prefix}/bin/ncurses5-config --cflags]"
}

destroot	{ 
	xinstall -m 0755 ${worksrcpath}/watch ${destroot}${prefix}/bin
	xinstall -m 0644 ${worksrcpath}/watch.1 \
		${destroot}${prefix}/share/man/man1
}

livecheck.url	[lindex ${master_sites} 0]
livecheck.regex	procps-(\[0-9.\]*)${extract.suffix}
