# -*- 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 105229 2013-04-14 16:22:14Z cal@macports.org $

PortSystem          1.0

name                smartmontools
version             6.1
categories          sysutils
license             GPL-2+
platforms           darwin

maintainers         takanori 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

checksums           rmd160  abb013e115f0974327ebcfb5205f5e0ce9f5f700 \
                    sha256  a9003b8bccc82682f658ce76d70edb1842411e51dc56d4cd6b56618da1d9ce07

configure.args      --mandir=${prefix}/share/man \
                    --enable-drivedb \
                    --disable-savestates \
                    --disable-attributelog \
                    --enable-sample \
                    --with-libcap-ng=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-delete --disable-savestates
    configure.args-append --enable-savestates
}

variant attributelog description {Use default smartd attribute log files} {
    configure.args-delete --disable-attributelog
    configure.args-append --enable-attributelog
}

startupitem.create      yes
startupitem.name        smartd
startupitem.executable  ${prefix}/sbin/smartd -p ${prefix}/var/run/smartd.pid
startupitem.pidfile     auto ${prefix}/var/run/smartd.pid
