# $Id: PKGBUILD 215666 2014-06-30 06:45:08Z tpowa $
# Maintainer: Tom K <tomk@runbox.com>

pkgname=gnu-netcat
pkgver=0.7.1
pkgrel=1
pkgdesc="GNU rewrite of netcat, the network piping application"
depends=('info')
makedepends=('texinfo')
arch=('i686' 'x86_64')
url="https://netcat.sourceforge.io/"
license=('GPL')
replaces=('netcat')
provides=('netcat')
install=gnu-netcat.install
source=("https://downloads.sourceforge.net/sourceforge/netcat/netcat-$pkgver.tar.bz2"
        gnu-netcat-0.7.1-msys2.patch)
sha256sums=('b55af0bbdf5acc02d1eb6ab18da2acd77a400bafd074489003f3df09676332bb'
            'b393ccc367a14bc2b48049c5ad668fade37fc32a4d8fcf47df9f0721923c02fc')

prepare() {
  cd "${srcdir}/netcat-${pkgver}"
  patch -p1 -i "${srcdir}/gnu-netcat-0.7.1-msys2.patch"

  autoreconf -fiv
}

build() {
  cd "${srcdir}/netcat-${pkgver}"
  ./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
  make
}

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