# -*- 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

PortSystem 1.0

name                    bonniexx
version                 1.97.3
categories              benchmarks
maintainers             nomaintainer
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                https://www.coker.com.au/bonnie++/
master_sites            ${homepage}

checksums               rmd160  227f0e6b8e643bdd120e013c4f9f35426b3a7475 \
                        sha256  e27b386ae0dc054fa7b530aab6bdead7aea6337a864d1f982bc9ebacb320746e

distname                bonnie++-${version}
extract.suffix          .tgz

patchfiles              patch-Makefile.in \
                        patch-bonnie++.cpp \
                        patch-bonnie.h.in.diff \
                        patch-zcav.8 \
                        patch-zcav.cpp \
                        patch-zcav_io.cpp


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

destroot.destdir        prefix=${destroot}${prefix}

post-destroot {
    set docdir ${destroot}${prefix}/share/doc/bonnie++
    file mkdir ${docdir}
    xinstall -m 644 -W ${worksrcpath} README-2.00 README.txt changelog.txt copyright.txt credits.txt readme.html ${docdir}
}

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
