summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Rees <maxcrees@me.com>2018-09-12 19:09:22 -0400
committerMax Rees <maxcrees@me.com>2018-09-12 20:35:19 -0400
commit027b6fd1887a746f3b38741a8baa63f2f73face1 (patch)
tree6ec08054b480ba9b24c01329566aee0e5c09d792
parent02a2bd307242bf8520133412db3fdcc8d1062943 (diff)
downloadpackages-027b6fd1887a746f3b38741a8baa63f2f73face1.tar.gz
packages-027b6fd1887a746f3b38741a8baa63f2f73face1.tar.bz2
packages-027b6fd1887a746f3b38741a8baa63f2f73face1.tar.xz
packages-027b6fd1887a746f3b38741a8baa63f2f73face1.zip
user/lsof: new package
-rw-r--r--user/lsof/APKBUILD63
-rw-r--r--user/lsof/test-disable-nfs-test.patch13
-rw-r--r--user/lsof/test-enable-suite.patch9
-rw-r--r--user/lsof/test-linux-sysmacros.patch15
-rw-r--r--user/lsof/utmps.patch15
5 files changed, 115 insertions, 0 deletions
diff --git a/user/lsof/APKBUILD b/user/lsof/APKBUILD
new file mode 100644
index 000000000..32fff3e16
--- /dev/null
+++ b/user/lsof/APKBUILD
@@ -0,0 +1,63 @@
+# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+# Maintainer: Max Rees <maxcrees@me.com>
+pkgname=lsof
+pkgver=4.91
+pkgrel=0
+pkgdesc="LiSt Open Files"
+url="https://people.freebsd.org/~abe"
+arch="all"
+license="zlib-acknowledgement"
+subpackages="$pkgname-doc"
+makedepends="linux-headers debianutils-which utmps-dev"
+source="ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/${pkgname}_${pkgver}.tar.gz
+ utmps.patch
+ test-enable-suite.patch
+ test-linux-sysmacros.patch
+ test-disable-nfs-test.patch"
+builddir="$srcdir/${pkgname}_${pkgver}"
+
+unpack() {
+ default_unpack
+ cd "$builddir"
+ tar xf "${pkgname}_${pkgver}_src.tar"
+}
+
+prepare() {
+ default_prepare
+ cd "$builddir/${pkgname}_${pkgver}_src"
+
+ sed -i "s|/\* #define\tHASSECURITY\t1 \*/|#define\tHASSECURITY\t1|" \
+ dialects/linux/machine.h
+ sed -n 6,30p lsof.h > COPYING
+}
+
+build () {
+ cd "$builddir/${pkgname}_${pkgver}_src"
+
+ ./Configure -n linux
+ make
+}
+
+check() {
+ cd "$builddir/${pkgname}_${pkgver}_src/tests"
+
+ # The LTsock test will fail if /etc/hosts is not set correctly.
+ # Make sure that 127.0.0.1 and ::1 have aliases corresponding to
+ # `hostname`.
+ printf "y" | make
+ make opt
+}
+
+package() {
+ cd "$builddir/${pkgname}_${pkgver}_src"
+
+ install -Dm755 lsof "$pkgdir/usr/bin/lsof"
+ install -Dm644 lsof.8 "$pkgdir/usr/share/man/man8/lsof.8"
+ install -Dm644 COPYING "$pkgdir/usr/share/licenses/lsof/COPYING"
+}
+
+sha512sums="95937afda1ba58e6636b2a2661d819480ec42b4beafc0e69e6132d7fdffd4e3974a95036a02c6fd8baf92089c73ac969cdc00a297bf0249257867d695bff2f94 lsof_4.91.tar.gz
+dfbfcfd41a4bccf3335ed01cc2dc9a11b6badd3149878d89ef5fed322a914d3d8341c68783140a4973d007907ce54b4438f011c26289df9e27d2d487a8f6b0b0 utmps.patch
+34d9573f90d942c717e3f3ff17283a66981c4a2e8e886746b591f980142d66115bc7afe6bdd0fc660ea6c1b42f591b161b9535e5849b8757e79546c197ccfdda test-linux-sysmacros.patch
+7f3e9b2850af54a5391db6a8f7eaa22329217fd559d3d41ee3bcd33b07b3526d17da75a542d28b013111bc5d5712a718e961aa4fe84ca3c5e73a97e0518ba2ec test-enable-suite.patch
+d299e2070415168f75a9ee6424e18c1496f6d1fd5430b13a92159422c9df58050ac63e22cebd13a5228207f5960cf2cde5830a46c9ec7a4c216f5e6fb71887f4 test-disable-nfs-test.patch"
diff --git a/user/lsof/test-disable-nfs-test.patch b/user/lsof/test-disable-nfs-test.patch
new file mode 100644
index 000000000..9ccb11cf9
--- /dev/null
+++ b/user/lsof/test-disable-nfs-test.patch
@@ -0,0 +1,13 @@
+LTnfs requires a NFS filesystem in order to run.
+
+--- lsof_4.91/lsof_4.91_src/tests/Makefile 2006-01-10 13:27:52.000000000 -0500
++++ lsof_4.91/lsof_4.91_src/tests/Makefile 2018-09-12 18:27:52.309560442 -0400
+@@ -19,7 +19,7 @@
+
+ BASTST= LTbasic
+ STDTST= LTnlink LTsock LTszoff LTunix
+-OPTTST= LTbigf LTdnlc LTlock LTnfs
++OPTTST= LTbigf LTdnlc LTlock
+
+ all: ${CKTSTDB} ${BASTST} ${STDTST} FRC
+ @./${CKTSTDB}; xv=$$?; \
diff --git a/user/lsof/test-enable-suite.patch b/user/lsof/test-enable-suite.patch
new file mode 100644
index 000000000..7601aa9c0
--- /dev/null
+++ b/user/lsof/test-enable-suite.patch
@@ -0,0 +1,9 @@
+--- lsof_4.91/lsof_4.91_src/tests/CkTestDB 2010-02-12 15:37:05.000000000 -0500
++++ lsof_4.91/lsof_4.91_src/tests/CkTestDB 2018-09-12 18:22:36.179562676 -0400
+@@ -67,6 +68,5 @@
+ echo ""
+- exit 1
+ fi
+
+ # Establish trap and stty handling.
+
diff --git a/user/lsof/test-linux-sysmacros.patch b/user/lsof/test-linux-sysmacros.patch
new file mode 100644
index 000000000..bc75a9f39
--- /dev/null
+++ b/user/lsof/test-linux-sysmacros.patch
@@ -0,0 +1,15 @@
+--- lsof_4.91/lsof_4.91_src/tests/LTlib.c 2017-09-10 19:05:11.000000000 -0400
++++ lsof_4.91/lsof_4.91_src/tests/LTlib.c 2018-09-12 18:05:26.719569950 -0400
+@@ -189,6 +189,12 @@
+ #endif /* defined(LT_DIAL_uw) */
+
+
++#if defined(__linux__)
++#undef _SYS_SYSMACROS_H
++#include <sys/sysmacros.h>
++#endif
++
++
+ /*
+ * Global variables
+ */
diff --git a/user/lsof/utmps.patch b/user/lsof/utmps.patch
new file mode 100644
index 000000000..91324e28e
--- /dev/null
+++ b/user/lsof/utmps.patch
@@ -0,0 +1,15 @@
+--- lsof_4.91/lsof_4.91_src/Configure 2018-02-14 09:18:55.000000000 -0500
++++ lsof_4.91/lsof_4.91_src/Configure 2018-09-12 17:48:25.269577168 -0400
+@@ -2943,6 +2943,12 @@
+ LSOF_CFGF="$LSOF_CFGF -DHASIPv6"
+ fi # }
+
++ if test -r ${LSOF_INCLUDE}/utmpx.h # {
++ then
++ LSOF_CFGF="$LSOF_CFGF -DHASUTMPX"
++ LSOF_CFGL="$LSOF_CFGL -lutmps -lskarnet"
++ fi # }
++
+ # Test for <rpc/rpc.h>.
+
+ if ! test -r ${LSOF_INCLUDE}/rpc/rpc.h # {