# $Id: Portfile 68378 2010-06-02 14:15:19Z rmsfisher@macports.org $

PortSystem 1.0

name			help2man
version			1.38.2
categories		textproc
platforms		darwin
maintainers		nomaintainer
description		automatically generate simple man pages

long_description	help2man is a tool for automatically generating simple \
			manual pages from program output.

homepage		http://www.gnu.org/software/help2man/
master_sites	gnu

checksums           md5     426671c6fe79e5ef2233303367eab5a6 \
                    sha1    6f0109589eca3286c2619b03efd3f85433696039 \
                    rmd160  8edf87341eef27195006a264d29685b0f85ae099

depends_lib		path:bin/perl:perl5 port:p5-locale-gettext \
				port:gettext port:libiconv

configure.perl	${prefix}/bin/perl

configure.args  --enable-nls

post-patch {
	if {[variant_isset universal]} {
		reinplace "s|-shared|-bundle ${configure.ldflags} ${configure.universal_ldflags}|" ${worksrcpath}/Makefile.in
	} else {
	    if {![info exists configure.ld_archflags]} {
	        set configure.ld_archflags ${configure.cc_archflags}
	    }
	    reinplace "s|-shared|-bundle ${configure.ldflags} ${configure.ld_archflags}|" ${worksrcpath}/Makefile.in
	}
}

post-destroot {
	set docdir ${prefix}/share/doc/${name}
	xinstall -d ${destroot}${docdir}
	xinstall -m 0644 -W ${worksrcpath} COPYING debian/changelog NEWS README THANKS \
		${destroot}${docdir}
}
