# -*- 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 92310 2012-04-24 22:43:18Z pixilla@macports.org $

PortSystem          1.0

name                memtester
version             4.2.2
categories          sysutils
maintainers         pixilla
platforms           darwin
description         A userspace utility for testing the memory subsystem for \
                    faults.
long_description    ${description}

homepage            http://pyropus.ca/software/memtester/
master_sites        ${homepage}/old-versions

checksums           rmd160  9aae7bec1408224348baa02556a5c9c484c7a7a7 \
                    sha256  a494569d58d642c796332a1b7f3b4b86845b52da66c15c96fbeecd74e48dae8e

livecheck.url       ${homepage}/old-versions/
livecheck.regex     "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"

use_configure       no

variant universal {}

pre-patch {
	if {[variant_isset universal]} {
		set archflags ${configure.universal_cflags}
	} else {
		set archflags ${configure.cc_archflags}
	}
	reinplace "s|/usr/local|${destroot}${prefix}|" ${worksrcpath}/Makefile
	reinplace "s|man/man|share/man/man|" ${worksrcpath}/Makefile
	reinplace "s|^cc|${configure.cc} ${archflags}|g" ${worksrcpath}/conf-cc ${worksrcpath}/conf-ld
}
