From 05ebc1439262e7622ba4ab0c15c2a3bad1ac64c4 Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Wed, 5 Nov 2014 02:41:14 +0000 Subject: [PATCH] added extra/gnu-netcat fixes #1013 --- extra/gnu-netcat/PKGBUILD | 37 +++++++++++++++++++++ extra/gnu-netcat/gnu-netcat-flagcount.patch | 22 ++++++++++++ extra/gnu-netcat/gnu-netcat.install | 13 ++++++++ 3 files changed, 72 insertions(+) create mode 100644 extra/gnu-netcat/PKGBUILD create mode 100644 extra/gnu-netcat/gnu-netcat-flagcount.patch create mode 100644 extra/gnu-netcat/gnu-netcat.install 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 +}