From eabf8eac18058dfb362f24b562a3a031ab12b506 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 | 28 ++++++++++++++++++++++------ 2 files changed, 47 insertions(+), 6 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..5ba8662c56d5 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,7 +19,7 @@ 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 } @@ -38,9 +38,25 @@ post_check() { mv ./hosts /etc/hosts } +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