# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=shishi
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.0.3
pkgrel=2
pkgdesc="a GNU implementation of the Kerberos 5 network security system (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://www.gnu.org/software/shishi/"
msys2_repository_url="https://git.savannah.gnu.org/gitweb/?p=shishi.git"
license=("GPL")
depends=("${MINGW_PACKAGE_PREFIX}-gettext-runtime"
         "${MINGW_PACKAGE_PREFIX}-gnutls"
         "${MINGW_PACKAGE_PREFIX}-libidn"
         "${MINGW_PACKAGE_PREFIX}-libgcrypt"
         "${MINGW_PACKAGE_PREFIX}-libgpg-error"
         "${MINGW_PACKAGE_PREFIX}-libtasn1")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
             "${MINGW_PACKAGE_PREFIX}-gettext-tools"
             "${MINGW_PACKAGE_PREFIX}-gtk-doc"
             "${MINGW_PACKAGE_PREFIX}-autotools"
             "gengetopt")
source=("https://ftp.gnu.org/gnu/shishi/shishi-${pkgver}.tar.gz")
sha256sums=('95798ffd12dd01a4f88e0311ee03ca4a26e5cb4e5e9059a40e4fc4d9f2917e92')

prepare() {
  cd "${_realname}-${pkgver}"

  autoreconf -fi

  cp lib/gl/m4/wint_t.m4 ./m4
}

build() {
  mkdir -p "${srcdir}/build-${MSYSTEM}" && cd build-${MSYSTEM}

  ../"${_realname}-${pkgver}"/configure \
    --prefix=${MINGW_PREFIX} \
    --enable-shared \
    --enable-static

  make -j1
}

package() {
  cd build-${MSYSTEM}
  make DESTDIR="${pkgdir}" install
}
