%define debug_package %{nil} Name: zfs-auto-snapshot Version: 1.2.4 Release: 1%{?dist} Summary: Implementation of a snapshotting service for ZFS License: GPL2 URL: https://github.com/zfsonlinux/zfs-auto-snapshot Source0: %{url}/archive/upstream/%{version}.tar.gz Patch: 0001-prefix_label_order.patch BuildRequires: systemd-rpm-macros Requires: systemd bash %description ZFS Automatic Snapshot Service for Linux %prep %setup -n %{name}-upstream-%{version} %patch -p 1 %build mkdir -p "../systemd" cd "../systemd" ### "Label|NumberOfKeptSnapshots|systemd-timer-spec" of snapshots, ### eg. timer and service files, being created adjust/extend if required declare -a arr=( "frequent|4|*:0/15" "hourly|24|hourly" "daily|31|daily" "weekly|8|weekly" "monthly|12|monthly") for i in "${arr[@]}" do _label="$(echo $i | cut -d'|' -f1)" _keep="$(echo $i | cut -d'|' -f2)" _OnCalendarSpec="$(echo $i | cut -d'|' -f3)" _snapprefix="--prefix=znap" cat > zfs-auto-snapshot-${_label}.service < zfs-auto-snapshot-${_label}.timer < -