From 4241da03f30d733c9ce2e89be34919b91a181e17 Mon Sep 17 00:00:00 2001 From: Subhaditya Nath Date: Thu, 28 Apr 2022 22:04:43 +0530 Subject: [PATCH] lsof: update to 4.95.0, fix man page, adopt Development has moved to a GitHub repo, so download release tarballs from there. --- srcpkgs/lsof/patches/Lsof.8.patch | 23 +++++++++++++++ srcpkgs/lsof/patches/fix-tests.patch | 16 +++++++++++ srcpkgs/lsof/template | 42 +++++++++++++++------------- 3 files changed, 61 insertions(+), 20 deletions(-) create mode 100644 srcpkgs/lsof/patches/Lsof.8.patch create mode 100644 srcpkgs/lsof/patches/fix-tests.patch diff --git a/srcpkgs/lsof/patches/Lsof.8.patch b/srcpkgs/lsof/patches/Lsof.8.patch new file mode 100644 index 000000000000..c5af8c718763 --- /dev/null +++ b/srcpkgs/lsof/patches/Lsof.8.patch @@ -0,0 +1,23 @@ +--- a/Lsof.8 ++++ b/Lsof.8 +@@ -1,7 +1,7 @@ + .so ./version + .TH LSOF 8 Revision-\*(VN +-\" Register )P is used neither by this file nor any groff macro. However, +-\" some versions of nroff require it. ++.\" Register )P is used neither by this file nor any groff macro. However, ++.\" some versions of nroff require it. + .if !\n(.g \{\ + . if !\n()P .nr )P 1v + .\} +@@ -967,8 +967,8 @@ where: + .br + applies to all IP versions. + .br +- \fIprotocol\fP is a protocol name \- \fBTCP\fP, \fBUDP\fP +-.br or \fBUDPLITE\fP. ++ \fIprotocol\fP is a protocol name \- \fBTCP\fP, \fBUDP\fP or \fBUDPLITE\fP. ++.br + .br + \fIhostname\fP is an Internet host name. Unless a + .br diff --git a/srcpkgs/lsof/patches/fix-tests.patch b/srcpkgs/lsof/patches/fix-tests.patch new file mode 100644 index 000000000000..bd9fa284d19a --- /dev/null +++ b/srcpkgs/lsof/patches/fix-tests.patch @@ -0,0 +1,16 @@ +This patch eliminates the need to modify /etc/hosts + +--- a/tests/LTsock.c ++++ b/tests/LTsock.c +@@ -255,10 +255,7 @@ main(argc, argv) + * Get the host name and its IP address. Convert the IP address to dotted + * ASCII form. + */ +- if (gethostname(hnm, sizeof(hnm) - 1)) { +- cem = "ERROR!!! can't get this host's name"; +- goto print_errno; +- } ++ strncpy(hnm, "localhost", sizeof(hnm) - 1); + hnm[sizeof(hnm) - 1] = '\0'; + if (!(hp = gethostbyname(hnm))) { + (void) snprintf(buf, bufl - 1, "ERROR!!! can't get IP address for %s", diff --git a/srcpkgs/lsof/template b/srcpkgs/lsof/template index 2c13c23beed4..f0e7c6230723 100644 --- a/srcpkgs/lsof/template +++ b/srcpkgs/lsof/template @@ -1,17 +1,29 @@ # Template file for 'lsof' pkgname=lsof -version=4.94.0 +version=4.95.0 revision=1 build_style=configure configure_script="./Configure" configure_args="-n linux" -hostmakedepends="perl which" +make_check_target="all" +make_check_args="-C tests" +hostmakedepends="perl which groff" short_desc="LiSt Open Files" -maintainer="Orphaned " +maintainer="Subhaditya Nath " license="custom:lsof" -homepage="https://people.freebsd.org/~abe/" -distfiles="https://fossies.org/linux/misc/lsof-${version}.tar.gz" -checksum=a9865eeb581c3abaac7426962ddb112ecfd86a5ae93086eb4581ce100f8fa8f4 +homepage="https://github.com/lsof-org/lsof" +changelog="https://raw.githubusercontent.com/lsof-org/lsof/master/00DIST" +distfiles="https://github.com/lsof-org/lsof/releases/download/${version}/lsof_${version}.linux.tar.bz2" +checksum=e9faa0fbcc48638c1d1f143e93573ac43b65e76646150f83e24bd8c18786303c + +post_extract() { + # See: https://github.com/lsof-org/lsof/issues/61 + # The TestDB was meant for storing known-good configurations, and + # skipping tests if the current system configuration exists in the + # TestDB. But we don't want that. + rm tests/CkTestDB + ln -s /bin/true tests/CkTestDB +} pre_configure() { export LSOF_CC="$CC" @@ -23,24 +35,14 @@ pre_configure() { -i dialects/linux/machine.h } -pre_check() { - # test resolves hostname - cp /etc/hosts ./hosts - printf '# +++ xbps-src +++ required for lsof tests\n127.0.0.100 %s\n' "$(hostname)" >> /etc/hosts - # write current config to test db - cd tests && ./Add2TestDB -} -do_check() { - make -C tests -} -post_check() { - # cleanup polluted hosts file - mv ./hosts /etc/hosts +post_build() { + # Remove when https://github.com/lsof-org/lsof/pull/67 is merged + soelim Lsof.8 >lsof.8 } do_install() { vbin lsof - vman Lsof.8 lsof.8 + vman lsof.8 # extract license from readme sed -n 00README -e '/^License/,/\*\/$/p' > License