unos-repository

APK repository for unos
git clone git://git.finwo.net/misc/unos-repository
Log | Files | Refs | README

template (2731B)


      1 # Template file for 'smartmontools'
      2 pkgname=smartmontools
      3 version=7.5
      4 revision=0
      5 short_desc="S.M.A.R.T. disk health monitoring (smartctl)"
      6 maintainer="finwo <finwo@pm.me>"
      7 license="GPL-2.0-or-later"
      8 homepage="https://www.smartmontools.org/"
      9 distfiles="https://downloads.sourceforge.net/project/smartmontools/smartmontools/${version}/smartmontools-${version}.tar.gz"
     10 checksum=690b83ca331378da9ea0d9d61008c4b22dde391387b9bbad7f29387f2595f76e
     11 depends="glibc busybox libstdc++"
     12 makedepends="libstdc++"
     13 
     14 # Notes:
     15 # - Why: a switch's boot media is usually an eMMC or a small SSD, and its wear
     16 #   state is the thing that predicts the next outage. smartctl is how you read
     17 #   it. The S5248F-ON captured in PROGRESS.md 2.1 boots from /dev/sda.
     18 # - smartd (the polling daemon) is deliberately NOT shipped: it wants cron-like
     19 #   scheduling and a mail transport, neither of which UNOS has. Health polling
     20 #   belongs in the control plane later, not in a second supervisor.
     21 # - The drive database is built in (--with-nvme-devicescan aside, no runtime
     22 #   update path). update-smart-drivedb needs curl/gpg and is not shipped.
     23 
     24 do_configure() {
     25 	cd "${WRKSRC}"
     26 	./configure \
     27 		--prefix=/usr \
     28 		--sbindir=/usr/sbin \
     29 		--sysconfdir=/etc \
     30 		--disable-dependency-tracking \
     31 		--without-libcap-ng \
     32 		--without-libsystemd \
     33 		--without-selinux \
     34 		--without-gnupg \
     35 		--without-update-smart-drivedb \
     36 		--with-nvme-devicescan
     37 }
     38 
     39 do_build() {
     40 	cd "${WRKSRC}"
     41 	make -j"$(nproc)"
     42 }
     43 
     44 do_install() {
     45 	cd "${WRKSRC}"
     46 	make install DESTDIR="${DESTDIR}"
     47 
     48 	# smartd is not shipped (see notes): drop the daemon, its config, its
     49 	# init/service glue and its manpages rather than leaving dead weight.
     50 	rm -f  "${DESTDIR}"/usr/sbin/smartd
     51 	rm -f  "${DESTDIR}"/etc/smartd.conf
     52 	rm -f  "${DESTDIR}"/usr/share/man/man8/smartd.8 \
     53 	       "${DESTDIR}"/usr/share/man/man5/smartd.conf.5
     54 	# smartd_warning.sh is smartd's notification helper; without smartd it is
     55 	# an orphan that only looks like a supported hook.
     56 	rm -f  "${DESTDIR}"/etc/smartd_warning.sh
     57 	rm -rf "${DESTDIR}"/etc/smartd_warning.d \
     58 	       "${DESTDIR}"/usr/share/smartmontools \
     59 	       "${DESTDIR}"/usr/libexec \
     60 	       "${DESTDIR}"/lib/systemd "${DESTDIR}"/usr/lib/systemd \
     61 	       "${DESTDIR}"/etc/init.d "${DESTDIR}"/etc/rc.d
     62 	rm -rf "${DESTDIR}/usr/share/doc" "${DESTDIR}/usr/share/locale"
     63 
     64 	[ -x "${DESTDIR}/usr/sbin/smartctl" ] || die "smartmontools: no smartctl"
     65 	[ ! -e "${DESTDIR}/usr/sbin/smartd" ] || die "smartmontools: smartd should not ship"
     66 	[ ! -e "${DESTDIR}/etc/smartd_warning.sh" ] || die "smartmontools: smartd helper left behind"
     67 	readelf -d "${DESTDIR}/usr/sbin/smartctl" | grep -q 'libstdc++\.so\.6' \
     68 		|| die "smartmontools: smartctl does not link libstdc++.so.6"
     69 }