[packages/mtr] - up to 0.92 (no longer works from inside vserver)

arekm arekm at pld-linux.org
Sun Aug 13 10:57:05 CEST 2017


commit 2f473df2d1afcea6d4b65f9a2d9a9e5f8d554801
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sun Aug 13 10:56:58 2017 +0200

    - up to 0.92 (no longer works from inside vserver)

 mtr-Makefile.patch            | 23 ++++++------
 mtr-curses-clear_colors.patch | 17 +++++----
 mtr-display.patch             | 21 ++++++-----
 mtr-mtr6.patch                | 16 ++++-----
 mtr-noraw.patch               | 81 -------------------------------------------
 mtr-nox.patch                 | 11 ------
 mtr.spec                      | 24 +++++++------
 7 files changed, 51 insertions(+), 142 deletions(-)
---
diff --git a/mtr.spec b/mtr.spec
index a6faa23..615c837 100644
--- a/mtr.spec
+++ b/mtr.spec
@@ -9,13 +9,13 @@ Summary(pt_BR.UTF-8):	Ferramenta para diagnóstico da rede, combinando ping/trac
 Summary(ru.UTF-8):	Matt's Traceroute - утилита для диагностики сети
 Summary(uk.UTF-8):	Matt's Traceroute - утиліта для діагностики мережі
 Name:		mtr
-Version:	0.87
+Version:	0.92
 Release:	1
 Epoch:		1
 License:	GPL v2
 Group:		Networking/Utilities
 Source0:	https://github.com/traviscross/mtr/archive/v%{version}.tar.gz
-# Source0-md5:	23fa76f57fa67fbc95ecf4fb5901ff50
+# Source0-md5:	f764793302a6cee2bf1573b95db6f295
 Source1:	%{name}.desktop
 Source2:	%{name}.png
 Patch0:		%{name}-Makefile.patch
@@ -23,8 +23,6 @@ Patch0:		%{name}-Makefile.patch
 Patch2:		%{name}-mtr6.patch
 Patch3:		%{name}-display.patch
 Patch4:		%{name}-curses-clear_colors.patch
-Patch5:		%{name}-noraw.patch
-Patch6:		%{name}-nox.patch
 URL:		http://www.bitwizard.nl/mtr/
 BuildRequires:	autoconf >= 2.50
 BuildRequires:	automake
@@ -34,6 +32,7 @@ BuildRequires:	ncurses-devel >= 5.2
 %{?with_x:BuildRequires:	pkgconfig}
 Obsoletes:	mtr-ncurses
 Requires:	glib2 >= 1:2.6.0
+Requires(post):	/sbin/setcap
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -142,8 +141,6 @@ mtr - це traceroute та ping в одному флаконі. При запу
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
-%patch5 -p1
-%patch6 -p1
 
 #echo 'AC_DEFUN([AM_PATH_GTK],[$3])' >> acinclude.m4
 %{!?with_x:echo 'AC_DEFUN([AM_PATH_GTK_2_0],[$3])' >> acinclude.m4}
@@ -157,7 +154,8 @@ mtr - це traceroute та ping в одному флаконі. При запу
 %if %{with x}
 %configure \
 	--with-gtk \
-	--enable-ipv6
+	--enable-ipv6 \
+	--disable-silent-rules
 
 %{__make}
 mv -f mtr mtr-gtk
@@ -166,7 +164,8 @@ mv -f mtr mtr-gtk
 
 %configure \
 	--without-gtk \
-	--enable-ipv6
+	--enable-ipv6 \
+	--disable-silent-rules
 
 %{__make}
 
@@ -192,13 +191,18 @@ ln -sf mtr $RPM_BUILD_ROOT%{_bindir}/mtr6
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post
+/sbin/setcap cap_net_raw+ep %{_bindir}/mtr-packet
+
 %files
 %defattr(644,root,root,755)
 %doc AUTHORS NEWS README SECURITY
-%attr(4755,root,root) %{_bindir}/mtr
-%attr(4755,root,root) %{_bindir}/mtr6
+%attr(755,root,root) %{_bindir}/mtr
+%attr(755,root,root) %{_bindir}/mtr6
+%attr(4755,root,root) %{_bindir}/mtr-packet
 %{_sbindir}/mtr
 %{_mandir}/man8/mtr.8*
+%{_mandir}/man8/mtr-packet.8*
 
 %if %{with x}
 %files X11
diff --git a/mtr-Makefile.patch b/mtr-Makefile.patch
index cce16dd..2d01341 100644
--- a/mtr-Makefile.patch
+++ b/mtr-Makefile.patch
@@ -1,14 +1,13 @@
-diff -u mtr-0.87.orig/Makefile.am mtr-0.87/Makefile.am
---- mtr-0.87.orig/Makefile.am	2016-08-03 07:27:03.000000000 +0200
-+++ mtr-0.87/Makefile.am	2017-01-12 18:55:47.832246506 +0100
-@@ -2,9 +2,6 @@
+--- mtr-0.92/Makefile.am~	2017-06-02 10:54:58.000000000 +0200
++++ mtr-0.92/Makefile.am	2017-08-13 10:32:00.987389909 +0200
+@@ -40,10 +40,6 @@ $(PATHFILES): Makefile
+ dist_man_MANS = mtr.8 mtr-packet.8
+ PATHFILES += man/mtr.8 man/mtr-packet.8
  
- sbin_PROGRAMS = mtr
- man_MANS = mtr.8
 -install-exec-hook: 
--	`setcap cap_net_raw+ep $(DESTDIR)$(sbindir)/mtr` \
--	|| chmod u+s $(DESTDIR)$(sbindir)/mtr
- 
- mtr_SOURCES = mtr.c \
-               net.c net.h \
-Common subdirectories: mtr-0.87.orig/img and mtr-0.87/img
+-	`setcap cap_net_raw+ep $(DESTDIR)$(sbindir)/mtr-packet` \
+-	|| chmod u+s $(DESTDIR)$(sbindir)/mtr-packet
+-
+ mtr_SOURCES = ui/mtr.c ui/mtr.h \
+               ui/net.c ui/net.h \
+               ui/cmdpipe.c ui/cmdpipe.h \
diff --git a/mtr-curses-clear_colors.patch b/mtr-curses-clear_colors.patch
index 7f795fa..6619029 100644
--- a/mtr-curses-clear_colors.patch
+++ b/mtr-curses-clear_colors.patch
@@ -1,11 +1,10 @@
-diff -ruNp mtr-0.86.orig/curses.c mtr-0.86/curses.c
---- mtr-0.86.orig/curses.c	2014-12-09 12:20:57.000000000 +0100
-+++ mtr-0.86/curses.c	2016-01-10 05:43:56.278385752 +0100
-@@ -713,6 +713,7 @@ void mtr_curses_open(void)
- void mtr_curses_close(void)
- {  
-   printw("\n");
-+  use_default_colors();
-   endwin();
+--- mtr-0.92/ui/curses.c~	2017-06-02 10:54:58.000000000 +0200
++++ mtr-0.92/ui/curses.c	2017-08-13 10:36:20.291175216 +0200
+@@ -800,6 +800,7 @@ void mtr_curses_close(
+     void)
+ {
+     printw("\n");
++    use_default_colors();
+     endwin();
  }
  
diff --git a/mtr-display.patch b/mtr-display.patch
index 428dc05..a5b417a 100644
--- a/mtr-display.patch
+++ b/mtr-display.patch
@@ -1,12 +1,11 @@
-diff -uNr mtr-0.69.orig/mtr.c mtr-0.69/mtr.c
---- mtr-0.69.orig/mtr.c	2005-09-18 10:54:21.000000000 +0200
-+++ mtr-0.69/mtr.c	2005-09-18 11:31:50.000000000 +0200
-@@ -74,7 +74,7 @@
- 
- 
- /* default display field(defined by key in net.h) and order */
--unsigned char fld_active[2*MAXFLD] = "LS NABWV";
-+unsigned char fld_active[2*MAXFLD] = "LSR NABWV";
- int           fld_index[256];
- char          available_options[MAXFLD];
+--- mtr-0.92/ui/mtr.c~	2017-08-13 10:34:14.000000000 +0200
++++ mtr-0.92/ui/mtr.c	2017-08-13 10:34:43.735191142 +0200
+@@ -715,7 +715,7 @@ int main(
+     ctl.probe_timeout = 10 * 1000000;
+     ctl.ipinfo_no = -1;
+     ctl.ipinfo_max = -1;
+-    xstrncpy(ctl.fld_active, "LS NABWV", 2 * MAXFLD);
++    xstrncpy(ctl.fld_active, "LSR NABWV", 2 * MAXFLD);
  
+     /*
+        mtr used to be suid root.  It should not be with this version.
diff --git a/mtr-mtr6.patch b/mtr-mtr6.patch
index 6515933..52393ef 100644
--- a/mtr-mtr6.patch
+++ b/mtr-mtr6.patch
@@ -1,12 +1,12 @@
---- mtr-0.69/mtr.c.orig	2005-01-11 09:33:41.000000000 +0100
-+++ mtr-0.69/mtr.c	2005-01-22 17:51:44.051315016 +0100
-@@ -360,6 +360,9 @@
+--- mtr-0.92/ui/mtr.c~	2017-06-02 10:54:58.000000000 +0200
++++ mtr-0.92/ui/mtr.c	2017-08-13 10:33:42.063498074 +0200
+@@ -741,6 +741,9 @@ int main(
  
-   parse_mtr_options (getenv ("MTR_OPTIONS"));
+     parse_mtr_options(&ctl, &names_head, getenv("MTR_OPTIONS"));
  
-+  if ((strlen(argv[0]) > 3) && !strcmp(argv[0] + strlen(argv[0]) - 4, "mtr6"))
-+    af = AF_INET6;
++    if ((strlen(argv[0]) > 3) && !strcmp(argv[0] + strlen(argv[0]) - 4, "mtr6"))
++        ctl.af = AF_INET6;
 +
-   parse_arg (argc, argv);
+     parse_arg(&ctl, &names_head, argc, argv);
  
-   if (PrintVersion) {
+     while (optind < argc) {
diff --git a/mtr-noraw.patch b/mtr-noraw.patch
deleted file mode 100644
index b5572a6..0000000
--- a/mtr-noraw.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-diff -ur mtr-0.74/net.c mtr-0.74.new/net.c
---- mtr-0.74/net.c	2008-08-19 18:55:48.000000000 +0200
-+++ mtr-0.74.new/net.c	2008-09-05 15:26:53.588144321 +0200
-@@ -305,7 +305,6 @@
- 
-   switch ( af ) {
-   case AF_INET:
--#if !defined(IP_HDRINCL) && defined(IP_TOS) && defined(IP_TTL)
-     iphsize = 0;
-     if ( setsockopt( sendsock, IPPROTO_IP, IP_TOS, &tos, sizeof tos ) ) {
-       perror( "setsockopt IP_TOS" );
-@@ -315,22 +314,6 @@
-       perror( "setsockopt IP_TTL" );
-       exit( EXIT_FAILURE );
-     }    
--#else
--    iphsize = sizeof (struct IPHeader);
--
--  ip->version = 0x45;
--  ip->tos = tos;
--  ip->len = BSDfix ? abs(packetsize): htons (abs(packetsize));
--  ip->id = 0;
--  ip->frag = 0;    /* 1, if want to find mtu size? Min */
--    ip->ttl = ttl;
--  ip->protocol = mtrtype;
--  ip->check = 0;
--
--  /* BSD needs the source address here, Linux & others do not... */
--    addrcpy( (void *) &(ip->saddr), (void *) &(ssa4->sin_addr), AF_INET );
--    addrcpy( (void *) &(ip->daddr), (void *) remoteaddress, AF_INET );
--#endif
-     echotype = ICMP_ECHO;
-     salen = sizeof (struct sockaddr_in);
-     break;
-@@ -900,12 +883,8 @@
- {
-   int trueopt = 1;
- 
--#if !defined(IP_HDRINCL) && defined(IP_TOS) && defined(IP_TTL)
-   sendsock4_icmp = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
-   sendsock4_udp = socket(AF_INET, SOCK_RAW, IPPROTO_UDP);
--#else
--  sendsock4 = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
--#endif
-   if (sendsock4 < 0) 
-     return -1;
- #ifdef ENABLE_IPV6
-@@ -913,15 +892,6 @@
-   sendsock6_udp = socket(AF_INET6, SOCK_RAW, IPPROTO_UDP);
- #endif
- 
--#ifdef IP_HDRINCL
--  /*  FreeBSD wants this to avoid sending out packets with protocol type RAW
--      to the network.  */
--  if (setsockopt(sendsock4, SOL_IP, IP_HDRINCL, &trueopt, sizeof(trueopt))) {
--    perror("setsockopt(IP_HDRINCL,1)");
--    return -1;
--  }
--#endif /* IP_HDRINCL */
--
-   recvsock4 = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
-   if (recvsock4 < 0)
-     return -1;
---- mtr/net.c~	2008-10-01 08:04:08.602202495 +0200
-+++ mtr/net.c	2008-10-01 08:12:30.956110370 +0200
-@@ -905,7 +905,6 @@
- 
- int net_selectsocket(void)
- {
--#if !defined(IP_HDRINCL) && defined(IP_TOS) && defined(IP_TTL)
-   switch ( mtrtype ) {
-   case IPPROTO_ICMP:
-     sendsock4 = sendsock4_icmp;
-@@ -914,7 +913,6 @@
-     sendsock4 = sendsock4_udp;
-     break;
-   }
--#endif
-   if (sendsock4 < 0)
-     return -1;
- #ifdef ENABLE_IPV6
diff --git a/mtr-nox.patch b/mtr-nox.patch
deleted file mode 100644
index 46ea370..0000000
--- a/mtr-nox.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- mtr-0.83/configure.ac.orig	2013-02-14 19:47:42.428664302 +0100
-+++ mtr-0.83/configure.ac	2013-02-14 20:45:17.061852659 +0100
-@@ -55,6 +55,8 @@
-                    AC_DEFINE(NO_GTK, 1, [Define if you don't have the GTK+ libraries available.])
-                            GTK_OBJ="")
- else
-+	AM_PATH_GLIB_2_0(2.6.0, [CFLAGS="$CFLAGS $GLIB_CFLAGS"
-+			   LIBS="$LIBS $GLIB_LIBS -lm"])
- 	AC_DEFINE(NO_GTK)
- 	GTK_OBJ=""
- fi
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/mtr.git/commitdiff/2f473df2d1afcea6d4b65f9a2d9a9e5f8d554801



More information about the pld-cvs-commit mailing list