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