# Maintainer: Johannes Schindelin <johannes.schindelin@gmx.de>

_realname=git-flow
pkgname="${_realname}"
pkgver=1.12.3
pkgrel=2
pkgdesc="Git extensions to provide high-level repository operations for Vincent Driessen's branching model (AVH edition)"
arch=('i686' 'x86_64')
license=('BSD')
depends=('git' 'util-linux' 'make')
url="https://github.com/petervanderdoes/gitflow-avh"
source=("${_realname}"::"git+https://github.com/petervanderdoes/gitflow-avh.git#branch=master")
sha256sums=('SKIP')
msys2_references=(
  'aur: gitflow-avh'
)

pkgver() {
  cd "${srcdir}/${_realname}"

  # Need to create sane tags to allow `git describe` to work
  for t in $(git tag -l | grep '^[0-9]')
  do
    git rev-parse --quiet --verify v${t} >/dev/null || git tag v${t} ${t^2}
  done

  git describe --tags |
  sed -e 's/^v//' -e 'y/-/./'
}

package() {
  cd "${srcdir}/${_realname}"

  make prefix="${pkgdir}/usr/" install
}
