# Maintainer: Martell Malone <martellmalone@gmail.com>

pkgname=cygrunsrv
pkgver=1.62
pkgrel=2
pkgdesc="${pkgname} is a windows services tool"
_realname=cygrunsrv
arch=('i686' 'x86_64')
url="https://cygwin.org/"
license=('GPL')
makedepends=('gcc' 'git' 'make')
source=(${pkgname}-${pkgver}::git+https://sourceware.org/git/cygwin-apps/${pkgname}.git#tag=rel${pkgver//./-}
        msysize.patch)
sha256sums=(SKIP
            '270b2015b1dad8008cbc7e66c3ae724fd2d3b51d93bfceefe3895de7cd340c6a')

prepare(){
  cd ${pkgname}-${pkgver}
  patch -p1 -i ${srcdir}/msysize.patch

  autoreconf -fi
}

build() {

  mkdir -p "${srcdir}/build-${CHOST}"
  cd "${srcdir}/build-${CHOST}"

  ../${pkgname}-${pkgver}/configure \
    --prefix=/usr \
    --build=${CHOST} \
    --host=${CHOST} \
    --target=${CHOST}

  make
}

package() {
  cd "${srcdir}/build-${CHOST}"
  make DESTDIR="${pkgdir}" install
}
