Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 1 | |
| 2 | SUMMARY = "Services for periodic btrfs maintenance tasks" |
| 3 | DESCRIPTION = "A set of scripts supplementing the btrfs filesystem and aims \ |
| 4 | to automate a few maintenance tasks. This means the scrub, balance, trim \ |
| 5 | or defragmentation." |
| 6 | HOMEPAGE = "https://github.com/kdave/btrfsmaintenance" |
| 7 | LICENSE = "GPL-2.0-only" |
| 8 | LIC_FILES_CHKSUM = "file://COPYING;md5=892f569a555ba9c07a568a7c0c4fa63a" |
| 9 | |
| 10 | SECTION = "base" |
| 11 | |
| 12 | DEPENDS = "btrfs-tools" |
| 13 | |
| 14 | SRC_URI = "git://github.com/kdave/${BPN};branch=master;protocol=https \ |
| 15 | file://0001-change-sysconfig-path-to-etc-default.patch \ |
| 16 | file://0002-add-WantedBy-directive-to-btrfsmaintenance-refresh.s.patch \ |
| 17 | " |
| 18 | SRCREV = "be42cb6267055d125994abd6927cf3a26deab74c" |
| 19 | |
| 20 | UPSTREAM_CHECK_URI = "https://github.com/kdave/${BPN}/tags" |
| 21 | UPSTREAM_CHECK_REGEX = "${BPN}/releases/tag/v(?P<pver>\d+(?:\.\d+)*)" |
| 22 | |
| 23 | RDEPENDS:${PN} = "bash" |
| 24 | |
| 25 | S="${WORKDIR}/git" |
| 26 | |
| 27 | inherit allarch |
| 28 | |
| 29 | do_configure[noexec] = "1" |
| 30 | do_compile[noexec] = "1" |
| 31 | |
| 32 | do_install() { |
| 33 | install -Dm0644 ${S}/btrfsmaintenance-refresh.path \ |
| 34 | ${D}${systemd_system_unitdir}/btrfsmaintenance-refresh.path |
| 35 | install -Dm0644 ${S}/*.timer \ |
| 36 | ${D}${systemd_system_unitdir} |
| 37 | install -Dm0644 ${S}/*.service \ |
| 38 | ${D}${systemd_system_unitdir} |
| 39 | |
| 40 | install -Dm0644 ${S}/btrfsmaintenance-functions \ |
Andrew Geissler | 3eeda90 | 2023-05-19 10:14:02 -0500 | [diff] [blame] | 41 | ${D}${datadir}/${BPN}/btrfsmaintenance-functions |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 42 | install -Dm0755 ${S}/*.sh \ |
Andrew Geissler | 3eeda90 | 2023-05-19 10:14:02 -0500 | [diff] [blame] | 43 | ${D}${datadir}/${BPN} |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 44 | |
| 45 | install -Dm0644 ${S}/sysconfig.btrfsmaintenance \ |
| 46 | ${D}${sysconfdir}/default/btrfsmaintenance |
| 47 | } |
| 48 | |
| 49 | inherit systemd |
| 50 | SYSTEMD_PACKAGES = "${PN}" |
| 51 | SYSTEMD_SERVICE:${PN} = " \ |
| 52 | btrfs-scrub.timer \ |
| 53 | btrfs-scrub.service \ |
| 54 | btrfs-trim.timer \ |
| 55 | btrfs-trim.service \ |
| 56 | btrfs-balance.timer \ |
| 57 | btrfs-balance.service \ |
| 58 | btrfs-defrag.timer \ |
| 59 | btrfs-defrag.service \ |
| 60 | btrfsmaintenance-refresh.service \ |
| 61 | btrfsmaintenance-refresh.path \ |
| 62 | " |