# Maintainer: Valeria Fadeeva <valeria@fadeeva.me>

_gitname="$(basename $(pwd))"
pkgname=("$_gitname" "melawy-win11-icon-theme-special" "melawy-win11-icon-theme-white")
pkgver=1.123
pkgrel=1
pkgdesc="$(head -n 2 README.md | tail -n 1)"
url="https://git.melawy.ru/Design/$_gitname"
arch=("any")
license=("AGPL3")
depends=("gtk-update-icon-cache")
optdepends=()
makedepends=("git")
options=(!strip !emptydirs)
backup=()
source=("git+$url.git")
sha256sums=("SKIP")
validpgpkeys=('BC8B600E8DDA1F4CB77B10D2BA803A261A5EE6B8')

# pkgver() {
# 	cd "$srcdir/$_gitname"
# 	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
# }

pkgver() {
	cd "$srcdir/$_gitname"
	printf "1.%s" "$(git rev-list --count HEAD)"
}

package_melawy-win11-icon-theme() {
    provides=("${pkgname}")
    conflicts=("${pkgname}")

    install -dm755 "${pkgdir}/usr/share/icons"
    "${srcdir}/${_gitname}/install.sh" -a -d "${pkgdir}/usr/share/icons"
}

package_melawy-win11-icon-theme-special() {
    provides=("melawy-win11-icon-theme-special")
    conflicts=("melawy-win11-icon-theme-special")

    install -dm755 "${pkgdir}/usr/share/icons"
    "${srcdir}/${_gitname}/install.sh" -special -d "${pkgdir}/usr/share/icons"
}

package_melawy-win11-icon-theme-white() {
    provides=("melawy-win11-icon-theme-white")
    conflicts=("melawy-win11-icon-theme-white")

    install -dm755 "${pkgdir}/usr/share/icons"
    "${srcdir}/${_gitname}/install.sh" --white -d "${pkgdir}/usr/share/icons"
}
