2019-10-02 16:42:38 +02:00
|
|
|
%global version 2.0.3
|
2017-07-13 00:00:39 +02:00
|
|
|
%global git_tag v%{version}
|
|
|
|
|
2017-08-31 13:16:03 +02:00
|
|
|
# Enable with systemctl "enable sanoid.timer"
|
|
|
|
%global _with_systemd 1
|
|
|
|
|
|
|
|
Name: sanoid
|
|
|
|
Version: %{version}
|
2018-04-28 18:38:19 +02:00
|
|
|
Release: 1%{?dist}
|
2017-08-31 13:16:03 +02:00
|
|
|
BuildArch: noarch
|
|
|
|
Summary: A policy-driven snapshot management tool for ZFS file systems
|
|
|
|
Group: Applications/System
|
|
|
|
License: GPLv3
|
|
|
|
URL: https://github.com/jimsalterjrs/sanoid
|
2018-09-05 10:07:05 +02:00
|
|
|
Source0: https://github.com/jimsalterjrs/%{name}/archive/%{git_tag}/%{name}-%{version}.tar.gz
|
2017-08-31 13:16:03 +02:00
|
|
|
|
2019-05-24 08:29:54 +02:00
|
|
|
Requires: perl, mbuffer, lzop, pv, perl-Config-IniFiles, perl-Capture-Tiny
|
2017-08-31 13:16:03 +02:00
|
|
|
%if 0%{?_with_systemd}
|
|
|
|
Requires: systemd >= 212
|
|
|
|
|
|
|
|
BuildRequires: systemd
|
|
|
|
%endif
|
2016-03-08 16:46:36 +01:00
|
|
|
|
|
|
|
%description
|
|
|
|
Sanoid is a policy-driven snapshot management
|
2017-07-13 00:00:39 +02:00
|
|
|
tool for ZFS file systems. You can use Sanoid
|
2016-03-08 16:46:36 +01:00
|
|
|
to create, automatically thin, and monitor snapshots
|
|
|
|
and pool health from a single eminently
|
2017-07-13 00:00:39 +02:00
|
|
|
human-readable TOML configuration file.
|
2016-03-08 16:46:36 +01:00
|
|
|
|
|
|
|
%prep
|
2017-07-13 00:00:39 +02:00
|
|
|
%setup -q
|
2016-03-08 16:46:36 +01:00
|
|
|
|
|
|
|
%build
|
2017-08-31 13:16:03 +02:00
|
|
|
echo "Nothing to build"
|
2016-03-08 16:46:36 +01:00
|
|
|
|
|
|
|
%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}
|
2017-07-13 00:00:39 +02:00
|
|
|
|
2017-08-31 13:16:03 +02:00
|
|
|
%if 0%{?_with_systemd}
|
|
|
|
%{__install} -d %{buildroot}%{_unitdir}
|
|
|
|
%endif
|
|
|
|
|
2017-07-13 00:00:39 +02:00
|
|
|
%if 0%{?fedora}
|
|
|
|
%{__install} -D -m 0644 sanoid.conf %{buildroot}%{_docdir}/%{name}/examples/sanoid.conf
|
|
|
|
%endif
|
|
|
|
%if 0%{?rhel}
|
2016-03-08 16:46:36 +01:00
|
|
|
%{__install} -D -m 0644 sanoid.conf %{buildroot}%{_docdir}/%{name}-%{version}/examples/sanoid.conf
|
2017-08-31 13:16:03 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%if 0%{?_with_systemd}
|
|
|
|
cat > %{buildroot}%{_unitdir}/%{name}.service <<EOF
|
|
|
|
[Unit]
|
|
|
|
Description=Snapshot ZFS Pool
|
|
|
|
Requires=zfs.target
|
|
|
|
After=zfs.target
|
|
|
|
|
|
|
|
[Service]
|
2018-06-05 11:41:48 +02:00
|
|
|
Environment=TZ=UTC
|
2017-08-31 13:16:03 +02:00
|
|
|
Type=oneshot
|
|
|
|
ExecStart=%{_sbindir}/sanoid --cron
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cat > %{buildroot}%{_unitdir}/%{name}.timer <<EOF
|
|
|
|
[Unit]
|
|
|
|
Description=Run Sanoid Every Minute
|
|
|
|
|
|
|
|
[Timer]
|
|
|
|
OnCalendar=*:0/1
|
|
|
|
Persistent=true
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=timers.target
|
|
|
|
EOF
|
|
|
|
|
|
|
|
%else
|
|
|
|
%if 0%{?fedora}
|
|
|
|
%{__install} -D -m 0644 sanoid.conf %{buildroot}%{_docdir}/%{name}/examples/sanoid.conf
|
|
|
|
%endif
|
|
|
|
%if 0%{?rhel}
|
2016-03-08 16:46:36 +01:00
|
|
|
echo "* * * * * root %{_sbindir}/sanoid --cron" > %{buildroot}%{_docdir}/%{name}-%{version}/examples/sanoid.cron
|
2017-07-13 00:00:39 +02:00
|
|
|
%endif
|
2017-08-31 13:16:03 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%post
|
|
|
|
%{?_with_systemd:%{_bindir}/systemctl daemon-reload}
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%{?_with_systemd:%{_bindir}/systemctl daemon-reload}
|
2016-03-08 16:46:36 +01:00
|
|
|
|
|
|
|
%files
|
2017-07-13 00:00:39 +02:00
|
|
|
%doc CHANGELIST VERSION README.md FREEBSD.readme
|
|
|
|
%license LICENSE
|
2016-03-08 16:46:36 +01:00
|
|
|
%{_sbindir}/sanoid
|
|
|
|
%{_sbindir}/syncoid
|
|
|
|
%{_sbindir}/findoid
|
|
|
|
%{_sbindir}/sleepymutex
|
|
|
|
%dir %{_sysconfdir}/%{name}
|
|
|
|
%config %{_sysconfdir}/%{name}/sanoid.defaults.conf
|
2017-07-13 00:00:39 +02:00
|
|
|
%if 0%{?fedora}
|
|
|
|
%{_docdir}/%{name}
|
|
|
|
%endif
|
|
|
|
%if 0%{?rhel}
|
|
|
|
%{_docdir}/%{name}-%{version}
|
|
|
|
%endif
|
2017-08-31 13:16:03 +02:00
|
|
|
%if 0%{?_with_systemd}
|
|
|
|
%{_unitdir}/%{name}.service
|
|
|
|
%{_unitdir}/%{name}.timer
|
|
|
|
%endif
|
2016-03-08 16:46:36 +01:00
|
|
|
|
|
|
|
%changelog
|
2019-10-02 16:42:38 +02:00
|
|
|
* Wed Oct 02 2019 Christoph Klaffl <christoph@phreaker.eu> - 2.0.3
|
|
|
|
- Bump to 2.0.3
|
2019-09-25 22:22:00 +02:00
|
|
|
* Wed Sep 25 2019 Christoph Klaffl <christoph@phreaker.eu> - 2.0.2
|
|
|
|
- Bump to 2.0.2
|
2018-12-04 23:42:18 +01:00
|
|
|
* Wed Dec 04 2018 Christoph Klaffl <christoph@phreaker.eu> - 2.0.0
|
|
|
|
- Bump to 2.0.0
|
2018-04-28 18:38:19 +02:00
|
|
|
* Sat Apr 28 2018 Dominic Robinson <github@dcrdev.com> - 1.4.18-1
|
|
|
|
- Bump to 1.4.18
|
2017-08-31 13:23:18 +02:00
|
|
|
* Thu Aug 31 2017 Dominic Robinson <github@dcrdev.com> - 1.4.14-2
|
2017-08-31 13:16:03 +02:00
|
|
|
- Add systemd timers
|
|
|
|
* Wed Aug 30 2017 Dominic Robinson <github@dcrdev.com> - 1.4.14-1
|
|
|
|
- Version bump
|
2017-07-13 00:00:39 +02:00
|
|
|
* Wed Jul 12 2017 Thomas M. Lapp <tmlapp@gmail.com> - 1.4.13-1
|
|
|
|
- Version bump
|
|
|
|
- Include FREEBSD.readme in docs
|
|
|
|
* Wed Jul 12 2017 Thomas M. Lapp <tmlapp@gmail.com> - 1.4.9-1
|
|
|
|
- Version bump
|
|
|
|
- Clean up variables and macros
|
|
|
|
- Compatible with both Fedora and Red Hat
|
2016-03-08 16:48:40 +01:00
|
|
|
* Sat Feb 13 2016 Thomas M. Lapp <tmlapp@gmail.com> - 1.4.4-1
|
2016-03-08 16:46:36 +01:00
|
|
|
- Initial RPM Package
|