From 4c879ad274f3de8ee836b91ac04d6fa233df822d 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 manpage --- srcpkgs/lsof/patches/Lsof.8.patch | 25 ++++++++++++++++ srcpkgs/lsof/template | 49 ++++++++++++++++++++++++------- 2 files changed, 64 insertions(+), 10 deletions(-) create mode 100644 srcpkgs/lsof/patches/Lsof.8.patch diff --git a/srcpkgs/lsof/patches/Lsof.8.patch b/srcpkgs/lsof/patches/Lsof.8.patch new file mode 100644 index 000000000000..463f21168947 --- /dev/null +++ b/srcpkgs/lsof/patches/Lsof.8.patch @@ -0,0 +1,25 @@ +diff --git a/Lsof.8.orig b/Lsof.8 +index 76bf0fa3..e82e837b 100644 +--- a/Lsof.8.orig ++++ 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/template b/srcpkgs/lsof/template index 2c13c23beed4..42445ce74c77 100644 --- a/srcpkgs/lsof/template +++ b/srcpkgs/lsof/template @@ -1,6 +1,6 @@ # Template file for 'lsof' pkgname=lsof -version=4.94.0 +version=4.95.0 revision=1 build_style=configure configure_script="./Configure" @@ -9,9 +9,9 @@ hostmakedepends="perl which" short_desc="LiSt Open Files" maintainer="Orphaned " 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" +distfiles="https://github.com/lsof-org/lsof/archive/${version}.tar.gz" +checksum=8ff4c77736cc7d9556da9e2c7614cc4292a12f1979f20bd520d3c6f64b66a4d7 pre_configure() { export LSOF_CC="$CC" @@ -19,28 +19,57 @@ pre_configure() { export LSOF_CFGL="$LDFLAGS" export LSOF_INCLUDE="${XBPS_CROSS_BASE}/usr/include" - vsed "s|/\* #define\tHASSECURITY\t1 \*/|#define\tHASSECURITY\t1|" \ + vsed -e "s|/\* \(#define\tHASSECURITY\t1\) \*/|\1|" \ -i dialects/linux/machine.h } pre_check() { # test resolves hostname - cp /etc/hosts ./hosts + cp /etc/hosts ./hosts.bak 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 + cd tests + make + if [ "$XBPS_CHECK_PKGS" = full ]; then + make opt # optional tests + fi } + post_check() { - # cleanup polluted hosts file - mv ./hosts /etc/hosts + if [ "$XBPS_BUILD_ENVIRONMENT" = "void-packages-ci" ]; then + # Don't do anything, as trying to mv hosts.bak to /etc/hosts + # results in EBUSY return code on GitHub Actions, making the + # tests seem like they're failing. + : + else + # cleanup polluted hosts file + mv ./hosts.bak /etc/hosts + fi +} + +post_build() { + { # .so only works if the file being included exists in the + # current directory or a subdirectory of it. So, we should + # include the files directly into the manpage instead of + # referencing them using .so + while read -r LINE; do + if [ "$LINE" != ".so${LINE#.so}" ]; then + printf '%s\n' "$LINE" # echo causes problems + continue + fi + LINE="${LINE#.so}" + cat "${LINE## }" + done + } 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