# Maintainer: Mike Swanson pkgname=zfs-auto-snapshot-git pkgdesc="Implementation of a snapshotting service for ZFS" pkgver=1.2.4.r0.277287f pkgrel=1 epoch=1 arch=('any') url="https://github.com/zfsonlinux/zfs-auto-snapshot" license=('GPL2') depends=('systemd>=212' 'zfs') makedepends=('git') provides=("${pkgname%-git}") conflicts=("${pkgname%-git}") source=("git+$url" "prefix_label_order.patch") sha512sums=('SKIP' 'f0dc350f17bac8b1569e088c7b8c4d097b810eeab1addbf84f79aa5294c96a6353ceaaeb212feb85136f5a190d5ae54ff9a2e5b9441a0cb0960d43518aedfa47') pkgver() { cd "$srcdir/${pkgname%-git}" printf "%s\n" "$(git describe --tags --long | sed 's|upstream/||g' | sed 's/\([^-]*-\)g/r\1/;s/-/./g')" } prepare() { cd "${pkgname%-git}" for patch in ../*.patch; do if [ ! -f "$patch" ]; then break; else patch -p1 -i "$patch" fi done mkdir "../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)" _prefix="--prefix=znap" cat > zfs-auto-snapshot-${_label}.service < zfs-auto-snapshot-${_label}.timer <