Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New package: mtr, a network diagnostic tool #2527

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
44 changes: 44 additions & 0 deletions mtr/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Contributor: Fw[a]rd <howard.main[at]outlook[dot]com>

pkgname=mtr
pkgver=0.94
pkgrel=1
pkgdesc='Combines the functionality of traceroute and ping into one tool'
url='https://www.bitwizard.nl/mtr/'
arch=('any')
license=('GPL2')
makedepends=('ncurses-devel' 'jansson-devel')
source=(
https://www.bitwizard.nl/mtr/files/${pkgname}-${pkgver}.tar.gz
mtr-msys.patch
)
sha512sums=(
'c6e219c0eabf9a9977849c0bdc527df37af8188df690f1d9ad6a189cdb5292c4889a0a91c5703d958f279113e68741d7851a61a636f344d66f09e8040f078e9a'
'be717d2c89c3d7bf8b2161154d469e097ceaf9efd2b734963b3435568add32f015e0ee1f70b35474bcd89dcdd20ab8caf1c3b61383a2963c7a0256e3e8d18574'
)

prepare() {
(cd ${pkgbase}-${pkgver}
echo "${pkgver}" > .tarball-version
autoreconf -fiv
)
}

build() {
cd ${pkgbase}-${pkgver}
patch -p1 -i ${srcdir}/mtr-msys.patch
./configure \
--prefix=/usr \
--without-gtk \
--sbindir=/usr/bin
make
}

package() {
pkgdesc='Combines the functionality of traceroute and ping into one tool (CLI version)'
optdepends=('bash-completion: bash completion support')
cd ${pkgbase}-${pkgver}
make DESTDIR="${pkgdir}" install
}

# vim: ts=2 sw=2 et:
36 changes: 36 additions & 0 deletions mtr/mtr-msys.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
diff --color -uprN mtrnew/Makefile.am mtr-0.94/Makefile.am
--- mtrnew/Makefile.am 2020-07-10 12:31:11.000000000 +0800
+++ mtr-0.94/Makefile.am 2021-06-02 16:54:10.365561700 +0800
@@ -123,7 +123,7 @@ if CYGWIN
mtr_packet_SOURCES += \
packet/probe_cygwin.c packet/probe_cygwin.h \
packet/wait_cygwin.c
-mtr_packet_LDADD += -lcygwin -liphlpapi -lws2_32
+mtr_packet_LDADD += -lmsys-2.0 -liphlpapi -lws2_32

dist_windows_aux = \
$(srcdir)/build-aux/mtr.bat \
diff --color -uprN mtrnew/configure mtr-0.94/configure
--- mtrnew/configure 2020-09-24 18:32:12.000000000 +0800
+++ mtr-0.94/configure 2021-06-02 16:53:45.412294600 +0800
@@ -5455,7 +5455,7 @@ $as_echo "no" >&6; }
fi
fi

- if test "$host_os" = cygwin; then
+ if test "$host_os" = msys; then
CYGWIN_TRUE=
CYGWIN_FALSE='#'
else
diff --color -uprN mtrnew/packet/probe_cygwin.h mtr-0.94/packet/probe_cygwin.h
--- mtrnew/packet/probe_cygwin.h 2019-03-11 02:50:36.000000000 +0800
+++ mtr-0.94/packet/probe_cygwin.h 2021-06-02 16:53:13.258420100 +0800
@@ -19,6 +19,8 @@
#ifndef PROBE_CYGWIN_H
#define PROBE_CYGWIN_H

+typedef struct in6_addr IN6_ADDR, *PIN6_ADDR, *LPIN6_ADDR;
+
#include <arpa/inet.h>
#include <windows.h>
#include <iphlpapi.h>