1*4882a593SmuzhiyunSUMMARY = "Control and monitor storage systems using S.M.A.R.T"
2*4882a593SmuzhiyunDESCRIPTION = "\
3*4882a593SmuzhiyunThe smartmontools package contains two utility programs (smartctl \
4*4882a593Smuzhiyunand smartd) to control and monitor storage systems using the Self-\
5*4882a593SmuzhiyunMonitoring, Analysis and Reporting Technology System (SMART) built \
6*4882a593Smuzhiyuninto most modern ATA and SCSI hard disks. In many cases, these \
7*4882a593Smuzhiyunutilities will provide advanced warning of disk degradation and failure."
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunHOMEPAGE = "http://smartmontools.sourceforge.net/"
10*4882a593SmuzhiyunSECTION = "console/utils"
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunLICENSE = "GPL-2.0-only"
13*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunSRC_URI = "${SOURCEFORGE_MIRROR}/smartmontools/smartmontools-${PV}.tar.gz \
16*4882a593Smuzhiyun           file://initd.smartd \
17*4882a593Smuzhiyun           file://smartmontools.default \
18*4882a593Smuzhiyun           file://smartd.service \
19*4882a593Smuzhiyun           file://0001-configure.ac-Define-SOURCE_DATE_EPOCH-in-CPPFLAGS.patch \
20*4882a593Smuzhiyun           "
21*4882a593Smuzhiyun
22*4882a593SmuzhiyunPACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'libcap-ng selinux', d)}"
23*4882a593SmuzhiyunPACKAGECONFIG[libcap-ng] = "--with-libcap-ng=yes,--with-libcap-ng=no,libcap-ng"
24*4882a593SmuzhiyunPACKAGECONFIG[selinux] = "--with-selinux=yes,--with-selinux=no,libselinux"
25*4882a593Smuzhiyun
26*4882a593SmuzhiyunSRC_URI[sha256sum] = "a544f8808d0c58cfb0e7424ca1841cb858a974922b035d505d4e4c248be3a22b"
27*4882a593Smuzhiyun
28*4882a593Smuzhiyuninherit autotools update-rc.d systemd
29*4882a593Smuzhiyun
30*4882a593SmuzhiyunSYSTEMD_SERVICE:${PN} = "smartd.service"
31*4882a593SmuzhiyunSYSTEMD_AUTO_ENABLE = "disable"
32*4882a593Smuzhiyun
33*4882a593Smuzhiyundo_install:append () {
34*4882a593Smuzhiyun    #install the init.d/smartd
35*4882a593Smuzhiyun    install -d ${D}${sysconfdir}/init.d
36*4882a593Smuzhiyun    install -p -m 0755 ${WORKDIR}/initd.smartd ${D}${sysconfdir}/init.d/smartd
37*4882a593Smuzhiyun    install -d ${D}${sysconfdir}/default
38*4882a593Smuzhiyun    install -p -m 0644 ${WORKDIR}/smartmontools.default ${D}${sysconfdir}/default/smartmontools
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun    #install systemd service file
41*4882a593Smuzhiyun    install -d ${D}${systemd_unitdir}/system
42*4882a593Smuzhiyun    install -m 0644 ${WORKDIR}/smartd.service ${D}${systemd_unitdir}/system
43*4882a593Smuzhiyun    sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
44*4882a593Smuzhiyun        -e 's,@SYSCONFDIR@,${sysconfdir},g' \
45*4882a593Smuzhiyun        -e 's,@SBINDIR@,${sbindir},g' \
46*4882a593Smuzhiyun        ${D}${systemd_unitdir}/system/smartd.service
47*4882a593Smuzhiyun}
48*4882a593Smuzhiyun
49*4882a593SmuzhiyunINITSCRIPT_NAME = "smartd"
50*4882a593SmuzhiyunINITSCRIPT_PARAMS = "start 60 2 3 4 5 . stop 60 0 1 6 ."
51*4882a593Smuzhiyun
52*4882a593SmuzhiyunRRECOMMENDS:${PN} += "s-nail"
53