# -*- 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                smartmontools
version             7.0
categories          sysutils
license             GPL-2+
platforms           darwin

maintainers         {gmail.com:rjvbertin @RJVB} openmaintainer

description         SMART hard drive monitoring

long_description \
    Two utility programs (smartctl and smartd) to control and monitor \
    storage systems using the Self-Monitoring, Analysis and Reporting \
    Technology System (SMART) built into most modern ATA and SCSI hard \
    disks. In many cases, these utilities will provide advanced warning \
    of disk degradation and failure.

homepage            http://smartmontools.sourceforge.net/
master_sites        sourceforge:project/smartmontools/smartmontools/${version}/

checksums           rmd160  db20533115aa05a52836dbef0006c664083fbe90 \
                    sha256  e5e1ac2786bc87fdbd6f92d0ee751b799fbb3e1a09c0a6a379f9eb64b3e8f61c \
                    size    944925

configure.args      --without-savestates \
                    --without-attributelog \
                    --enable-sample \
                    --with-libcap-ng=no

platform darwin {
    if {${configure.cxx_stdlib} eq "libstdc++"} {
        configure.args-append \
                    --with-cxx11-option=no
    }
}

destroot.keepdirs   ${destroot}${prefix}/var/run \
                    ${destroot}${prefix}/var/lib/smartmontools

default_variants    +savestates +attributelog

variant savestates description {Use default smartd state files} {
    configure.args-replace --without-savestates --with-savestates
}

variant attributelog description {Use default smartd attribute log files} {
    configure.args-replace --without-attributelog --with-attributelog
}

startupitem.create      yes
startupitem.name        smartd
startupitem.executable  ${prefix}/sbin/smartd -n