# Contributor: oldherl <oldherl@gmail.com>

pkgname=xungu-git
_pkgname=xungu
pkgver=r6.f17436b
pkgrel=1
pkgdesc="Identify orphaned packages from [archlinuxcn]"
arch=("any")
url="https://github.com/oldherl/xungu"
license=('GPL-3.0-only')
makedepends=(git)
depends=(pyalpm)
provides=($_pkgname)
source=("git+https://github.com/oldherl/xungu")
sha1sums=('SKIP')

pkgver() {
    cd "${srcdir}/${_pkgname}"
    ( set -o pipefail
      git describe --long --tag 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//' ||
      printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
    )
}

package() {
    cd "${srcdir}/${_pkgname}"
    install -Dm755 $_pkgname "$pkgdir/usr/bin/$_pkgname"
}
