%global commit 92db087bb019957166ee70c88c6c967e5fd28a70
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global date 20190930

Name:     zfs-auto-snapshot
Version:  1.2.4
Release:  3.%{date}git%{shortcommit}%{?dist}
Summary:  ZFS Automatic Snapshot Service for Linux

Group:    Applications/System
License:  GPLv2
URL:      https://github.com/zfsonlinux/%{name}
Source0:  %{url}/archive/%{commit}/%{name}-%{commit}.tar.gz

BuildArch: noarch

BuildRequires: sed
BuildRequires: make

Requires: crontabs

%description
An alternative implementation of the zfs-auto-snapshot service for Linux
that is compatible with zfs-linux and zfs-fuse.

Automatically create, rotate, and destroy periodic ZFS snapshots. This is
the utility that creates the @zfs-auto-snap_frequent, @zfs-auto-snap_hourly,
@zfs-auto-snap_daily, @zfs-auto-snap_weekly, and @zfs-auto-snap_monthly
snapshots if it is installed.

This program is a possibly correct bourne shell script.  It depends only on
the zfs utilities and cron, and can run in the dash shell.

%prep
%autosetup -n %{name}-%{commit}
sed -i s@/usr/local@/usr@ Makefile

%build
# nothing to build

%install
%make_install

%files
%doc CHANGELOG README
%license COPYING
%config(noreplace) %{_sysconfdir}/cron.d/zfs-auto-snapshot
%{_sysconfdir}/cron.hourly/zfs-auto-snapshot
%{_sysconfdir}/cron.daily/zfs-auto-snapshot
%{_sysconfdir}/cron.weekly/zfs-auto-snapshot
%{_sysconfdir}/cron.monthly/zfs-auto-snapshot
%{_mandir}/man8/zfs-auto-snapshot.8.gz
%{_sbindir}/zfs-auto-snapshot

%changelog
* Sun Jul 24 2022 Andrew Bauer <zonexpertconsulting@outlook.com> - 1.2.4-3.20190930git92db087
- buildrequire make

* Fri Feb 12 2021 Andrew Bauer <zonexpertconsulting@outlook.com> - 1.2.4-2.20190930git92db087
- configure specfile to use latest git
- set buildarch to noarch, use autosetup, set BuildRequires and Requires
- set doc and license files
- fix spelling errors in description

* Fri Feb 12 2021 Andrew Bauer <zonexpertconsulting@outlook.com> - 1.2.4-1
- initial specfile from poettlerric/zfs-auto-snapshot copr repo