# $Id: Portfile 104423 2013-03-25 14:36:34Z jmr@macports.org $

PortSystem       1.0

name             siege
version          2.72
categories       www benchmarks
license          GPL-2+
maintainers      nomaintainer
description      http regression testing and benchmarking utility
long_description \
    Siege is an http regression testing and benchmarking utility. \
    It was designed to let web developers measure the performance \
    of their code under duress, to see how it will stand up to \
    load on the internet. It lets the user hit a web server with \
    a configurable number of concurrent simulated users.
homepage         http://www.joedog.org/siege-home/
platforms        darwin
master_sites     http://www.joedog.org/pub/siege/ \
                 ftp://sid.joedog.org/pub/siege/ \
                 ftp://ftp.joedog.org/pub/siege/

checksums        rmd160  45af39fde6f948262e19cb2252dfeab10c3b484a \
                 sha256  3d43026859550987f0284431997516ede8061a75e7b1e844816f6a61e033c12e

depends_lib      port:openssl
configure.args   --mandir=${prefix}/share/man \
                 --with-ssl=${prefix}

# broken ftp server
fetch.use_epsv   yes

pre-configure {
    # prevent installation of .siegerc in $HOME, use `siege.config` for this:
    reinplace {s|$(INSTALL_DATA) $(srcdir)/siegerc $(SIEGERC);|echo "";|g} \
        ${worksrcpath}/doc/Makefile.in
    # ensure urls.txt is installed in ${destroot}:
    reinplace "s|@sysconfdir@|${destroot}@sysconfdir@|g" \
        ${worksrcpath}/doc/Makefile.in
}

set docdir ${prefix}/share/doc/${name}

post-destroot {
    # copy an example siegerc to ${prefix}share/doc so an updater can see
    # possible changes to siegerc:
    xinstall -d ${destroot}${docdir}
    xinstall -m 644 ${worksrcpath}/doc/siegerc ${destroot}${docdir}
}

notes "
To use siege you have to run 'siege.config'. This generates a default\
configuration file.
If you are updating have a look at a possible new '.siegrc' file in\
${docdir}/siegerc.
"
