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