# Maintainer: Yamada Hayao <hayao@fascode.net>

pkgname=win11os-kde-git
_pkgname=win11os-kde
_gitname=Win11OS-kde
pkgver=r48.b5daaa3
pkgrel=1
pkgdesc="Win11OS kde is a clean theme for KDE Plasma desktop"
arch=('any')
url='https://github.com/yeyushengfan258/Win11OS-kde'
license=('GPL')
depends=()
optdepends=()
source=("git+${url}.git")
md5sums=('SKIP')
conflicts=('win11os-kde')

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

package() {
    install -dm755 "${pkgdir}/usr/share/Kvantum/"
    install -dm755 "${pkgdir}/usr/share/aurorae/themes/"
    install -dm755 "${pkgdir}/usr/share/color-schemes/"
    install -dm755 "${pkgdir}/usr/share/plasma/desktoptheme/"
    install -dm755 "${pkgdir}/usr/share/plasma/layout-templates"
    install -dm755 "${pkgdir}/usr/share/plasma/look-and-feel/"
    install -dm755 "${pkgdir}/usr/share/wallpapers/"

    find "${srcdir}/${_gitname}" -type f -exec chmod 644 {} \;

    cp -r "${srcdir}/${_gitname}/Kvantum/"*              "${pkgdir}/usr/share/Kvantum/"
    cp -r "${srcdir}/${_gitname}/aurorae/"*              "${pkgdir}/usr/share/aurorae/themes/"
    cp -r "${srcdir}/${_gitname}/color-schemes/"*.colors "${pkgdir}/usr/share/color-schemes/"
    cp -r "${srcdir}/${_gitname}/plasma/desktoptheme/"*  "${pkgdir}/usr/share/plasma/desktoptheme/"
    cp -r "${srcdir}/${_gitname}/plasma/look-and-feel/"* "${pkgdir}/usr/share/plasma/look-and-feel/"
    cp -r "${srcdir}/${_gitname}/wallpaper/"*            "${pkgdir}/usr/share/wallpapers/"
}
