summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--user/iputils/APKBUILD55
-rw-r--r--user/iputils/fix-idn.patch14
-rw-r--r--user/iputils/fix-init-of-cmsg.patch20
-rw-r--r--user/iputils/time.patch10
4 files changed, 99 insertions, 0 deletions
diff --git a/user/iputils/APKBUILD b/user/iputils/APKBUILD
new file mode 100644
index 000000000..bcfa64715
--- /dev/null
+++ b/user/iputils/APKBUILD
@@ -0,0 +1,55 @@
+# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+# Maintainer: Dan Theisen <djt@hxx.in>
+pkgname=iputils
+pkgver=20180629
+pkgrel=0
+pkgdesc="IP Configuration Utilities (and Ping)"
+url="https://github.com/iputils/iputils/"
+arch="all"
+license="BSD-3-Clause AND GPL-2.0-or-later"
+makedepends="libcap-dev openssl-dev"
+replaces="bbsuid"
+subpackages="$pkgname-doc"
+source="$pkgname-$pkgver.tgz::https://github.com/$pkgname/$pkgname/archive/s$pkgver.tar.gz
+ time.patch
+ fix-init-of-cmsg.patch
+ fix-idn.patch
+ "
+options="!check suid" # there is no testsuite for these applications
+builddir="$srcdir/$pkgname-s$pkgver"
+
+build() {
+ cd "$builddir"
+ # we're waiting for idn support in musl so that we can enable it here
+ # https://wiki.musl-libc.org/functional-differences-from-glibc.html#Name-Resolver/DNS
+ make all ninfod USE_IDN=no USE_NETTLE=no KERNEL_INCLUDE=/usr/include
+ make man
+}
+
+package() {
+ local name
+ cd "$builddir"
+
+ for name in arping clockdiff ipg rarpd rdisc tftpd tracepath; do
+ install -D -m755 $name "$pkgdir"/usr/sbin/$name
+ done
+ install -D -m755 ninfod/ninfod "$pkgdir"/usr/sbin/ninfod
+
+ for name in ping traceroute6; do
+ install -D -m4755 $name "$pkgdir"/bin/$name
+ done
+
+ mkdir -p "$pkgdir"/usr/share/man/man8
+ for doc in ./doc/*.8; do
+ gzip $doc
+ install -m644 "$doc".gz "$pkgdir"/usr/share/man/man8/
+ done
+
+ ln -s tracepath "$pkgdir"/usr/sbin/tracepath6
+ ln -s ping "$pkgdir"/bin/ping6
+}
+
+sha512sums="16b8f5ad1cf88083ebaee0a71fddb14bb0a904336fd0baebfcca86c27ac0773553b21d12790b05cab7661d6432c75bbb1523e871e5e1b77faacd13ccc84f4476 iputils-20180629.tgz
+530532d16574921d0789af6a82706915e8103e712195c4f2eb6379192cc7126ba6bc9f33e8454118628d59f8932ffd2bb5aaba3b61fa93df83088e3b0d93d227 time.patch
+2779b9d987089a2a9a39c27a092f16da85881e9dfbc99edcca6baea42912b8a1a7e16b00c19684d2ea1a6123d66f78be12bef43398e63be7d7c97d3d6269a5bf fix-init-of-cmsg.patch
+b3a5e5ef9ed1ed12a137f176db6a444f15db67dfaef3706514bc4d0cd2a332fb8aeeae0460fca8a1dfef2e0ce2ae0cf2218a74e3f61c46fcb27715a030425ac0 fix-idn.patch"
diff --git a/user/iputils/fix-idn.patch b/user/iputils/fix-idn.patch
new file mode 100644
index 000000000..4aaae8e82
--- /dev/null
+++ b/user/iputils/fix-idn.patch
@@ -0,0 +1,14 @@
+--- iputils-s20180629/ping.c.orig 2018-06-29 11:00:46.000000000 -0700
++++ iputils-s20180629/ping.c 2018-07-06 01:09:10.479830175 -0700
+@@ -207,9 +210,10 @@
+
+ #ifdef USE_IDN
+ setlocale(LC_ALL, "");
+-#endif
++
+ if (!strcmp(setlocale(LC_ALL, NULL), "C"))
+ hints.ai_flags &= ~ AI_CANONIDN;
++#endif
+
+ /* Support being called using `ping4` or `ping6` symlinks */
+ if (argv[0][strlen(argv[0])-1] == '4')
diff --git a/user/iputils/fix-init-of-cmsg.patch b/user/iputils/fix-init-of-cmsg.patch
new file mode 100644
index 000000000..76ebc16c2
--- /dev/null
+++ b/user/iputils/fix-init-of-cmsg.patch
@@ -0,0 +1,20 @@
+Fixes ping on s390x.
+
+diff --git a/ping.c b/ping.c
+index a0857a1..329553d 100644
+--- a/ping.c
++++ b/ping.c
+@@ -108,8 +108,11 @@ static int parsetos(char *str);
+ static struct {
+ struct cmsghdr cm;
+ struct in_pktinfo ipi;
+-} cmsg = { {sizeof(struct cmsghdr) + sizeof(struct in_pktinfo), SOL_IP, IP_PKTINFO},
+- {0, }};
++} cmsg = { .cm = {
++ .cmsg_len = sizeof(struct cmsghdr) + sizeof(struct in_pktinfo),
++ .cmsg_level = SOL_IP,
++ .cmsg_type = IP_PKTINFO},
++ .ipi = {0, }};
+ int cmsg_len;
+
+ struct sockaddr_in source;
diff --git a/user/iputils/time.patch b/user/iputils/time.patch
new file mode 100644
index 000000000..1d6033f7a
--- /dev/null
+++ b/user/iputils/time.patch
@@ -0,0 +1,10 @@
+--- ./tracepath.c.orig
++++ ./tracepath.c
+@@ -12,6 +12,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#include <time.h>
+ #include <sys/socket.h>
+ #include <linux/types.h>
+ #include <linux/errqueue.h>