# $Id: Portfile 91646 2012-04-07 02:23:23Z ryandesign@macports.org $

PortSystem 1.0

name                    bonniexx
version                 1.96
categories              benchmarks
maintainers             mac.com:lomion
description             Disk and FS performance tester
long_description        Bonnie++ is a benchmark suite that is aimed at \
                        performing a number of simple tests of hard drive \
                        and file system performance. Then you can decide which\
                        test is important and decide how to compare different\
                        systems after running it. I have no plans to ever \
                        have it produce a single number, because I don't think\
                        that a single number can be useful when comparing \
                        such things.
platforms               darwin
license                 GPL-2
homepage                http://www.coker.com.au/bonnie++/
master_sites            http://www.coker.com.au/bonnie++/experimental/
checksums               rmd160 f2bbcfb6b17b2baa0d268046aa8a994f6b41bfee
distname                bonnie++-${version}
extract.suffix          .tgz
patchfiles              patch-Makefile.in \
                        patch-bonnie++.cpp \
                        patch-bonnie.h.in.diff \
                        patch-port.h.in \
                        patch-zcav.8 \
                        patch-zcav.cpp \
                        patch-zcav_io.cpp

pre-patch {
    reinplace "s|/usr/share/|${prefix}/share/|g" ${worksrcpath}/bonnie++.8
}

destroot {
    xinstall -m 755 -d "${destroot}${prefix}/bin" \
                       "${destroot}${prefix}/sbin" \
                       "${destroot}${prefix}/share/man/man1" \
                       "${destroot}${prefix}/share/man/man8" \
                       "${destroot}${prefix}/share/doc/bonnie++"
    xinstall -m 755 -W ${worksrcpath} bon_csv2html generate_randfile ${destroot}${prefix}/bin
    xinstall -m 755 -W ${worksrcpath} bonnie++ zcav getc_putc getc_putc_helper ${destroot}${prefix}/sbin
    xinstall -m 644 -W ${worksrcpath} bon_csv2html.1 bon_csv2txt.1 generate_randfile.1 ${destroot}${prefix}/share/man/man1
    xinstall -m 644 -W ${worksrcpath} bonnie++.8 zcav.8 getc_putc.8 ${destroot}${prefix}/share/man/man8
    xinstall -m 644 -W ${worksrcpath} README-2.00 README.txt changelog.txt copyright.txt credits.txt readme.html ${destroot}${prefix}/share/doc/bonnie++
}

notes "
Darwin's sysconf() doesn't support _SC_PHYS_PAGES. Due to this limitation,\
Bonnie++ cannot detect the amount of physical memory automatically. To tell\
Bonnie++ a suitable RAM size, you can use -r option. For example, if your Mac\
has 4GB RAM, use:

    bonnie++ -r 4096 -d /tmp
"

livecheck.type          regex
livecheck.url           ${master_sites}
livecheck.regex         bonnie\\+\\+-(\[0-9.a-z\]+)\\.tgz
