# Maintainer: Christian Schendel pkgname=gnome-shell-extension-autohide-battery pkgdesc="GNOME Shell extension to hide battery icon, if battery is fully charged and AC is connected" pkgver=58 pkgrel=1 url="https://github.com/ai/autohide-battery" arch=('any') license=( MIT ) makedepends=( git zip ) depends=( dconf 'gnome-shell>=1:45' ) conflicts=( 'gnome-shell-extension-autohide-battery-git' ) source=("${pkgname}-${pkgver}::git+${url}.git#tag=${pkgver}") b2sums=('b65ac5adde50496baaf9f98c0c051f8e9951228300b839fa21a6895133994f7c2c320919a0ceaf058df00fdde685c966e49c873d9ec27cff34220f1341ac0eb5') build() { cd "${pkgname}-${pkgver}" make build } package() { cd "${pkgname}-${pkgver}" local uuid local schema uuid=$(grep -Po '(?<="uuid": ")[^"]*' metadata.json) schema=$(grep -Po '(?<="settings-schema": ")[^"]*' metadata.json).gschema.xml local destdir="${pkgdir}"/usr/share/gnome-shell/extensions/"${uuid}" install -d "${pkgdir}/usr/share/gnome-shell/extensions/${uuid}" bsdtar --no-same-owner -xvf "${uuid}.shell-extension.zip" -C \ "${pkgdir}/usr/share/gnome-shell/extensions/${uuid}" install -Dm0644 -t "${pkgdir}/usr/share/glib-2.0/schemas" "${destdir}/schemas/${schema}" rm -rf "${pkgdir}/usr/share/gnome-shell/extensions/${uuid}/schemas" cp -r "${pkgdir}/usr/share/gnome-shell/extensions/${uuid}/locale" "${pkgdir}/usr/share" rm -rf "${pkgdir}/usr/share/gnome-shell/extensions/${uuid}/locale" install -Dm0644 -t "${pkgdir}/usr/share/doc/${pkgname}" README.md CHANGELOG.md install -Dm0644 -t "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE } # vim: set ft=sh ts=4 sw=4 et: