diff --git a/packages/tracepath/build.sh b/packages/tracepath/build.sh index e975db889..ebd84212e 100644 --- a/packages/tracepath/build.sh +++ b/packages/tracepath/build.sh @@ -1,11 +1,10 @@ TERMUX_PKG_HOMEPAGE=https://github.com/iputils/iputils TERMUX_PKG_DESCRIPTION="Tool to trace the network path to a remote host" TERMUX_PKG_LICENSE="GPL-2.0" -TERMUX_PKG_VERSION=20180629 -TERMUX_PKG_SHA256=da14105291dd491f28ea91ade854ed10aee8ba019641c80eed233de3908be7c5 +TERMUX_PKG_VERSION=20190324 +TERMUX_PKG_SHA256=b1d4b6e6dc7f011b1463722e6ac4c676d2e6146f49e784ac607fa3106fd277d3 TERMUX_PKG_SRCURL=https://github.com/iputils/iputils/archive/s${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_BUILD_IN_SRC=yes -TERMUX_PKG_DEPENDS="libidn" termux_step_configure() { return @@ -16,10 +15,21 @@ termux_step_make() { } termux_step_make_install() { - $CC $CFLAGS $LDFLAGS -lidn -o $TERMUX_PREFIX/bin/tracepath tracepath.c + CPPFLAGS+=" -DPACKAGE_VERSION=\"$TERMUX_PKG_VERSION\" -DHAVE_ERROR_H" + $CC $CFLAGS $CPPFLAGS $LDFLAGS -o $TERMUX_PREFIX/bin/tracepath iputils_common.c tracepath.c + local MANDIR=$TERMUX_PREFIX/share/man/man8 mkdir -p $MANDIR - cp $TERMUX_PKG_BUILDER_DIR/tracepath.8 $MANDIR/ + cd $TERMUX_PKG_SRCDIR/doc + xsltproc \ + --stringparam man.output.quietly 1 \ + --stringparam funcsynopsis.style ansi \ + --stringparam man.th.extra1.suppress 1 \ + --stringparam iputils.version $TERMUX_PKG_VERSION \ + custom-man.xsl \ + tracepath.xml + cp tracepath.8 $MANDIR/ + # Setup traceroute as an alias for tracepath, since traceroute # requires root which most Termux user does not have, and tracepath # is probably good enough for most: diff --git a/packages/tracepath/tracepath.8 b/packages/tracepath/tracepath.8 deleted file mode 100644 index b7e8e1467..000000000 --- a/packages/tracepath/tracepath.8 +++ /dev/null @@ -1,104 +0,0 @@ -.\" This manpage has been automatically generated by docbook2man -.\" from a DocBook document. This tool can be found at: -.\" -.\" Please send any bug reports, improvements, comments, patches, -.\" etc. to Steve Cheng . -.TH "TRACEPATH" "8" "07 May 2014" "iputils-121221" "System Manager's Manual: iputils" -.SH NAME -tracepath, tracepath6 \- traces path to a network host discovering MTU along this path -.SH SYNOPSIS - -\fBtracepath\fR [\fB-n\fR] [\fB-b\fR] [\fB-l \fIpktlen\fB\fR] [\fB-m \fImax_hops\fB\fR] [\fB-p \fIport\fB\fR] \fB\fIdestination\fB\fR - -.SH "DESCRIPTION" -.PP -It traces path to \fIdestination\fR discovering MTU along this path. -It uses UDP port \fIport\fR or some random port. -It is similar to \fBtraceroute\fR, only does not require superuser -privileges and has no fancy options. -.PP -\fBtracepath6\fR is good replacement for \fBtraceroute6\fR -and classic example of application of Linux error queues. -The situation with IPv4 is worse, because commercial -IP routers do not return enough information in ICMP error messages. -Probably, it will change, when they will be updated. -For now it uses Van Jacobson's trick, sweeping a range -of UDP ports to maintain trace history. -.SH "OPTIONS" -.TP -\fB-n\fR -Print primarily IP addresses numerically. -.TP -\fB-b\fR -Print both of host names and IP addresses. -.TP -\fB-l\fR -Sets the initial packet length to \fIpktlen\fR instead of -65535 for \fBtracepath\fR or 128000 for \fBtracepath6\fR. -.TP -\fB-m/term> \fR -Set maximum hops (or maximum TTLs) to \fImax_hops\fR -instead of 30. -.TP -\fB-p\fR -Sets the initial destination port to use. -.SH "OUTPUT" -.PP - -.nf -root@mops:~ # tracepath6 3ffe:2400:0:109::2 - 1?: [LOCALHOST] pmtu 1500 - 1: dust.inr.ac.ru 0.411ms - 2: dust.inr.ac.ru asymm 1 0.390ms pmtu 1480 - 2: 3ffe:2400:0:109::2 463.514ms reached - Resume: pmtu 1480 hops 2 back 2 -.fi -.PP -The first column shows TTL of the probe, followed by colon. -Usually value of TTL is obtained from reply from network, -but sometimes reply does not contain necessary information and -we have to guess it. In this case the number is followed by ?. -.PP -The second column shows the network hop, which replied to the probe. -It is either address of router or word [LOCALHOST], if -the probe was not sent to the network. -.PP -The rest of line shows miscellaneous information about path to -the correspinding network hop. As rule it contains value of RTT. -Additionally, it can show Path MTU, when it changes. -If the path is asymmetric -or the probe finishes before it reach prescribed hop, difference -between number of hops in forward and backward direction is shown -following keyword async. This information is not reliable. -F.e. the third line shows asymmetry of 1, it is because the first probe -with TTL of 2 was rejected at the first hop due to Path MTU Discovery. -.PP -The last line summarizes information about all the path to the destination, -it shows detected Path MTU, amount of hops to the destination and our -guess about amount of hops from the destination to us, which can be -different when the path is asymmetric. -.SH "SEE ALSO" -.PP -\fBtraceroute\fR(8), -\fBtraceroute6\fR(8), -\fBping\fR(8). -.SH "AUTHOR" -.PP -\fBtracepath\fR was written by -Alexey Kuznetsov -. -.SH "SECURITY" -.PP -No security issues. -.PP -This lapidary deserves to be elaborated. -\fBtracepath\fR is not a privileged program, unlike -\fBtraceroute\fR, \fBping\fR and other beasts of this kind. -\fBtracepath\fR may be executed by everyone who has some access -to network, enough to send UDP datagrams to investigated destination -using given port. -.SH "AVAILABILITY" -.PP -\fBtracepath\fR is part of \fIiputils\fR package -and the latest versions are available in source form at -http://www.skbuff.net/iputils/iputils-current.tar.bz2. diff --git a/packages/tracepath/tracepath.c.patch b/packages/tracepath/tracepath.c.patch new file mode 100644 index 000000000..c10a0bf6f --- /dev/null +++ b/packages/tracepath/tracepath.c.patch @@ -0,0 +1,20 @@ +diff -u -r ../iputils-s20190324/tracepath.c ./tracepath.c +--- ../iputils-s20190324/tracepath.c 2019-03-24 14:28:37.000000000 +0000 ++++ ./tracepath.c 2019-05-07 21:16:42.402068980 +0000 +@@ -12,6 +12,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -52,6 +53,8 @@ + # define IPV6_PMTUDISC_DO 3 + #endif + ++#define IPUTILS_VERSION(_prog) "%s from iputils %s\n", _prog, PACKAGE_VERSION ++ + enum { + MAX_PROBES = 10, +