diff --git a/extra/gnu-netcat/PKGBUILD b/extra/gnu-netcat/PKGBUILD new file mode 100644 index 000000000..71a85e748 --- /dev/null +++ b/extra/gnu-netcat/PKGBUILD @@ -0,0 +1,37 @@ +# $Id$ +# Maintainer: Tom K + +# ALARM: Kevin Mihelich +# - patch for ARM fix (http://sourceforge.net/p/netcat/bugs/23/) + +pkgname=gnu-netcat +pkgver=0.7.1 +pkgrel=5.1 +pkgdesc="GNU rewrite of netcat, the network piping application" +depends=('glibc' 'texinfo') +arch=('i686' 'x86_64') +url="http://netcat.sourceforge.net/" +license=('GPL') +replaces=('netcat') +provides=('netcat') +install=gnu-netcat.install +source=("http://downloads.sourceforge.net/sourceforge/netcat/netcat-$pkgver.tar.bz2" + 'gnu-netcat-flagcount.patch') +md5sums=('0a29eff1736ddb5effd0b1ec1f6fe0ef' + 'fccdd10bf84b18ba4e1d9ef2677e038c') + +prepare() { + cd "${srcdir}/netcat-${pkgver}" + patch -p1 -i ../gnu-netcat-flagcount.patch +} + +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 +} diff --git a/extra/gnu-netcat/gnu-netcat-flagcount.patch b/extra/gnu-netcat/gnu-netcat-flagcount.patch new file mode 100644 index 000000000..765212cb0 --- /dev/null +++ b/extra/gnu-netcat/gnu-netcat-flagcount.patch @@ -0,0 +1,22 @@ +--- a/src/flagset.c ++++ b/src/flagset.c +@@ -134,7 +134,7 @@ + + int netcat_flag_count(void) + { +- register char c; ++ register unsigned char c; + register int i; + int ret = 0; + +@@ -154,8 +154,8 @@ + Assumed that the bit number 1 is the sign, and that we will shift the + bit 1 (or the bit that takes its place later) until the the most right, + WHY it has to keep the wrong sign? */ +- ret -= (c >> 7); +- c <<= 1; ++ ret += (c & 1); ++ c >>= 1; + } + } + diff --git a/extra/gnu-netcat/gnu-netcat.install b/extra/gnu-netcat/gnu-netcat.install new file mode 100644 index 000000000..a946aa2ee --- /dev/null +++ b/extra/gnu-netcat/gnu-netcat.install @@ -0,0 +1,13 @@ +infodir=/usr/share/info + +post_install() { + install-info $infodir/netcat.info.gz $infodir/dir 2> /dev/null +} + +post_upgrade() { + post_install $1 +} + +pre_remove() { + install-info --delete $infodir/netcat.info.gz $infodir/dir 2> /dev/null +}