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

_realname=connect
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=1.105
tag='e122d9bd28e1'
pkgrel=2
pkgdesc="Make socket connection using SOCKS4/5 and HTTP tunnel (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
license=('GPL2+')
url="https://github.com/gotoh/ssh-connect"
options=('strip')
source=(${_realname}-${pkgver}.tar.gz::"${url}/archive/${pkgver}.tar.gz")
sha256sums=('96c50fefe7ecf015cf64ba6cec9e421ffd3b18fef809f59961ef9229df528f3e')

build() {
  cd "${srcdir}/ssh-connect-${pkgver}"

  test -x ver || printf '#!/bin/sh\n\necho Windows\n' > ver

  PATH=.:$PATH make -j1 rebuild
}

package() {
  cd "${srcdir}/ssh-connect-${pkgver}"

  install -d "${pkgdir}${MINGW_PREFIX}/bin/"
  install connect.exe "${pkgdir}${MINGW_PREFIX}/bin/"

  install -d "${pkgdir}${MINGW_PREFIX}/share/doc/connect/"
  install doc/manual.html "${pkgdir}${MINGW_PREFIX}/share/doc/connect/"
  install doc/manual.txt "${pkgdir}${MINGW_PREFIX}/share/doc/connect/"
}
