# $Id: Portfile 103301 2013-02-21 04:52:50Z larryv@macports.org $

PortSystem 1.0
name	   	watch
version	    	3.3.6
categories  	sysutils
platforms	darwin
license		GPL-2
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-ng/
master_sites	sourceforge:procps-ng
distname	procps-ng-${version}
use_xz yes

checksums       rmd160  44b6abdbf6e6fdebdf2f1848207392314b542c05 \
                sha256  d09ac4df3793f632d481f6547c39c6d835a7aa7bd5a302fcb0885ff7691c124c

depends_lib	port:ncurses

patchfiles      0001-configure-check-for-program_invocation_name.patch \
                0002-watch-Remove-unused-header.patch \
                0003-configure-Check-for-stdio_ext.h.patch \
                0004-configure-Check-for-error.h.patch
patch.pre_args  -p1

# Disable gettext due to linking problems
# and we are not going to install any catalogs anyway
configure.args  --disable-nls

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}" \
		AM_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.regex	procps-ng-(\[0-9.\]*)${extract.suffix}
