bug 104718
authorMarcelo Góes <vanquirius@gentoo.org>
Sat, 3 Sep 2005 16:25:48 +0000 (16:25 +0000)
committerMarcelo Góes <vanquirius@gentoo.org>
Sat, 3 Sep 2005 16:25:48 +0000 (16:25 +0000)
Package-Manager: portage-2.0.51.22-r2

net-analyzer/mtr/ChangeLog
net-analyzer/mtr/Manifest
net-analyzer/mtr/files/digest-mtr-0.69-r1 [new file with mode: 0644]
net-analyzer/mtr/files/mtr-0.69-debian.patch [new file with mode: 0644]
net-analyzer/mtr/mtr-0.69-r1.ebuild [new file with mode: 0644]

index 9ae87300e726cdbd2f9528e3e3c3cbe21efbb4fe..40b5a49254482f5d1f0c5d6a086a76361a162075 100644 (file)
@@ -1,6 +1,13 @@
 # ChangeLog for net-analyzer/mtr
 # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/mtr/ChangeLog,v 1.48 2005/08/24 23:25:40 agriffis Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/mtr/ChangeLog,v 1.49 2005/09/03 16:25:48 vanquirius Exp $
+
+*mtr-0.69-r1 (03 Sep 2005)
+
+  03 Sep 2005; Marcelo Goes <vanquirius@gentoo.org>
+  +files/mtr-0.69-debian.patch, +mtr-0.69-r1.ebuild:
+  Use patch from Debian to fix failed to bind to interface problem when using
+  --address. Fixes bug 104718. Thanks to Claudiu Gafton <gafty@alvatec.ro>.
 
   24 Aug 2005; Aron Griffis <agriffis@gentoo.org> mtr-0.69.ebuild:
   stable on ia64
index 807390c178d4f8cfdb0c7448daf438a1a0dca44b..d6710d47428a7f0b5f05d27508894d4bf55bd11c 100644 (file)
@@ -1,7 +1,10 @@
 MD5 8fe99a74d5a26127140f3435860dd4d2 mtr-0.67.ebuild 1296
-MD5 720bffd73acf542e859034ca9d443c19 metadata.xml 244
-MD5 4c747c3aec88e4597e3f45b10c04d8f0 ChangeLog 5347
+MD5 24a16181446e8046321e3f259794bbbd mtr-0.69-r1.ebuild 1471
 MD5 6dcd2450970cd65f5b6182b287b390b4 mtr-0.69.ebuild 1407
-MD5 ce43e9fae32e2db595e780b4a4b2fcd8 files/digest-mtr-0.69 60
-MD5 ed7a57f974bbb8a86b2fc02be7277c94 files/digest-mtr-0.67 60
+MD5 6fd1a039deaf9ef9bb871b0ceec28495 ChangeLog 5637
+MD5 720bffd73acf542e859034ca9d443c19 metadata.xml 244
 MD5 0bbdffc84e47f22daaf46c76e941a02a files/mtr-ac-res_mkquery.patch 510
+MD5 1b2fafeb55048e9993c48c330ca7a4bf files/mtr-0.69-debian.patch 2558
+MD5 ed7a57f974bbb8a86b2fc02be7277c94 files/digest-mtr-0.67 60
+MD5 ce43e9fae32e2db595e780b4a4b2fcd8 files/digest-mtr-0.69 60
+MD5 ce43e9fae32e2db595e780b4a4b2fcd8 files/digest-mtr-0.69-r1 60
diff --git a/net-analyzer/mtr/files/digest-mtr-0.69-r1 b/net-analyzer/mtr/files/digest-mtr-0.69-r1
new file mode 100644 (file)
index 0000000..609a70c
--- /dev/null
@@ -0,0 +1 @@
+MD5 58904d6d8d70114195cdeb653d56914c mtr-0.69.tar.gz 183216
diff --git a/net-analyzer/mtr/files/mtr-0.69-debian.patch b/net-analyzer/mtr/files/mtr-0.69-debian.patch
new file mode 100644 (file)
index 0000000..5842777
--- /dev/null
@@ -0,0 +1,93 @@
+--- mtr-0.69.orig/mtr.c
++++ mtr-0.69/mtr.c
+@@ -388,10 +388,6 @@
+   }
+ 
+   
+-  if (net_set_interfaceaddress (InterfaceAddress) != 0) {
+-    fprintf (stderr, "mtr: Couldn't set interface addres.\n"); 
+-    exit (1); 
+-  }
+ 
+ #ifdef ENABLE_IPV6
+   /* gethostbyname2() is deprecated so we'll use getaddrinfo() instead. */
+@@ -442,6 +438,11 @@
+         exit(1);
+       }
+ 
++  if (net_set_interfaceaddress (InterfaceAddress) != 0) {
++    fprintf (stderr, "mtr: Couldn't set interface address.\n"); 
++    exit (1); 
++  }
++
+   display_open();
+   dns_open();
+ 
+--- mtr-0.69.orig/net.c
++++ mtr-0.69/net.c
+@@ -322,7 +322,15 @@
+   int oldavg; /* usedByMin */
+   int oldjavg;        /* usedByMin */
+   int i;      /* usedByMin */
++#ifdef ENABLE_IPV6
++  char addrcopy[sizeof(struct in6_addr)];
++#else
++  char addrcopy[sizeof(struct in_addr)];
++#endif
+ 
++  /* Copy the from address ASAP because it can be overwritten */
++  addrcpy( (void *) &addrcopy, addr, af );
++  
+   if (seq < 0 || seq >= MaxSequence)
+     return;
+ 
+@@ -339,22 +347,22 @@
+   if ( addrcmp( (void *) &(host[index].addr),
+               (void *) &unspec_addr, af ) == 0 ) {
+     // should be out of if as addr can change
+-    addrcpy( (void *) &(host[index].addr), addr, af );
++    addrcpy( (void *) &(host[index].addr), addrcopy, af );
+     display_rawhost(index, (void *) &(host[index].addr));
+ 
+   /* multi paths by Min */
+-    addrcpy( (void *) &(host[index].addrs[0]), addr, af );
++    addrcpy( (void *) &(host[index].addrs[0]), addrcopy, af );
+   } else {
+     for( i=0; i<MAXPATH; ) {
+-      if( addrcmp( (void *) &(host[index].addrs[i]), (void *) &addr,
++      if( addrcmp( (void *) &(host[index].addrs[i]), (void *) &addrcopy,
+                    af ) == 0 ||
+           addrcmp( (void *) &(host[index].addrs[i]),
+                  (void *) &unspec_addr, af ) == 0 ) break;
+       i++;
+     }
+-    if( addrcmp( (void *) &(host[index].addrs[i]), addr, af ) != 0 && 
++    if( addrcmp( (void *) &(host[index].addrs[i]), addrcopy, af ) != 0 && 
+         i<MAXPATH ) {
+-      addrcpy( (void *) &(host[index].addrs[i]), addr, af );
++      addrcpy( (void *) &(host[index].addrs[i]), addrcopy, af );
+     }
+   /* end multi paths */
+   }
+@@ -911,8 +919,10 @@
+ 
+ void net_close(void)
+ {
+-  close(sendsock);
+-  close(recvsock);
++  if (sendsock4 >= 0) close(sendsock4);
++  if (recvsock4 >= 0) close(recvsock4);
++  if (sendsock6 >= 0) close(sendsock6);
++  if (recvsock6 >= 0) close(recvsock6);
+ }
+ 
+ 
+--- mtr-0.69.orig/net.h
++++ mtr-0.69/net.h
+@@ -117,3 +117,6 @@
+ extern char available_options[];
+ 
+ ip_t unspec_addr;
++
++FILE *ADDRCMP;
++int i;
diff --git a/net-analyzer/mtr/mtr-0.69-r1.ebuild b/net-analyzer/mtr/mtr-0.69-r1.ebuild
new file mode 100644 (file)
index 0000000..49ab8af
--- /dev/null
@@ -0,0 +1,62 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/mtr/mtr-0.69-r1.ebuild,v 1.1 2005/09/03 16:25:48 vanquirius Exp $
+
+inherit eutils flag-o-matic
+
+DESCRIPTION="My TraceRoute. Excellent network diagnostic tool."
+HOMEPAGE="http://www.bitwizard.nl/mtr/"
+SRC_URI="ftp://ftp.bitwizard.nl/mtr/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc-macos ~s390 ~sparc ~x86"
+IUSE="gtk gtk2 ipv6"
+
+DEPEND="dev-util/pkgconfig"
+RDEPEND=">=sys-libs/ncurses-5.2
+       gtk? (
+                       !gtk2? ( =x11-libs/gtk+-1.2* )
+                       gtk2? ( >=x11-libs/gtk+-2 )
+               )"
+
+src_unpack() {
+       unpack ${A}
+       cd ${S}
+       epatch ${FILESDIR}/${PN}-ac-res_mkquery.patch
+       # bug 104718
+       epatch ${FILESDIR}/${P}-debian.patch
+}
+
+src_compile() {
+       autoconf || die "autoconf failed"
+
+       local myconf
+       use gtk || myconf="${myconf} --without-gtk"
+
+       if use ppc-macos;
+       then
+               append-flags "-DBIND_8_COMPAT"
+       else
+               append-ldflags -Wl,-z,now
+       fi
+
+       econf ${myconf} \
+               $(use_enable gtk2) \
+               $(use_enable ipv6) \
+               || die "econf failed"
+
+       emake || die "emake failed"
+}
+
+src_install() {
+       # this binary is universal. ie: it does both console and gtk.
+       make DESTDIR=${D} sbindir=/usr/bin install || die "make install failed"
+
+       insinto /usr/share/${PN} ; doins img/mtr_icon.xpm
+
+       fowners root:wheel /usr/bin/mtr
+       fperms 4710 /usr/bin/mtr
+
+       dodoc AUTHORS COPYING ChangeLog FORMATS NEWS README SECURITY TODO
+}