# # spec file for package btrfsmaintenance # # Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. Name: btrfsmaintenance Version: 0.5 Release: 1%{?dist} Summary: Scripts for btrfs maintenance tasks BuildArch: noarch License: GPLv2+ URL: https://github.com/kdave/btrfsmaintenance Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz BuildRequires: systemd-rpm-macros Requires: btrfs-progs Enhances: btrfs-progs %description Scripts for btrfs maintenance tasks like periodic scrub, balance, trim or defrag on selected mountpoints or directories. This is a set of scripts supplementing the btrfs filesystem and aims to automate a few maintenance tasks. This means the scrub, balance, trim or defragmentation. Each of the tasks can be turned on/off and configured independently. The default config values were selected to fit the default installation profile with btrfs on the root filesystem. Overall tuning of the default values should give a good balance between effects of the tasks and low impact of other work on the system. If this does not fit your needs, please adjust the settings. %prep %autosetup -p1 %install # Scripts install -Dpm755 btrfs-defrag.sh -t %{buildroot}%{_datadir}/%{name} install -Dpm755 btrfs-balance.sh -t %{buildroot}%{_datadir}/%{name} install -Dpm755 btrfs-scrub.sh -t %{buildroot}%{_datadir}/%{name} install -Dpm755 btrfs-trim.sh -t %{buildroot}%{_datadir}/%{name} install -Dpm755 %{name}-refresh-cron.sh -t %{buildroot}%{_datadir}/%{name} install -Dpm644 %{name}-functions -t %{buildroot}%{_datadir}/%{name} # Systemd services and timers install -Dpm644 %{name}-refresh.service -t %{buildroot}%{_unitdir} install -Dpm644 %{name}-refresh.path -t %{buildroot}%{_unitdir} install -Dpm644 btrfs-balance.service -t %{buildroot}%{_unitdir} install -Dpm644 btrfs-defrag.service -t %{buildroot}%{_unitdir} install -Dpm644 btrfs-scrub.service -t %{buildroot}%{_unitdir} install -Dpm644 btrfs-trim.service -t %{buildroot}%{_unitdir} install -Dpm644 btrfs-balance.timer -t %{buildroot}%{_unitdir} install -Dpm644 btrfs-defrag.timer -t %{buildroot}%{_unitdir} install -Dpm644 btrfs-scrub.timer -t %{buildroot}%{_unitdir} install -Dpm644 btrfs-trim.timer -t %{buildroot}%{_unitdir} install -pm755 -d %{buildroot}%{_sbindir} ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-refresh # Config install -Dpm644 sysconfig.%{name} -t %{buildroot}%{_sysconfdir}/sysconfig/%{name} %post %systemd_post %{name}-refresh.service %{name}-refresh.path btrfs-balance.service btrfs-balance.timer btrfs-defrag.service btrfs-defrag.timer btrfs-scrub.service btrfs-scrub.timer btrfs-trim.service btrfs-trim.timer %preun %systemd_preun %{name}-refresh.service %{name}-refresh.path btrfs-balance.service btrfs-balance.timer btrfs-defrag.service btrfs-defrag.timer btrfs-scrub.service btrfs-scrub.timer btrfs-trim.service btrfs-trim.timer %postun %systemd_postun_with_restart %{name}-refresh.service %{name}-refresh.path btrfs-balance.service btrfs-balance.timer btrfs-defrag.service btrfs-defrag.timer btrfs-scrub.service btrfs-scrub.timer btrfs-trim.service btrfs-trim.timer %files %license COPYING %doc README.md %{_datadir}/%{name}/ %{_sbindir}/rc%{name}-refresh %{_unitdir}/%{name}-refresh.path %{_unitdir}/%{name}-refresh.service %{_unitdir}/btrfs-balance.service %{_unitdir}/btrfs-balance.timer %{_unitdir}/btrfs-defrag.service %{_unitdir}/btrfs-defrag.timer %{_unitdir}/btrfs-scrub.service %{_unitdir}/btrfs-scrub.timer %{_unitdir}/btrfs-trim.service %{_unitdir}/btrfs-trim.timer %config(noreplace) %{_sysconfdir}/sysconfig/%{name}/sysconfig.%{name} %changelog * Thu Oct 29 12:46:07 EET 2020 Artem Polishchuk - 0.5-1 - Initial package