1 # Maintainer: Giovanni Scafora <giovanni@archlinux.org>
2 # Contributor: Jeff Mickey <jeff@archlinux.org>
3 # Contributor: Jani Talikka <jani.talikka@gmail.com>
4 # Contributor: Ralf Barth <archlinux.org@haggy.org>
9 pkgdesc='Control and monitor S.M.A.R.T. enabled ATA and SCSI Hard Drives'
10 url='http://smartmontools.sourceforge.net'
13 depends=('gcc-libs' 'libcap-ng' 'bash' 'systemd-libs')
14 makedepends=('systemd')
15 optdepends=('s-nail: to get mail alerts to work')
16 backup=('etc/smartd.conf'
18 validpgpkeys=('0C9577FD2C4CFCB4B9A599640A30812EFF3AEFF5') # Smartmontools Signing Key (through 2025) <smartmontools-support@listi.jpberlin.de>
19 source=("https://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver}.tar.gz"{,.asc}
21 sha256sums=('a544f8808d0c58cfb0e7424ca1841cb858a974922b035d505d4e4c248be3a22b'
23 'c2c0f2f6b4a3f3d76da1c7706139297aef6e3f2a705eb7fdd800544812427c74')
26 cd "${srcdir}/${pkgname}-${pkgver}"
28 # make sure to use `uname -n` instead of `hostname`
29 sed -i "/^os_hostname/c os_hostname=\"'uname -n'\"" configure.ac
31 # smartd.service.in: Remove obsolete 'StandardOutput=syslog'
32 # https://github.com/smartmontools/smartmontools/commit/f73303bc2d40adfc71e8bfaae043275e88cf9275
33 sed -i '/^StandardOutput=/d' smartd.service.in
39 cd "${srcdir}/${pkgname}-${pkgver}"
46 --with-libcap-ng=yes \
47 --with-libsystemd=yes \
48 --with-systemdsystemunitdir=/usr/lib/systemd/system \
49 --with-systemdenvfile=/etc/conf.d/smartd \
50 --with-smartdscriptdir=/usr/share/smartmontools \
51 --with-smartdplugindir=/usr/share/smartmontools/smartd_warning.d
57 cd "${srcdir}/${pkgname}-${pkgver}"
59 sed -i -e "s:sysconfig/smartmontools:conf.d/smartd:g" smartd.service
60 sed -i -e "s:smartd_opts:SMARTD_ARGS:g" smartd.service
62 make DESTDIR="${pkgdir}" install
64 rm -rf "${pkgdir}"/etc/rc.d
65 install -D -m0644 "${srcdir}"/smartd.conf "${pkgdir}/etc/conf.d/smartd"