arpwatch: 3.3 -> 3.4

This commit is contained in:
Tim Biermann 2023-09-07 17:07:06 +02:00
parent ca5ab076f1
commit 0cb7c1e9bf
Signed by: tb
GPG Key ID: 42F8B4E30B673606
4 changed files with 74 additions and 10 deletions

View File

@ -1,5 +1,7 @@
untrusted comment: verify with /etc/ports/contrib.pub
RWSagIOpLGJF35F6TjJxq3K+xIOWyWXB+R5zqBRfnPVfjEYOw3hQzWII4cfdRWzcG9fTrEXMrRbYAVrlJMs7dgLBDsaxB3OK2Qc=
SHA256 (Pkgfile) = 33eb757772b32a7b7753787a9056cb49b9d9882f26ba966ca4bb9dba2a301580
RWSagIOpLGJF3w7jxX0yUMWgzH2DrscEkT2uQ1lgk5PlEEulMK9+OmTbAzjRKrcjg9tkF8RlueoUmB3kG3wMdpyGr1ZznL3BhQc=
SHA256 (Pkgfile) = 90e551f3b74634613d40efc98dfbfdba37f6ab627cfe6554c70cd84906ca5d19
SHA256 (.footprint) = ad0ee37d616ac6cdc37c8781ffd29e63d63268372e6130eca5b9bb107b79d1b7
SHA256 (arpwatch-3.3.tar.gz) = d47fa8b291fc37a25a2d0f3e1b64f451dc0be82d714a10ffa6ef8b0b9e33e166
SHA256 (arpwatch-3.4.tar.gz) = 494cc93c2dc3c6effa4923420c8fa0558ce3575f9413e03063c68968b95bebf7
SHA256 (53_stop-using-_getshort.patch) = fd94075aeade77a84ef4233fc565dee6d28d0143fbf1ff54ee412737b9c920ba
SHA256 (fix-time-h.patch) = f9a61ab3c3bcaf4ff1409e6f0d2892f23349f59084d5dc044608dc54d5e5dd04

View File

@ -0,0 +1,25 @@
Description: replace private function _getshort with ns_get16
_getshort is a private function, triggers a build log warning because it's
not present in any header file. We switch to the functionally equivalent
ns_get16.
Author: Lukas Schwaighofer <lukas@schwaighofer.name>
---
dns.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/dns.c
+++ b/dns.c
@@ -115,10 +115,10 @@
(u_char *)cp, (char *)bp, buflen)) < 0)
break;
cp += n;
- type = _getshort(cp);
+ type = ns_get16(cp);
cp += sizeof(u_short); /* class */
cp += sizeof(u_short) + sizeof(u_int32_t);
- n = _getshort(cp);
+ n = ns_get16(cp);
cp += sizeof(u_short);
if (type == T_HINFO) {
/* Unpack */

View File

@ -4,18 +4,21 @@
# Depends on: libpcap
name=arpwatch
version=3.3
version=3.4
release=1
source=(https://ee.lbl.gov/downloads/$name/$name-$version.tar.gz)
source=(https://ee.lbl.gov/downloads/$name/$name-$version.tar.gz
53_stop-using-_getshort.patch
fix-time-h.patch)
build() {
cd $name-$version
# https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/arpwatch
sed -i 's|ARPDIR = $(prefix)/arpwatch|ARPDIR = /var/lib/arpwatch|' Makefile.in
sed -i 's/-\(o\|g\) bin/-\1 root/g' Makefile.in
patch -Np1 -i $SRC/53_stop-using-_getshort.patch
patch -Np1 -i $SRC/fix-time-h.patch
./configure --prefix=/usr \
PYTHON=/usr/bin/python3 \
./configure \
--prefix=/usr \
--sbindir=/usr/bin \
--mandir=/usr/share/man
@ -23,5 +26,6 @@ build() {
make SENDMAIL=/usr/bin/sendmail
make DESTDIR=$PKG install
rm -r $PKG/usr/etc
rm -rf $PKG/usr/etc
}

33
arpwatch/fix-time-h.patch Normal file
View File

@ -0,0 +1,33 @@
diff --git a/report.c b/report.c
index 9c77755..a4f0db1 100644
--- a/report.c
+++ b/report.c
@@ -37,7 +37,6 @@ static const char rcsid[] __attribute__((unused)) =
#include <sys/param.h>
#include <sys/types.h> /* concession to AIX */
#include <sys/socket.h>
-#include <sys/time.h>
#include <sys/wait.h>
#if __STDC__
@@ -59,9 +58,18 @@ struct rtentry;
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
-#ifdef TIME_WITH_SYS_TIME
-#include <time.h>
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
#endif
+
#include <unistd.h>
#include "gnuc.h"