# $Id: Portfile 65530 2010-03-27 02:57:42Z ryandesign@macports.org $
PortSystem	1.0
name		hypermail
version		2.3.0
categories	mail textproc
maintainers	nomaintainer
description	Hypermail, mail to cross-referenced HTML converter
long_description	Hypermail is a program that takes a file of mail \
		messages in UNIX mailbox format and generates a set of \
		cross-referenced HTML documents.

homepage	    http://www.hypermail-project.org/
master_sites    sourceforge

platforms	darwin
checksums   md5     510c46b98314f4e98796719f27865846 \
            sha1    6d06175b6c5aa290b1d26a4daa06b79a8d30adbd \
            rmd160  65565776556847cd317672d9014d5b4aadd5b34c
worksrcdir  ${name}

patchfiles	patch-src-proto.h \
            patch-src-file.c.diff \
            patch-configure.diff \
            patch-config.h.in.diff

# Rename INSTALL as make gets confused otherwise (on HFS+ where INSTALL and
# install are the same file)
post-patch {
		system "mv ${worksrcpath}/INSTALL ${worksrcpath}/INSTALL.txt"
}

# enable-static/disable-shared are here as they need to be passed to the
# internal PCRE stuff, otherwise it'll build PCRE shared, but not install
# which is a bit bad...
configure.args	--enable-static --disable-shared --without-gdbm \
		--mandir=\\\${prefix}/share/man \
		--with-cgidir=\\\${prefix}/share/hypermail/cgi-bin \
		--with-htmldir=\\\${prefix}/share/doc/hypermail \

destroot.args	prefix=${destroot}${prefix}

variant gdbm {
    depends_lib             port:gdbm
    configure.args-delete	--without-gdbm
    configure.args-append	--with-gdbm=${prefix}
}

livecheck.type      regex
livecheck.regex     ${name}-(\[0-9.\]+)\\.tar
