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
12DEPENDS = "btrfs-tools"
13
14SRC_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"
18SRCREV = "be42cb6267055d125994abd6927cf3a26deab74c"
19
20UPSTREAM_CHECK_URI = "https://github.com/kdave/${BPN}/tags"
21UPSTREAM_CHECK_REGEX = "${BPN}/releases/tag/v(?P<pver>\d+(?:\.\d+)*)"
22
23RDEPENDS:${PN} = "bash"
24
25S="${WORKDIR}/git"
26
27inherit allarch
28
29do_configure[noexec] = "1"
30do_compile[noexec] = "1"
31
32do_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 \
41        ${D}${datadir}/${PN}/btrfsmaintenance-functions
42    install -Dm0755 ${S}/*.sh \
43        ${D}${datadir}/${PN}
44
45    install -Dm0644 ${S}/sysconfig.btrfsmaintenance \
46        ${D}${sysconfdir}/default/btrfsmaintenance
47}
48
49inherit systemd
50SYSTEMD_PACKAGES = "${PN}"
51SYSTEMD_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"
63