>From eb746fe154cc9b35b8222591d31e99193e097411 Mon Sep 17 00:00:00 2001 From: Andy Gibbs Date: Fri, 5 Nov 2010 13:24:32 +0100 Subject: [PATCH] lsof: Bump to 4.84 and convert to GENTARGETS lsof is bumped to version 4.84 and the package lsof.mk file is revised to use GENTARGETS. In doing so, the way the lsof package is extracted has to be modified since the source is provided as an archive inside an archive, and so the source must be subjected to a second extraction. This is done via LSOF_POST_EXTRACT_HOOKS. For the patch system in GENTARGETS to work in the correct way, when this second extraction takes place it must place the files directly in the .../build/lsof-{ver} folder rather than a subfolder. In so doing, this also makes the patches easier to maintain since the subfolder does not need to be included in the patch file. This patch basically follows that described at previously at http://lists.busybox.net/pipermail/buildroot/2010-October/038111.html, but differs in that it works around the subfolder problem and hence is still able to use the GENTARGETS patch system. This patch also incorporates the LSOF_CFLAGS_OVERRIDE fix previously committed, which is still required. Since the patch for uclibc was removed in the above patch, it has also been removed here; I assume that this was an intensional deletion, but have not been able to test it myself. If this deletion is reverted in the future, then the header of the patch must be adjusted for the path. Signed-off-by: Andy Gibbs --- package/lsof/lsof-makefile.patch | 5 +- package/lsof/lsof-noportmap.patch | 4 +- package/lsof/lsof-override-cflags.patch | 4 +- package/lsof/lsof-remove-susvlegacy-funcs.patch | 5 +- package/lsof/lsof-uclibc.patch | 12 --- package/lsof/lsof.mk | 90 ++++++++++------------- 6 files changed, 48 insertions(+), 72 deletions(-) delete mode 100644 package/lsof/lsof-uclibc.patch diff --git a/package/lsof/lsof-makefile.patch b/package/lsof/lsof-makefile.patch index 2d4e9d4..4a6eddf 100644 --- a/package/lsof/lsof-makefile.patch +++ b/package/lsof/lsof-makefile.patch @@ -1,6 +1,5 @@ -diff -ru lsof_4.81.orig/lsof_4.81_src/lib/Makefile.skel lsof_4.81/lsof_4.81_src/lib/Makefile.skel ---- lsof_4.81.orig/lsof_4.81_src/lib/Makefile.skel 2001-02-13 03:12:22.000000000 +0100 -+++ lsof_4.81/lsof_4.81_src/lib/Makefile.skel 2006-11-29 13:51:44.000000000 +0100 +--- a/lib/Makefile.skel 2001-02-13 03:12:22.000000000 +0100 ++++ b/lib/Makefile.skel 2006-11-29 13:51:44.000000000 +0100 @@ -21,8 +21,8 @@ all: ${LIB} diff --git a/package/lsof/lsof-noportmap.patch b/package/lsof/lsof-noportmap.patch index 4a37db4..984e0d8 100644 --- a/package/lsof/lsof-noportmap.patch +++ b/package/lsof/lsof-noportmap.patch @@ -1,5 +1,5 @@ ---- lsof_4.81/lsof_4.81_src/print.orig.c 2006-08-23 13:37:43.000000000 -0600 -+++ lsof_4.81/lsof_4.81_src/print.c 2006-08-23 13:38:29.000000000 -0600 +--- a/print.c 2006-08-23 13:37:43.000000000 -0600 ++++ b/print.c 2006-08-23 13:38:29.000000000 -0600 @@ -148,6 +148,7 @@ static void fill_portmap() diff --git a/package/lsof/lsof-override-cflags.patch b/package/lsof/lsof-override-cflags.patch index fcb9292..37e7ea3 100644 --- a/package/lsof/lsof-override-cflags.patch +++ b/package/lsof/lsof-override-cflags.patch @@ -1,5 +1,5 @@ ---- lsof_4.81/lsof_4.81_src/Configure 2008-10-21 18:21:45.000000000 +0200 -+++ lsof_4.81/lsof_4.81_src/Configure 2010-11-03 14:00:00.000000000 +0100 +--- a/Configure 2008-10-21 18:21:45.000000000 +0200 ++++ b/Configure 2010-11-03 14:00:00.000000000 +0100 @@ -5206,6 +5206,10 @@ cp $LSOF_MKFC ${LSOF_LIB}/$LSOF_LIBMKF fi # } diff --git a/package/lsof/lsof-remove-susvlegacy-funcs.patch b/package/lsof/lsof-remove-susvlegacy-funcs.patch index d1d9371..542a416 100644 --- a/package/lsof/lsof-remove-susvlegacy-funcs.patch +++ b/package/lsof/lsof-remove-susvlegacy-funcs.patch @@ -1,6 +1,5 @@ -diff -rdup lsof_4.81.orig/lsof_4.81_src/dialects/linux/machine.h lsof_4.81/lsof_4.81_src/dialects/linux/machine.h ---- lsof_4.81.orig/lsof_4.81_src/dialects/linux/machine.h 2007-04-24 18:20:58.000000000 +0200 -+++ lsof_4.81/lsof_4.81_src/dialects/linux/machine.h 2007-05-15 12:17:03.000000000 +0200 +--- a/dialects/linux/machine.h 2007-04-24 18:20:58.000000000 +0200 ++++ b/dialects/linux/machine.h 2007-05-15 12:17:03.000000000 +0200 @@ -616,6 +616,6 @@ * zeromem is a macro that uses bzero or memset. */ diff --git a/package/lsof/lsof-uclibc.patch b/package/lsof/lsof-uclibc.patch deleted file mode 100644 index 797a0ce..0000000 --- a/package/lsof/lsof-uclibc.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ru lsof_4.81.orig/lsof_4.81_src/dialects/linux/dlsof.h lsof_4.81/lsof_4.81_src/dialects/linux/dlsof.h ---- lsof_4.81.orig/lsof_4.81_src/dialects/linux/dlsof.h 2006-03-28 00:57:14.000000000 +0200 -+++ lsof_4.81/lsof_4.81_src/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 diff --git a/package/lsof/lsof.mk b/package/lsof/lsof.mk index 837a88c..54b8817 100644 --- a/package/lsof/lsof.mk +++ b/package/lsof/lsof.mk @@ -3,68 +3,58 @@ # lsof # ############################################################# -LSOF_VERSION:=4.81 -LSOF_SOURCE:=lsof_$(LSOF_VERSION).tar.bz2 -LSOF_SITE:=ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ -LSOF_CAT:=$(BZCAT) -LSOF_DIR:=$(BUILD_DIR)/lsof_$(LSOF_VERSION) -LSOF_BINARY:=lsof -LSOF_TARGET_BINARY:=bin/lsof -LSOF_INCLUDE:=$(STAGING_DIR)/usr/include +LSOF_VERSION = 4.84 +LSOF_SOURCE = lsof_$(LSOF_VERSION).tar.bz2 +LSOF_SITE = ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ +LSOF_INCLUDE = $(STAGING_DIR)/usr/include -BR2_LSOF_CFLAGS:= +BR2_LSOF_CFLAGS = ifeq ($(BR2_LARGEFILE),) -BR2_LSOF_CFLAGS+=-U_FILE_OFFSET_BITS +BR2_LSOF_CFLAGS += -U_FILE_OFFSET_BITS endif ifeq ($(BR2_INET_IPV6),) -BR2_LSOF_CFLAGS+=-UHASIPv6 +BR2_LSOF_CFLAGS += -UHASIPv6 endif -$(DL_DIR)/$(LSOF_SOURCE): - $(call DOWNLOAD,$(LSOF_SITE),$(LSOF_SOURCE)) - -lsof-source: $(DL_DIR)/$(LSOF_SOURCE) - -lsof-unpacked: $(LSOF_DIR)/.unpacked - -$(LSOF_DIR)/.unpacked: $(DL_DIR)/$(LSOF_SOURCE) - $(LSOF_CAT) $(DL_DIR)/$(LSOF_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - - (cd $(LSOF_DIR);tar xf lsof_$(LSOF_VERSION)_src.tar;rm -f lsof_$(LSOF_VERSION)_src.tar) - toolchain/patch-kernel.sh $(LSOF_DIR) package/lsof/ \*.patch - touch $(LSOF_DIR)/.unpacked - -$(LSOF_DIR)/.configured: $(LSOF_DIR)/.unpacked - (cd $(LSOF_DIR)/lsof_$(LSOF_VERSION)_src; echo n | $(TARGET_CONFIGURE_OPTS) DEBUG="$(TARGET_CFLAGS) $(BR2_LSOF_CFLAGS)" LSOF_INCLUDE="$(LSOF_INCLUDE)" LSOF_CFLAGS_OVERRIDE=1 ./Configure linux) - touch $(LSOF_DIR)/.configured - -$(LSOF_DIR)/lsof_$(LSOF_VERSION)_src/$(LSOF_BINARY): $(LSOF_DIR)/.configured ifeq ($(BR2_USE_WCHAR),) - $(SED) 's,^#define[[:space:]]*HASWIDECHAR.*,#undef HASWIDECHAR,' $(LSOF_DIR)/lsof_$(LSOF_VERSION)_src/machine.h - $(SED) 's,^#define[[:space:]]*WIDECHARINCL.*,,' $(LSOF_DIR)/lsof_$(LSOF_VERSION)_src/machine.h +define LSOF_CONFIGURE_WCHAR_FIXUPS + $(SED) 's,^#define[[:space:]]*HASWIDECHAR.*,#undef HASWIDECHAR,' $(@D)/machine.h + $(SED) 's,^#define[[:space:]]*WIDECHARINCL.*,,' $(@D)/machine.h +endef endif + ifeq ($(BR2_ENABLE_LOCALE),) - $(SED) 's,^#define[[:space:]]*HASSETLOCALE.*,#undef HASSETLOCALE,' $(LSOF_DIR)/lsof_$(LSOF_VERSION)_src/machine.h +define LSOF_CONFIGURE_LOCALE_FIXUPS + $(SED) 's,^#define[[:space:]]*HASSETLOCALE.*,#undef HASSETLOCALE,' $(@D)/machine.h +endef endif - $(MAKE) $(TARGET_CONFIGURE_OPTS) DEBUG="$(TARGET_CFLAGS) $(BR2_LSOF_CFLAGS)" -C $(LSOF_DIR)/lsof_$(LSOF_VERSION)_src -$(TARGET_DIR)/$(LSOF_TARGET_BINARY): $(LSOF_DIR)/lsof_$(LSOF_VERSION)_src/$(LSOF_BINARY) - cp $(LSOF_DIR)/lsof_$(LSOF_VERSION)_src/$(LSOF_BINARY) $@ - $(STRIPCMD) $@ +LSOF_POST_EXTRACT_HOOKS += LSOF_EXTRACT_EMBEDDED_TAR -lsof: $(TARGET_DIR)/$(LSOF_TARGET_BINARY) +define LSOF_EXTRACT_EMBEDDED_TAR + (cd $(@D);tar xf lsof_$(LSOF_VERSION)_src.tar --strip-components=1;rm -f lsof_$(LSOF_VERSION)_src.tar) +endef -lsof-clean: - -rm -f $(TARGET_DIR)/$(LSOF_TARGET_BINARY) - -$(MAKE) -C $(LSOF_DIR)/lsof_$(LSOF_VERSION)_src clean +define LSOF_CONFIGURE_CMDS + (cd $(@D); echo n | $(TARGET_CONFIGURE_OPTS) DEBUG="$(TARGET_CFLAGS) $(BR2_LSOF_CFLAGS)" LSOF_INCLUDE="$(LSOF_INCLUDE)" LSOF_CFLAGS_OVERRIDE=1 ./Configure linux) + $(LSOF_CONFIGURE_WCHAR_FIXUPS) + $(LSOF_CONFIGURE_LOCALE_FIXUPS) +endef -lsof-dirclean: - rm -rf $(LSOF_DIR) +define LSOF_BUILD_CMDS + $(MAKE) $(TARGET_CONFIGURE_OPTS) DEBUG="$(TARGET_CFLAGS) $(BR2_LSOF_CFLAGS)" -C $(@D) +endef -############################################################# -# -# Toplevel Makefile options -# -############################################################# -ifeq ($(BR2_PACKAGE_LSOF),y) -TARGETS+=lsof -endif +define LSOF_INSTALL_TARGET_CMDS + install -D -m 755 $(@D)/lsof $(TARGET_DIR)/bin/lsof +endef + +define LSOF_UNINSTALL_TARGET_CMDS + -rm -f $(TARGET_DIR)/bin/lsof +endef + +define LSOF_CLEAN_CMDS + -$(MAKE) -C $(@D) clean +endef + +$(eval $(call GENTARGETS,package,lsof)) -- 1.7.2.3