Bläddra i källkod

lsof: import from packages

Signed-off-by: Maxim Storchak <m.storchak@gmail.com>
Maxim Storchak 10 år sedan
förälder
incheckning
dd1858d7f3

+ 55
- 0
utils/lsof/Makefile Visa fil

@@ -0,0 +1,55 @@
1
+#
2
+# Copyright (C) 2007-2014 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+include $(INCLUDE_DIR)/kernel.mk
10
+
11
+PKG_NAME:=lsof
12
+PKG_VERSION:=4.86
13
+PKG_RELEASE:=2
14
+
15
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION)+dfsg.orig.tar.gz
16
+PKG_SOURCE_URL:=http://ftp2.de.debian.org/debian/pool/main/l/lsof
17
+PKG_MD5SUM:=23420509564a897b76055f9d84d19068
18
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)+dfsg.orig
19
+PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
20
+
21
+include $(INCLUDE_DIR)/package.mk
22
+
23
+TARGET_LDFLAGS += $(LIBRPC)
24
+
25
+define Package/lsof
26
+  SECTION:=utils
27
+  CATEGORY:=Utilities
28
+  DEPENDS:=$(LIBRPC_DEPENDS)
29
+  TITLE:=LiSt Open Files - a diagnostic tool
30
+  URL:=http://people.freebsd.org/~abe/
31
+endef
32
+
33
+define Build/Configure
34
+	cd $(PKG_BUILD_DIR); \
35
+		LINUX_CLIB="-DGLIBCV=2" \
36
+		LSOF_CC="$(TARGET_CC)" \
37
+		LSOF_INCLUDE="-I$(STAGING_DIR)/usr/include" \
38
+		LSOF_VSTR="$(LINUX_VERSION)" \
39
+		LSOF_CFGF="$(TARGET_CFLAGS)" \
40
+		LSOF_CFGL="$(TARGET_LDFLAGS)" \
41
+		LSOF_AR="$(TARGET_CROSS)ar cr" \
42
+		LSOF_RANLIB="$(TARGET_CROSS)ranlib" \
43
+		./Configure -n linux
44
+endef
45
+
46
+define Build/Compile	
47
+	$(MAKE) -C $(PKG_BUILD_DIR)
48
+endef
49
+
50
+define Package/lsof/install	
51
+	$(INSTALL_DIR) $(1)/usr/bin
52
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/lsof $(1)/usr/bin
53
+endef
54
+
55
+$(eval $(call BuildPackage,lsof))

+ 13
- 0
utils/lsof/patches/001-lsof_makefile.patch Visa fil

@@ -0,0 +1,13 @@
1
+--- a/lib/Makefile.skel
2
++++ b/lib/Makefile.skel
3
+@@ -21,8 +21,8 @@ OBJ=	ckkv.o cvfs.o dvch.o fino.o isfn.o
4
+ all:	${LIB}
5
+ 
6
+ ${LIB}:	${OBJ}
7
+-	${AR}
8
+-	${RANLIB}
9
++	${AR} ${LIB} ${OBJ}
10
++	${RANLIB} ${LIB}
11
+ 
12
+ clean:	FRC
13
+ 	rm -f ${LIB} ${OBJ} errs Makefile.bak a.out core

+ 18
- 0
utils/lsof/patches/002-lsof_noportmap.patch Visa fil

@@ -0,0 +1,18 @@
1
+--- a/print.c
2
++++ b/print.c
3
+@@ -161,6 +161,7 @@ endnm(sz)
4
+ static void
5
+ fill_portmap()
6
+ {
7
++#if !defined __UCLIBC__ || (defined __UCLIBC__ && defined __UCLIBC_HAS_RPC__)
8
+ 	char buf[128], *cp, *nm;
9
+ 	CLIENT *c;
10
+ 	int h, port, pr;
11
+@@ -279,6 +280,7 @@ fill_portmap()
12
+ 	    Pth[pr][h] = pt;
13
+ 	}
14
+ 	clnt_destroy(c);
15
++#endif
16
+ }
17
+ #endif	/* !defined(HASNORPC_H) */
18
+ 

+ 11
- 0
utils/lsof/patches/003-lsof_selinux.patch Visa fil

@@ -0,0 +1,11 @@
1
+--- a/Configure
2
++++ b/Configure
3
+@@ -2806,7 +2806,7 @@ return(0); }
4
+ 	LSOF_TMP1=1
5
+       fi	# }
6
+     fi	# }
7
+-    if test $LSOF_TMP1 -eq 1	# {
8
++    if test 0 -eq 1	# {
9
+     then
10
+       LSOF_CFGF="$LSOF_CFGF -DHASSELINUX"
11
+       LSOF_CFGL="$LSOF_CFGL -lselinux"

+ 12
- 0
utils/lsof/patches/004-lsof_ccv.patch Visa fil

@@ -0,0 +1,12 @@
1
+--- a/Configure
2
++++ b/Configure
3
+@@ -2682,6 +2682,9 @@ LOCKF_OWNER4
4
+     if test "X$LSOF_CC" = "X"	# {
5
+     then
6
+       LSOF_CC=cc
7
++    fi	# }
8
++    if test "X$LSOF_CCV" = "X"	# {
9
++    then
10
+       LSOF_CCV=`$LSOF_CC -v 2>&1 | sed -n 's/.*version \(.*\)/\1/p'`
11
+     fi	# }
12
+     if test "X$LINUX_CONF_CC" = "X"	# {