1d583833aSAndrew Geissler
2d583833aSAndrew GeisslerSUMMARY = "Services for periodic btrfs maintenance tasks"
3d583833aSAndrew GeisslerDESCRIPTION = "A set of scripts supplementing the btrfs filesystem and aims \
4d583833aSAndrew Geissler    to automate a few maintenance tasks. This means the scrub, balance, trim \
5d583833aSAndrew Geissler    or defragmentation."
6d583833aSAndrew GeisslerHOMEPAGE = "https://github.com/kdave/btrfsmaintenance"
7d583833aSAndrew GeisslerLICENSE = "GPL-2.0-only"
8d583833aSAndrew GeisslerLIC_FILES_CHKSUM = "file://COPYING;md5=892f569a555ba9c07a568a7c0c4fa63a"
9d583833aSAndrew Geissler
10d583833aSAndrew GeisslerSECTION = "base"
11d583833aSAndrew Geissler
12d583833aSAndrew GeisslerSRC_URI = "git://github.com/kdave/${BPN};branch=master;protocol=https \
13d583833aSAndrew Geissler    file://0001-change-sysconfig-path-to-etc-default.patch \
14d583833aSAndrew Geissler    file://0002-add-WantedBy-directive-to-btrfsmaintenance-refresh.s.patch \
15d583833aSAndrew Geissler"
16d583833aSAndrew GeisslerSRCREV = "be42cb6267055d125994abd6927cf3a26deab74c"
17d583833aSAndrew Geissler
18d583833aSAndrew GeisslerUPSTREAM_CHECK_URI = "https://github.com/kdave/${BPN}/tags"
19d583833aSAndrew GeisslerUPSTREAM_CHECK_REGEX = "${BPN}/releases/tag/v(?P<pver>\d+(?:\.\d+)*)"
20d583833aSAndrew Geissler
21*220dafdbSAndrew GeisslerRDEPENDS:${PN} = "bash btrfs-tools"
22d583833aSAndrew Geissler
23d583833aSAndrew GeisslerS = "${WORKDIR}/git"
24d583833aSAndrew Geissler
25d583833aSAndrew Geisslerdo_configure[noexec] = "1"
26d583833aSAndrew Geisslerdo_compile[noexec] = "1"
27d583833aSAndrew Geissler
28d583833aSAndrew Geisslerdo_install() {
29d583833aSAndrew Geissler    install -Dm0644 ${S}/btrfsmaintenance-refresh.path \
30d583833aSAndrew Geissler        ${D}${systemd_system_unitdir}/btrfsmaintenance-refresh.path
31d583833aSAndrew Geissler    install -Dm0644 ${S}/*.timer \
32d583833aSAndrew Geissler        ${D}${systemd_system_unitdir}
33d583833aSAndrew Geissler    install -Dm0644 ${S}/*.service \
34d583833aSAndrew Geissler        ${D}${systemd_system_unitdir}
35d583833aSAndrew Geissler
36d583833aSAndrew Geissler    install -Dm0644 ${S}/btrfsmaintenance-functions \
373eeda90dSAndrew Geissler        ${D}${datadir}/${BPN}/btrfsmaintenance-functions
38d583833aSAndrew Geissler    install -Dm0755 ${S}/*.sh \
393eeda90dSAndrew Geissler        ${D}${datadir}/${BPN}
40d583833aSAndrew Geissler
41d583833aSAndrew Geissler    install -Dm0644 ${S}/sysconfig.btrfsmaintenance \
42d583833aSAndrew Geissler        ${D}${sysconfdir}/default/btrfsmaintenance
43d583833aSAndrew Geissler}
44d583833aSAndrew Geissler
45d583833aSAndrew Geisslerinherit systemd
46d583833aSAndrew GeisslerSYSTEMD_PACKAGES = "${PN}"
47d583833aSAndrew GeisslerSYSTEMD_SERVICE:${PN} = " \
48d583833aSAndrew Geissler    btrfs-scrub.timer \
49d583833aSAndrew Geissler    btrfs-scrub.service \
50d583833aSAndrew Geissler    btrfs-trim.timer \
51d583833aSAndrew Geissler    btrfs-trim.service \
52d583833aSAndrew Geissler    btrfs-balance.timer \
53d583833aSAndrew Geissler    btrfs-balance.service \
54d583833aSAndrew Geissler    btrfs-defrag.timer \
55d583833aSAndrew Geissler    btrfs-defrag.service \
56d583833aSAndrew Geissler    btrfsmaintenance-refresh.service \
57d583833aSAndrew Geissler    btrfsmaintenance-refresh.path \
58d583833aSAndrew Geissler"
59