From: Florian Fainelli Date: Tue, 10 Apr 2007 10:20:35 +0000 (+0000) Subject: Add lsof, thanks h3sp4wn (#1548) X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=commitdiff_plain;h=6cdb113271d81de7912326f460340193481649e7 Add lsof, thanks h3sp4wn (#1548) SVN-Revision: 6917 --- diff --git a/utils/lsof/Makefile b/utils/lsof/Makefile new file mode 100644 index 0000000000..0525734928 --- /dev/null +++ b/utils/lsof/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2007 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# $Id: $ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=lsof +PKG_VERSION:=4.77 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).dfsg.1.orig.tar.gz +PKG_SOURCE_URL:=http://ftp2.de.debian.org/debian/pool/main/l/lsof +PKG_MD5SUM:=6751a1cbdefb751b7cb2e22e6e5bdacb +PKG_CAT:=zcat + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION).dfsg.1.orig + +include $(INCLUDE_DIR)/package.mk + +define Package/lsof + SECTION:=utils + CATEGORY:=Utilities + TITLE:=LiSt Open Files - a diagnostic tool + URL:=http://www.akadia.com/services/lsof_intro.html +endef + +define Build/Configure + cd $(PKG_BUILD_DIR); \ + ./Configure -n linux +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC=$(TARGET_CC) \ + CFLAGS="$(TARGET_CFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" +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 0000000000..acd636a6ff --- /dev/null +++ b/utils/lsof/patches/001-lsof_makefile.patch @@ -0,0 +1,14 @@ +diff -ru lsof_4.77.orig/lsof_4.77_src/lib/Makefile.skel lsof_4.77/lsof_4.77_src/lib/Makefile.skel +--- lsof_4.77.orig/lib/Makefile.skel 2001-02-13 03:12:22.000000000 +0100 ++++ lsof_4.77/lib/Makefile.skel 2006-11-29 13:51:44.000000000 +0100 +@@ -21,8 +21,8 @@ + 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 0000000000..5f0c17ebdb --- /dev/null +++ b/utils/lsof/patches/002-lsof_noportmap.patch @@ -0,0 +1,18 @@ +--- lsof_4.77/print.orig.c 2006-08-23 13:37:43.000000000 -0600 ++++ lsof_4.77/print.c 2006-08-23 13:38:29.000000000 -0600 +@@ -148,6 +148,7 @@ + static void + fill_portmap() + { ++#if !defined __UCLIBC__ || (defined __UCLIBC__ && defined __UCLIBC_HAS_RPC__) + char buf[128], *cp, *nm; + CLIENT *c; + int h, port, pr; +@@ -266,6 +267,7 @@ + Pth[pr][h] = pt; + } + clnt_destroy(c); ++#endif + } + + diff --git a/utils/lsof/patches/003-lsof_uclibc.patch b/utils/lsof/patches/003-lsof_uclibc.patch new file mode 100644 index 0000000000..e53e37bbc0 --- /dev/null +++ b/utils/lsof/patches/003-lsof_uclibc.patch @@ -0,0 +1,12 @@ +diff -ru lsof_4.77.orig/lsof_4.77_src/dialects/linux/dlsof.h lsof_4.77/lsof_4.77_src/dialects/linux/dlsof.h +--- lsof_4.77.orig/dialects/linux/dlsof.h 2006-03-28 00:57:14.000000000 +0200 ++++ lsof_4.77/dialects/linux/dlsof.h 2006-11-29 14:03:07.000000000 +0100 +@@ -49,7 +49,7 @@ + #include + #include + +-# if defined(GLIBCV) ++# if defined(GLIBCV) || defined __UCLIBC__ + #include + # else /* !defined(GLIBCV) */ + #include