#!/bin/bash
# shellcheck disable=SC2034
#Packager: Didier Spaier didieratslintdotfr

pkgname=absm
#commit=8f0aa26
commit=0bd353fc
commit=b0fc45f
pkgver=git$commit
pkgrel=1slint
docs=("LICENSE" "README.html")
export url=https://github.com/DidierSpaier/absm.git
options=('nosrcpack')

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"absm (a BTRFS Snapshot Manager)"
"absm allows to create, delete, list and restore snapshots of the"
"root subvolume mounted as /, excluding the /home directory."

"URL: https://github.com/DidierSpaier/absm"
)

doinst() {
if [ -x /usr/bin/glib-compile-schemas ]; then
  /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas > /dev/null 2>&1
fi
}

build() {
	git clone "$url"
	cd "$pkgname" || exit 1
	git checkout $commit || exit
	sleep 2
	pandoc -f gfm -t html5 -o README.html README.md
	mkdir -p "$PKG"/usr/sbin
	cp absm "$PKG"/usr/sbin/absm
	chmod 755 "$PKG"/usr/sbin/absm
	mkdir -p "$PKG"/usr/share/applications
	cp absm.desktop "$PKG"/usr/share/applications || exit
} 
