summaryrefslogtreecommitdiff
path: root/utils/lsof
diff options
context:
space:
mode:
authorMaxim Storchak <m.storchak@gmail.com>2014-06-14 08:38:13 +0300
committerMaxim Storchak <m.storchak@gmail.com>2014-06-14 08:38:13 +0300
commitdd1858d7f3dcac1a873fe80298c98b67719e7e72 (patch)
tree20820d7edc8b4c5eba54c7e7d18e361ebd1cec3d /utils/lsof
parent13d6e6f3b40fa7b20108f9f36c7760f1780886b8 (diff)
lsof: import from packages
Signed-off-by: Maxim Storchak <m.storchak@gmail.com>
Diffstat (limited to 'utils/lsof')
-rw-r--r--utils/lsof/Makefile55
-rw-r--r--utils/lsof/patches/001-lsof_makefile.patch13
-rw-r--r--utils/lsof/patches/002-lsof_noportmap.patch18
-rw-r--r--utils/lsof/patches/003-lsof_selinux.patch11
-rw-r--r--utils/lsof/patches/004-lsof_ccv.patch12
5 files changed, 109 insertions, 0 deletions
diff --git a/utils/lsof/Makefile b/utils/lsof/Makefile
new file mode 100644
index 000000000..f609f64e7
--- /dev/null
+++ b/utils/lsof/Makefile
@@ -0,0 +1,55 @@
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+PKG_NAME:=lsof
+PKG_VERSION:=4.86
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION)+dfsg.orig.tar.gz
+PKG_SOURCE_URL:=http://ftp2.de.debian.org/debian/pool/main/l/lsof
+PKG_MD5SUM:=23420509564a897b76055f9d84d19068
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)+dfsg.orig
+PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+
+TARGET_LDFLAGS += $(LIBRPC)
+
+define Package/lsof
+ SECTION:=utils
+ CATEGORY:=Utilities
+ DEPENDS:=$(LIBRPC_DEPENDS)
+ TITLE:=LiSt Open Files - a diagnostic tool
+ URL:=http://people.freebsd.org/~abe/
+endef
+
+define Build/Configure
+ cd $(PKG_BUILD_DIR); \
+ LINUX_CLIB="-DGLIBCV=2" \
+ LSOF_CC="$(TARGET_CC)" \
+ LSOF_INCLUDE="-I$(STAGING_DIR)/usr/include" \
+ LSOF_VSTR="$(LINUX_VERSION)" \
+ LSOF_CFGF="$(TARGET_CFLAGS)" \
+ LSOF_CFGL="$(TARGET_LDFLAGS)" \
+ LSOF_AR="$(TARGET_CROSS)ar cr" \
+ LSOF_RANLIB="$(TARGET_CROSS)ranlib" \
+ ./Configure -n linux
+endef
+
+define Build/Compile
+ $(MAKE) -C $(PKG_BUILD_DIR)
+endef
+
+define Package/lsof/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/lsof $(1)/usr/bin
+endef
+
+$(eval $(call BuildPackage,lsof))
diff --git a/utils/lsof/patches/001-lsof_makefile.patch b/utils/lsof/patches/001-lsof_makefile.patch
new file mode 100644
index 000000000..eb2b73519
--- /dev/null
+++ b/utils/lsof/patches/001-lsof_makefile.patch
@@ -0,0 +1,13 @@
+--- a/lib/Makefile.skel
++++ b/lib/Makefile.skel
+@@ -21,8 +21,8 @@ OBJ= ckkv.o cvfs.o dvch.o fino.o isfn.o
+ all: ${LIB}
+
+ ${LIB}: ${OBJ}
+- ${AR}
+- ${RANLIB}
++ ${AR} ${LIB} ${OBJ}
++ ${RANLIB} ${LIB}
+
+ clean: FRC
+ rm -f ${LIB} ${OBJ} errs Makefile.bak a.out core
diff --git a/utils/lsof/patches/002-lsof_noportmap.patch b/utils/lsof/patches/002-lsof_noportmap.patch
new file mode 100644
index 000000000..d0e88893c
--- /dev/null
+++ b/utils/lsof/patches/002-lsof_noportmap.patch
@@ -0,0 +1,18 @@
+--- a/print.c
++++ b/print.c
+@@ -161,6 +161,7 @@ endnm(sz)
+ static void
+ fill_portmap()
+ {
++#if !defined __UCLIBC__ || (defined __UCLIBC__ && defined __UCLIBC_HAS_RPC__)
+ char buf[128], *cp, *nm;
+ CLIENT *c;
+ int h, port, pr;
+@@ -279,6 +280,7 @@ fill_portmap()
+ Pth[pr][h] = pt;
+ }
+ clnt_destroy(c);
++#endif
+ }
+ #endif /* !defined(HASNORPC_H) */
+
diff --git a/utils/lsof/patches/003-lsof_selinux.patch b/utils/lsof/patches/003-lsof_selinux.patch
new file mode 100644
index 000000000..c74c1e3f9
--- /dev/null
+++ b/utils/lsof/patches/003-lsof_selinux.patch
@@ -0,0 +1,11 @@
+--- a/Configure
++++ b/Configure
+@@ -2806,7 +2806,7 @@ return(0); }
+ LSOF_TMP1=1
+ fi # }
+ fi # }
+- if test $LSOF_TMP1 -eq 1 # {
++ if test 0 -eq 1 # {
+ then
+ LSOF_CFGF="$LSOF_CFGF -DHASSELINUX"
+ LSOF_CFGL="$LSOF_CFGL -lselinux"
diff --git a/utils/lsof/patches/004-lsof_ccv.patch b/utils/lsof/patches/004-lsof_ccv.patch
new file mode 100644
index 000000000..8f1867dc0
--- /dev/null
+++ b/utils/lsof/patches/004-lsof_ccv.patch
@@ -0,0 +1,12 @@
+--- a/Configure
++++ b/Configure
+@@ -2682,6 +2682,9 @@ LOCKF_OWNER4
+ if test "X$LSOF_CC" = "X" # {
+ then
+ LSOF_CC=cc
++ fi # }
++ if test "X$LSOF_CCV" = "X" # {
++ then
+ LSOF_CCV=`$LSOF_CC -v 2>&1 | sed -n 's/.*version \(.*\)/\1/p'`
+ fi # }
+ if test "X$LINUX_CONF_CC" = "X" # {