X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id F166119E8474 for ; Tue, 12 Jul 2011 07:19:43 +0000 (UTC) Received: by qyk30 with SMTP id 30so2029927qyk.13 for ; Tue, 12 Jul 2011 00:19:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=jOB16juxGiurKh9r6XV4EEXLY+bQ6YFn3d8cYKsru44=; b=xxyE2t9mFi9v9w5SVSoLzomm4GM2y2B37A/MsuifrsR0KiQ50Hc00PN/DQ8Q45iF8R GJD4ko0TXFTja85Ej214uDTejkkbhQNZBtOGdf5WcGQ76yCkwD9+UK1ZBhiNVl5NkoDq zdtIfDs1j1nEcwZRNfTXjiBKG60uCPcYZhI9A= X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Received: by 10.224.11.1 with SMTP id r1mr4623201qar.267.1310455171898; Tue, 12 Jul 2011 00:19:31 -0700 (PDT) Received: by 10.224.54.136 with HTTP; Tue, 12 Jul 2011 00:19:31 -0700 (PDT) In-Reply-To: <1310419297-15518-1-git-send-email-john@hohm.net> References: <1310419297-15518-1-git-send-email-john@hohm.net> Date: Tue, 12 Jul 2011 09:19:31 +0200 Message-ID: Subject: Re: [alpine-devel] [PATCH] testing/mtr: new aport From: Carlo Landmeter To: John Keith Hohm Cc: alpine-devel@lists.alpinelinux.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Mon, Jul 11, 2011 at 11:21 PM, John Keith Hohm wrote: > Full screen ncurses traceroute tool > http://www.bitwizard.nl/mtr/ > --- > =A0testing/mtr/APKBUILD =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 48 +++++ > =A0testing/mtr/mtr-res_mkquery.patch | =A0374 +++++++++++++++++++++++++++= ++++++++++ > =A02 files changed, 422 insertions(+), 0 deletions(-) > =A0create mode 100644 testing/mtr/APKBUILD > =A0create mode 100644 testing/mtr/mtr-res_mkquery.patch > > diff --git a/testing/mtr/APKBUILD b/testing/mtr/APKBUILD > new file mode 100644 > index 0000000..d2c1559 > --- /dev/null > +++ b/testing/mtr/APKBUILD > @@ -0,0 +1,48 @@ > +# Contributor: John Keith Hohm > +# Maintainer: > +pkgname=3Dmtr > +pkgver=3D0.80 > +pkgrel=3D0 > +pkgdesc=3D"Full screen ncurses traceroute tool" > +url=3D"http://www.bitwizard.nl/mtr/" > +arch=3D"all" > +license=3D"GPL" > +depends=3D"ncurses" > +depends_dev=3D"ncurses-dev" > +makedepends=3D"$depends_dev" > +install=3D"" > +subpackages=3D"$pkgname-doc" > +source=3D"ftp://ftp.bitwizard.nl/$pkgname/$pkgname-$pkgver.tar.gz > + =A0 =A0 =A0 mtr-res_mkquery.patch > + =A0 =A0 =A0 " > + > +_builddir=3D"src/$pkgname-$pkgver" > +prepare() { > + =A0 =A0 =A0 local i > + =A0 =A0 =A0 cd "$_builddir" > + =A0 =A0 =A0 for i in $source; do > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 case $i in > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 *.patch) msg $i; patch -p1 -i "$srcdir"/$i = || return 1;; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 esac > + =A0 =A0 =A0 done > +} > + > +build() { > + =A0 =A0 =A0 cd "$_builddir" > + =A0 =A0 =A0 ./configure --prefix=3D/usr \ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 --sysconfdir=3D/etc \ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 --mandir=3D/usr/share/man \ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 --infodir=3D/usr/share/info \ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 --localstatedir=3D/var \ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 --without-gtk \ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 || return 1 > + =A0 =A0 =A0 make || return 1 > +} > + > +package() { > + =A0 =A0 =A0 cd "$_builddir" > + =A0 =A0 =A0 make DESTDIR=3D"$pkgdir" install || return 1 > +} > + > +md5sums=3D"fa68528eaec1757f52bacf9fea8c68a9 =A0mtr-0.80.tar.gz > +f5982bdacddd8c1ea26d578b62bf810c =A0mtr-res_mkquery.patch" > diff --git a/testing/mtr/mtr-res_mkquery.patch b/testing/mtr/mtr-res_mkqu= ery.patch > new file mode 100644 > index 0000000..c761e97 > --- /dev/null > +++ b/testing/mtr/mtr-res_mkquery.patch > @@ -0,0 +1,374 @@ > +--- a/mtr-0.80/configure > ++++ b/mtr-0.80/configure > +@@ -7165,317 +7165,6 @@ > + > + # =A0AC_CHECK_FUNC(setuid, , AC_MSG_ERROR (I Need either seteuid or set= uid)) > + > +-{ echo "$as_me:$LINENO: checking for res_mkquery" >&5 > +-echo $ECHO_N "checking for res_mkquery... $ECHO_C" >&6; } > +-if test "${ac_cv_func_res_mkquery+set}" =3D set; then > +- =A0echo $ECHO_N "(cached) $ECHO_C" >&6 > +-else > +- =A0cat >conftest.$ac_ext <<_ACEOF > +-/* confdefs.h. =A0*/ > +-_ACEOF > +-cat confdefs.h >>conftest.$ac_ext > +-cat >>conftest.$ac_ext <<_ACEOF > +-/* end confdefs.h. =A0*/ > +-/* Define res_mkquery to an innocuous variant, in case decla= res res_mkquery. > +- =A0 For example, HP-UX 11i declares gettimeofday. =A0*/ > +-#define res_mkquery innocuous_res_mkquery > +- > +-/* System header to define __stub macros and hopefully few prototypes, > +- =A0 =A0which can conflict with char res_mkquery (); below. > +- =A0 =A0Prefer to if __STDC__ is defined, since > +- =A0 =A0 exists even on freestanding compilers. =A0*/ > +- > +-#ifdef __STDC__ > +-# include > +-#else > +-# include > +-#endif > +- > +-#undef res_mkquery > +- > +-/* Override any GCC internal prototype to avoid an error. > +- =A0 Use char because int might match the return type of a GCC > +- =A0 builtin and then its argument prototype would still apply. =A0*/ > +-#ifdef __cplusplus > +-extern "C" > +-#endif > +-char res_mkquery (); > +-/* The GNU C library defines this for functions which it implements > +- =A0 =A0to always fail with ENOSYS. =A0Some functions are actually name= d > +- =A0 =A0something starting with __ and the normal name is an alias. =A0= */ > +-#if defined __stub_res_mkquery || defined __stub___res_mkquery > +-choke me > +-#endif > +- > +-int > +-main () > +-{ > +-return res_mkquery (); > +- =A0; > +- =A0return 0; > +-} > +-_ACEOF > +-rm -f conftest.$ac_objext conftest$ac_exeext > +-if { (ac_try=3D"$ac_link" > +-case "(($ac_try" in > +- =A0*\"* | *\`* | *\\*) ac_try_echo=3D\$ac_try;; > +- =A0*) ac_try_echo=3D$ac_try;; > +-esac > +-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 > +- =A0(eval "$ac_link") 2>conftest.er1 > +- =A0ac_status=3D$? > +- =A0grep -v '^ *+' conftest.er1 >conftest.err > +- =A0rm -f conftest.er1 > +- =A0cat conftest.err >&5 > +- =A0echo "$as_me:$LINENO: \$? =3D $ac_status" >&5 > +- =A0(exit $ac_status); } && { > +- =A0 =A0 =A0 test -z "$ac_c_werror_flag" || > +- =A0 =A0 =A0 test ! -s conftest.err > +- =A0 =A0 =A0 } && test -s conftest$ac_exeext && > +- =A0 =A0 =A0 $as_test_x conftest$ac_exeext; then > +- =A0ac_cv_func_res_mkquery=3Dyes > +-else > +- =A0echo "$as_me: failed program was:" >&5 > +-sed 's/^/| /' conftest.$ac_ext >&5 > +- > +- =A0 =A0 =A0ac_cv_func_res_mkquery=3Dno > +-fi > +- > +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ > +- =A0 =A0 =A0conftest$ac_exeext conftest.$ac_ext > +-fi > +-{ echo "$as_me:$LINENO: result: $ac_cv_func_res_mkquery" >&5 > +-echo "${ECHO_T}$ac_cv_func_res_mkquery" >&6; } > +-if test $ac_cv_func_res_mkquery =3D yes; then > +- =A0: > +-else > +- > +-{ echo "$as_me:$LINENO: checking for res_mkquery in -lbind" >&5 > +-echo $ECHO_N "checking for res_mkquery in -lbind... $ECHO_C" >&6; } > +-if test "${ac_cv_lib_bind_res_mkquery+set}" =3D set; then > +- =A0echo $ECHO_N "(cached) $ECHO_C" >&6 > +-else > +- =A0ac_check_lib_save_LIBS=3D$LIBS > +-LIBS=3D"-lbind =A0$LIBS" > +-cat >conftest.$ac_ext <<_ACEOF > +-/* confdefs.h. =A0*/ > +-_ACEOF > +-cat confdefs.h >>conftest.$ac_ext > +-cat >>conftest.$ac_ext <<_ACEOF > +-/* end confdefs.h. =A0*/ > +- > +-/* Override any GCC internal prototype to avoid an error. > +- =A0 Use char because int might match the return type of a GCC > +- =A0 builtin and then its argument prototype would still apply. =A0*/ > +-#ifdef __cplusplus > +-extern "C" > +-#endif > +-char res_mkquery (); > +-int > +-main () > +-{ > +-return res_mkquery (); > +- =A0; > +- =A0return 0; > +-} > +-_ACEOF > +-rm -f conftest.$ac_objext conftest$ac_exeext > +-if { (ac_try=3D"$ac_link" > +-case "(($ac_try" in > +- =A0*\"* | *\`* | *\\*) ac_try_echo=3D\$ac_try;; > +- =A0*) ac_try_echo=3D$ac_try;; > +-esac > +-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 > +- =A0(eval "$ac_link") 2>conftest.er1 > +- =A0ac_status=3D$? > +- =A0grep -v '^ *+' conftest.er1 >conftest.err > +- =A0rm -f conftest.er1 > +- =A0cat conftest.err >&5 > +- =A0echo "$as_me:$LINENO: \$? =3D $ac_status" >&5 > +- =A0(exit $ac_status); } && { > +- =A0 =A0 =A0 test -z "$ac_c_werror_flag" || > +- =A0 =A0 =A0 test ! -s conftest.err > +- =A0 =A0 =A0 } && test -s conftest$ac_exeext && > +- =A0 =A0 =A0 $as_test_x conftest$ac_exeext; then > +- =A0ac_cv_lib_bind_res_mkquery=3Dyes > +-else > +- =A0echo "$as_me: failed program was:" >&5 > +-sed 's/^/| /' conftest.$ac_ext >&5 > +- > +- =A0 =A0 =A0ac_cv_lib_bind_res_mkquery=3Dno > +-fi > +- > +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ > +- =A0 =A0 =A0conftest$ac_exeext conftest.$ac_ext > +-LIBS=3D$ac_check_lib_save_LIBS > +-fi > +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_bind_res_mkquery" >&5 > +-echo "${ECHO_T}$ac_cv_lib_bind_res_mkquery" >&6; } > +-if test $ac_cv_lib_bind_res_mkquery =3D yes; then > +- =A0cat >>confdefs.h <<_ACEOF > +-#define HAVE_LIBBIND 1 > +-_ACEOF > +- > +- =A0LIBS=3D"-lbind $LIBS" > +- > +-else > +- > +-{ echo "$as_me:$LINENO: checking for res_mkquery in -lresolv" >&5 > +-echo $ECHO_N "checking for res_mkquery in -lresolv... $ECHO_C" >&6; } > +-if test "${ac_cv_lib_resolv_res_mkquery+set}" =3D set; then > +- =A0echo $ECHO_N "(cached) $ECHO_C" >&6 > +-else > +- =A0ac_check_lib_save_LIBS=3D$LIBS > +-LIBS=3D"-lresolv =A0$LIBS" > +-cat >conftest.$ac_ext <<_ACEOF > +-/* confdefs.h. =A0*/ > +-_ACEOF > +-cat confdefs.h >>conftest.$ac_ext > +-cat >>conftest.$ac_ext <<_ACEOF > +-/* end confdefs.h. =A0*/ > +- > +-/* Override any GCC internal prototype to avoid an error. > +- =A0 Use char because int might match the return type of a GCC > +- =A0 builtin and then its argument prototype would still apply. =A0*/ > +-#ifdef __cplusplus > +-extern "C" > +-#endif > +-char res_mkquery (); > +-int > +-main () > +-{ > +-return res_mkquery (); > +- =A0; > +- =A0return 0; > +-} > +-_ACEOF > +-rm -f conftest.$ac_objext conftest$ac_exeext > +-if { (ac_try=3D"$ac_link" > +-case "(($ac_try" in > +- =A0*\"* | *\`* | *\\*) ac_try_echo=3D\$ac_try;; > +- =A0*) ac_try_echo=3D$ac_try;; > +-esac > +-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 > +- =A0(eval "$ac_link") 2>conftest.er1 > +- =A0ac_status=3D$? > +- =A0grep -v '^ *+' conftest.er1 >conftest.err > +- =A0rm -f conftest.er1 > +- =A0cat conftest.err >&5 > +- =A0echo "$as_me:$LINENO: \$? =3D $ac_status" >&5 > +- =A0(exit $ac_status); } && { > +- =A0 =A0 =A0 test -z "$ac_c_werror_flag" || > +- =A0 =A0 =A0 test ! -s conftest.err > +- =A0 =A0 =A0 } && test -s conftest$ac_exeext && > +- =A0 =A0 =A0 $as_test_x conftest$ac_exeext; then > +- =A0ac_cv_lib_resolv_res_mkquery=3Dyes > +-else > +- =A0echo "$as_me: failed program was:" >&5 > +-sed 's/^/| /' conftest.$ac_ext >&5 > +- > +- =A0 =A0 =A0ac_cv_lib_resolv_res_mkquery=3Dno > +-fi > +- > +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ > +- =A0 =A0 =A0conftest$ac_exeext conftest.$ac_ext > +-LIBS=3D$ac_check_lib_save_LIBS > +-fi > +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_res_mkquery" >&5 > +-echo "${ECHO_T}$ac_cv_lib_resolv_res_mkquery" >&6; } > +-if test $ac_cv_lib_resolv_res_mkquery =3D yes; then > +- =A0cat >>confdefs.h <<_ACEOF > +-#define HAVE_LIBRESOLV 1 > +-_ACEOF > +- > +- =A0LIBS=3D"-lresolv $LIBS" > +- > +-else > +- > +-{ echo "$as_me:$LINENO: checking for __res_mkquery in -lresolv" >&5 > +-echo $ECHO_N "checking for __res_mkquery in -lresolv... $ECHO_C" >&6; } > +-if test "${ac_cv_lib_resolv___res_mkquery+set}" =3D set; then > +- =A0echo $ECHO_N "(cached) $ECHO_C" >&6 > +-else > +- =A0ac_check_lib_save_LIBS=3D$LIBS > +-LIBS=3D"-lresolv =A0$LIBS" > +-cat >conftest.$ac_ext <<_ACEOF > +-/* confdefs.h. =A0*/ > +-_ACEOF > +-cat confdefs.h >>conftest.$ac_ext > +-cat >>conftest.$ac_ext <<_ACEOF > +-/* end confdefs.h. =A0*/ > +- > +-/* Override any GCC internal prototype to avoid an error. > +- =A0 Use char because int might match the return type of a GCC > +- =A0 builtin and then its argument prototype would still apply. =A0*/ > +-#ifdef __cplusplus > +-extern "C" > +-#endif > +-char __res_mkquery (); > +-int > +-main () > +-{ > +-return __res_mkquery (); > +- =A0; > +- =A0return 0; > +-} > +-_ACEOF > +-rm -f conftest.$ac_objext conftest$ac_exeext > +-if { (ac_try=3D"$ac_link" > +-case "(($ac_try" in > +- =A0*\"* | *\`* | *\\*) ac_try_echo=3D\$ac_try;; > +- =A0*) ac_try_echo=3D$ac_try;; > +-esac > +-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 > +- =A0(eval "$ac_link") 2>conftest.er1 > +- =A0ac_status=3D$? > +- =A0grep -v '^ *+' conftest.er1 >conftest.err > +- =A0rm -f conftest.er1 > +- =A0cat conftest.err >&5 > +- =A0echo "$as_me:$LINENO: \$? =3D $ac_status" >&5 > +- =A0(exit $ac_status); } && { > +- =A0 =A0 =A0 test -z "$ac_c_werror_flag" || > +- =A0 =A0 =A0 test ! -s conftest.err > +- =A0 =A0 =A0 } && test -s conftest$ac_exeext && > +- =A0 =A0 =A0 $as_test_x conftest$ac_exeext; then > +- =A0ac_cv_lib_resolv___res_mkquery=3Dyes > +-else > +- =A0echo "$as_me: failed program was:" >&5 > +-sed 's/^/| /' conftest.$ac_ext >&5 > +- > +- =A0 =A0 =A0ac_cv_lib_resolv___res_mkquery=3Dno > +-fi > +- > +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ > +- =A0 =A0 =A0conftest$ac_exeext conftest.$ac_ext > +-LIBS=3D$ac_check_lib_save_LIBS > +-fi > +-{ echo "$as_me:$LINENO: result: $ac_cv_lib_resolv___res_mkquery" >&5 > +-echo "${ECHO_T}$ac_cv_lib_resolv___res_mkquery" >&6; } > +-if test $ac_cv_lib_resolv___res_mkquery =3D yes; then > +- =A0cat >>confdefs.h <<_ACEOF > +-#define HAVE_LIBRESOLV 1 > +-_ACEOF > +- > +- =A0LIBS=3D"-lresolv $LIBS" > +- > +-else > +- =A0{ { echo "$as_me:$LINENO: error: No resolver library found" >&5 > +-echo "$as_me: error: No resolver library found" >&2;} > +- =A0 { (exit 1); exit 1; }; } > +-fi > +- > +-fi > +- > +-fi > +- > +-fi > +- > +-# This next line would override the just detected-or-not -lresolv. > +-# This apparently hurts BSD. And it's bad practise. So it should go. > +-# However, it probably didn't get added for nothing..... Holler if > +-# removing it hurts your OS.... -- REW > +-#LIBS=3D"$LIBS -lresolv" > +- > + { echo "$as_me:$LINENO: checking for herror" >&5 > + echo $ECHO_N "checking for herror... $ECHO_C" >&6; } > + if test "${ac_cv_func_herror+set}" =3D set; then > +--- a/mtr-0.80/dns.c > ++++ b/mtr-0.80/dns.c > +@@ -881,6 +881,51 @@ > + } > + > + > ++ /* res_mkquery from dietlibc libcruft http://www.fefe.de/dietlibc/ */ > ++ > ++static char dnspacket[]=3D"\xfe\xfe\001\000\000\001\000\000\000\000\000= \000"; > ++ > ++static int res_mkquery(int op, const char *dname, int class, int type, = char* data, > ++ =A0 =A0 =A0 =A0 =A0 =A0 =A0int datalen, const unsigned char* newrr, ch= ar* buf, int buflen) { > ++ =A0unsigned char packet[512]; > ++ =A0unsigned long len; > ++ > ++ =A0memcpy(packet,dnspacket,12); > ++ =A0len=3Drand(); > ++ =A0packet[0]=3Dlen; > ++ =A0packet[1]=3Dlen>>8; > ++ =A0len=3D0; > ++ =A0if ((_res.options&RES_RECURSE)=3D=3D0) packet[2]=3D0; > ++ =A0{ > ++ =A0 =A0unsigned char* x; > ++ =A0 =A0const char* y,* tmp; > ++ =A0 =A0x=3Dpacket+12; y=3Ddname; > ++ =A0 =A0while (*y) { > ++ =A0 =A0 =A0while (*y=3D=3D'.') ++y; > ++ =A0 =A0 =A0for (tmp=3Dy; *tmp && *tmp!=3D'.'; ++tmp) ; > ++ =A0 =A0 =A0if (tmp-y > 63) return -1; > ++ =A0 =A0 =A0*x=3Dtmp-y; > ++ =A0 =A0 =A0if (!(tmp-y)) break; > ++ =A0 =A0 =A0if ((len+=3D*x+1) > 254) return -1; > ++ =A0 =A0 =A0++x; > ++ =A0 =A0 =A0memmove(x,y,tmp-y); > ++ =A0 =A0 =A0x+=3Dtmp-y; > ++ =A0 =A0 =A0if (!*tmp) { > ++ =A0 =A0 =A0*x=3D0; > ++ =A0 =A0 =A0break; > ++ =A0 =A0 =A0} > ++ =A0 =A0 =A0y=3Dtmp; > ++ =A0 =A0} > ++ =A0 =A0*++x=3D 0; *++x=3D type; =A0 =A0 =A0/* A */ > ++ =A0 =A0*++x=3D 0; *++x=3D class; =A0 =A0 /* IN */ > ++ =A0 =A0++x; > ++ =A0 =A0if (x-packet>buflen) return -1; > ++ =A0 =A0memmove(buf,packet,x-packet); > ++ =A0 =A0return x-packet; > ++ =A0} > ++} > ++ > ++ > + void dorequest(char *s,int type,word id) > + { > + =A0 packetheader *hp; > -- > 1.7.4.5 > > > > --- > Unsubscribe: =A0alpine-devel+unsubscribe@lists.alpinelinux.org > Help: =A0 =A0 =A0 =A0 alpine-devel+help@lists.alpinelinux.org > --- > > Looks good. Applied. Thanks! -carlo --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---