# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 78915 2011-05-26 18:05:16Z jmr@macports.org $

PortSystem      1.0

name            ssmtp
version         2.64
revision        1
categories      mail
maintainers     nomaintainer
description     Sendmail alternative for small routers (outgoing mail only)
long_description    This is sSMTP, a program that replaces sendmail on workstations that \
                    should send their mail via the departmental mailhub from which they pick up \
                    their mail (via pop, imap, rsmtp, pop_fetch, NFS... or the like).  This \
                    program accepts mail and sends it to the mailhub, optionally replacing the \
                    domain in the From: line with a different one.
platforms       darwin freebsd
homepage        http://packages.qa.debian.org/s/ssmtp.html
master_sites    debian:s/${name}/ \
                ftp://ftp.icm.edu.pl/pub/Linux/debian/pool/main/s/${name}/
use_bzip2       yes
distfiles       ${name}_${version}.orig${extract.suffix}
checksums       md5 65b4e0df4934a6cd08c506cabcbe584f \
                sha1 db0cc6b4f82ab8b4c79335933db9c4db706324d1 \
                rmd160 ea6472e52a499c39d1d8ce7e13add9d8e9accbfb

depends_lib     port:openssl

patchfiles      02-557725-solaris.patch patch-ssmtp.c patch-generate_config \
                patch-Makefile.in patch-configure.in

use_autoconf    yes
configure.args  --enable-ssl

destroot.destdir prefix=${destroot}${prefix} \
                 mandir=${destroot}${prefix}/share/man/man8

post-destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath} README INSTALL COPYING \
        ${destroot}${prefix}/share/doc/${name}

    xinstall -m 644 ${worksrcpath}/ssmtp.conf ${destroot}${prefix}/etc/${name}/ssmtp.conf.sample
}
