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

pkgname=absm
pkgver=2.0
pkgrel=1slint
arch=noarch
docs=("LICENSE" "README.html")
url=https://github.com/DidierSpaier/absm.git
options=('nosrcpack')
source=(https://github.com/DidierSpaier/absm/archive/refs/tags/v2.0.tar.gz)

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() {
	cd ${pkgname}-$pkgver
	sed "s;^[.];*;" README.md > CORRECTED.md
	pandoc -f gfm -t html5 -o README.html CORRECTED.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
} 
