From bb08b6482d8b54e0029cc6a8ac05d0cb48e5f1bc Mon Sep 17 00:00:00 2001 From: John McGee Date: Mon, 18 Mar 2024 21:01:31 -0400 Subject: [PATCH 1/5] feat: add sanoid spec file from dev repo, modified to not pull in build dependencies. --- ucore/sanoid.spec | 138 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 ucore/sanoid.spec diff --git a/ucore/sanoid.spec b/ucore/sanoid.spec new file mode 100644 index 0000000..4200206 --- /dev/null +++ b/ucore/sanoid.spec @@ -0,0 +1,138 @@ +%global version 2.2.0 +%global git_tag v%{version} + +# Enable with systemctl "enable sanoid.timer" +%global _with_systemd 1 + +Name: sanoid +Version: %{version} +Release: 1%{?dist} +BuildArch: noarch +Summary: A policy-driven snapshot management tool for ZFS file systems +Group: Applications/System +License: GPLv3 +URL: https://github.com/jimsalterjrs/sanoid +Source0: https://github.com/jimsalterjrs/%{name}/archive/%{git_tag}/%{name}-%{version}.tar.gz + +Requires: perl-interpreter, mbuffer, lzop, pv, perl-Config-IniFiles, perl-Capture-Tiny, perl-Sys-Hostname +%if 0%{?_with_systemd} +Requires: systemd >= 212 + +BuildRequires: systemd +%endif + +%description +Sanoid is a policy-driven snapshot management +tool for ZFS file systems. You can use Sanoid +to create, automatically thin, and monitor snapshots +and pool health from a single eminently +human-readable TOML configuration file. + +%prep +%setup -q + +%build +echo "Nothing to build" + +%install +%{__install} -D -m 0644 sanoid.defaults.conf %{buildroot}/etc/sanoid/sanoid.defaults.conf +%{__install} -d %{buildroot}%{_sbindir} +%{__install} -m 0755 sanoid syncoid findoid sleepymutex %{buildroot}%{_sbindir} + +%if 0%{?_with_systemd} +%{__install} -d %{buildroot}%{_unitdir} +%endif + +%if 0%{?fedora} +%{__install} -D -m 0644 sanoid.conf %{buildroot}%{_docdir}/%{name}/examples/sanoid.conf +%endif +%if 0%{?rhel} +%{__install} -D -m 0644 sanoid.conf %{buildroot}%{_docdir}/%{name}-%{version}/examples/sanoid.conf +%endif + +%if 0%{?_with_systemd} +cat > %{buildroot}%{_unitdir}/%{name}.service < %{buildroot}%{_unitdir}/%{name}.timer < %{buildroot}%{_docdir}/%{name}-%{version}/examples/sanoid.cron +%endif +%endif + +%post +%{?_with_systemd:%{_bindir}/systemctl daemon-reload} + +%postun +%{?_with_systemd:%{_bindir}/systemctl daemon-reload} + +%files +%doc CHANGELIST VERSION README.md FREEBSD.readme +%license LICENSE +%{_sbindir}/sanoid +%{_sbindir}/syncoid +%{_sbindir}/findoid +%{_sbindir}/sleepymutex +%dir %{_sysconfdir}/%{name} +%config %{_sysconfdir}/%{name}/sanoid.defaults.conf +%if 0%{?fedora} +%{_docdir}/%{name} +%endif +%if 0%{?rhel} +%{_docdir}/%{name}-%{version} +%endif +%if 0%{?_with_systemd} +%{_unitdir}/%{name}.service +%{_unitdir}/%{name}.timer +%endif + +%changelog +* Tue Jul 18 2023 Christoph Klaffl - 2.2.0 +- Bump to 2.2.0 +* Tue Nov 24 2020 Christoph Klaffl - 2.1.0 +- Bump to 2.1.0 +* Wed Oct 02 2019 Christoph Klaffl - 2.0.3 +- Bump to 2.0.3 +* Wed Sep 25 2019 Christoph Klaffl - 2.0.2 +- Bump to 2.0.2 +* Tue Dec 04 2018 Christoph Klaffl - 2.0.0 +- Bump to 2.0.0 +* Sat Apr 28 2018 Dominic Robinson - 1.4.18-1 +- Bump to 1.4.18 +* Thu Aug 31 2017 Dominic Robinson - 1.4.14-2 +- Add systemd timers +* Wed Aug 30 2017 Dominic Robinson - 1.4.14-1 +- Version bump +* Wed Jul 12 2017 Thomas M. Lapp - 1.4.13-1 +- Version bump +- Include FREEBSD.readme in docs +* Wed Jul 12 2017 Thomas M. Lapp - 1.4.9-1 +- Version bump +- Clean up variables and macros +- Compatible with both Fedora and Red Hat +* Sat Feb 13 2016 Thomas M. Lapp - 1.4.4-1 +- Initial RPM Package From 22dbfd0dc83703a3f319a3e1948315fd3ba74b83 Mon Sep 17 00:00:00 2001 From: John McGee Date: Mon, 18 Mar 2024 21:19:56 -0400 Subject: [PATCH 2/5] modify changelog --- ucore/sanoid.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ucore/sanoid.spec b/ucore/sanoid.spec index 4200206..0bb810c 100644 --- a/ucore/sanoid.spec +++ b/ucore/sanoid.spec @@ -111,6 +111,9 @@ echo "* * * * * root %{_sbindir}/sanoid --cron" > %{buildroot}%{_docdir}/%{name} %endif %changelog +* Mon Mar 18 2024 John McGee - 3.0.0 +- Remove perl requirement to remove build tools +- Add perl-interpreter and perl-Sys-Hostname requirements * Tue Jul 18 2023 Christoph Klaffl - 2.2.0 - Bump to 2.2.0 * Tue Nov 24 2020 Christoph Klaffl - 2.1.0 From 218dc9af7a453d4f9d388b35eeddfaed53edb455 Mon Sep 17 00:00:00 2001 From: John McGee Date: Tue, 19 Mar 2024 17:41:20 -0400 Subject: [PATCH 3/5] add ucore1 to version --- ucore/sanoid.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ucore/sanoid.spec b/ucore/sanoid.spec index 0bb810c..e0ab8a9 100644 --- a/ucore/sanoid.spec +++ b/ucore/sanoid.spec @@ -5,7 +5,7 @@ %global _with_systemd 1 Name: sanoid -Version: %{version} +Version: %{version}-ucore1 Release: 1%{?dist} BuildArch: noarch Summary: A policy-driven snapshot management tool for ZFS file systems @@ -111,7 +111,7 @@ echo "* * * * * root %{_sbindir}/sanoid --cron" > %{buildroot}%{_docdir}/%{name} %endif %changelog -* Mon Mar 18 2024 John McGee - 3.0.0 +* Mon Mar 19 2024 John McGee - 2.2.0-ucore1 - Remove perl requirement to remove build tools - Add perl-interpreter and perl-Sys-Hostname requirements * Tue Jul 18 2023 Christoph Klaffl - 2.2.0 From 50b7b50f93b8480663ee04a5b090a10e38ccc559 Mon Sep 17 00:00:00 2001 From: John McGee Date: Wed, 20 Mar 2024 14:34:59 -0400 Subject: [PATCH 4/5] add prune unit --- ucore/sanoid.spec | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/ucore/sanoid.spec b/ucore/sanoid.spec index e0ab8a9..6afa8e6 100644 --- a/ucore/sanoid.spec +++ b/ucore/sanoid.spec @@ -56,11 +56,30 @@ cat > %{buildroot}%{_unitdir}/%{name}.service < %{buildroot}%{_unitdir}/%{name}-prune.service < %{buildroot}%{_unitdir}/%{name}.timer < %{buildroot}%{_docdir}/%{name} * Mon Mar 19 2024 John McGee - 2.2.0-ucore1 - Remove perl requirement to remove build tools - Add perl-interpreter and perl-Sys-Hostname requirements +- Correct systemd units to incluide sanoid-prune * Tue Jul 18 2023 Christoph Klaffl - 2.2.0 - Bump to 2.2.0 * Tue Nov 24 2020 Christoph Klaffl - 2.1.0 From b9c54efbf2c85366a23ab4da6a2b757ad1bc1cb7 Mon Sep 17 00:00:00 2001 From: John McGee Date: Wed, 20 Mar 2024 14:47:36 -0400 Subject: [PATCH 5/5] fix version --- ucore/sanoid.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ucore/sanoid.spec b/ucore/sanoid.spec index 6afa8e6..cd609c8 100644 --- a/ucore/sanoid.spec +++ b/ucore/sanoid.spec @@ -5,7 +5,7 @@ %global _with_systemd 1 Name: sanoid -Version: %{version}-ucore1 +Version: %{version}.ucore1 Release: 1%{?dist} BuildArch: noarch Summary: A policy-driven snapshot management tool for ZFS file systems @@ -130,7 +130,7 @@ echo "* * * * * root %{_sbindir}/sanoid --cron" > %{buildroot}%{_docdir}/%{name} %endif %changelog -* Mon Mar 19 2024 John McGee - 2.2.0-ucore1 +* Mon Mar 19 2024 John McGee - 2.2.0.ucore1 - Remove perl requirement to remove build tools - Add perl-interpreter and perl-Sys-Hostname requirements - Correct systemd units to incluide sanoid-prune