From patchwork Fri Oct 18 13:07:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yousong Zhou X-Patchwork-Id: 1179360 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qRKt3B8I"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MKg6yjBT"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46vmZh6j9lz9sNw for ; Sat, 19 Oct 2019 00:09:16 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-Id:Date:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=WoPURBp4qGmwHHTYldIMmKfe8RSSxCwv6AtpMQgm4Pw=; b=qRKt3B8I3WRunM kWu29ZH71raA9bx7s35rAOcKDSDdmoowoWoyNOccTm97kk4s6Tjxk/5+sEbekXwoRYVeGdReYqu6I m9VJPj9UsbJjMH24gJKY6stlP7Gus4sdlIpN/RfUN8SZGgXN9OPt0yP3QkeVeO+gviDsh1vsv4X2g HncunXgOfijVJcV6Rb7AhNY6yDO00h+YnTN36x5FrqAoQr4trbfTLrOYNGWaFPdDSp2MvJSktbt6P H72kQM6bSFMFBvNrTsoOazLLftdj8PrXKfai5Agmw+bmDXKTD9aIebjrPJV4I36QBt28jOyXlT7Pn x26fuMaPddwzxfI9I+Xw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLRzy-0005B2-7z; Fri, 18 Oct 2019 13:08:54 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLRzt-0005AN-Qy for openwrt-devel@lists.openwrt.org; Fri, 18 Oct 2019 13:08:52 +0000 Received: by mail-pf1-x442.google.com with SMTP id y22so3878711pfr.3 for ; Fri, 18 Oct 2019 06:08:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eEXmX1AfvMsDFxoa6MqPzYIRZcPGY54ZWpQdJ3fy08A=; b=MKg6yjBT5H9a7/GpuWkqgmahjby9U52knisGMQNXW+DPeCXTVgs3FdTbkkrWkFjBet Fdx40vpnQNcIdJmEL5mRRKu61Xh8aGMLymMbgkw09LzUnqSFATadcmqtmiOKarphxuK+ BLE00pzNweZIeggvncbi+WzNYmMELokpDr7ewLBBNxHNyiPnDf3wYc7+QwmEyk3iLJpR DdBzyBLd/MMPHPuOOMsBLjH9R+dp7+fZUzRy/bb0cK4GxS76synczYkUoswOnYp8mo8q LlRJZzhPkvoWsD79YfVbBmWsrJrlYhE5+OIQcM8YYd99EoEOOISvn0C4tstCG++/LhEG Eh4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eEXmX1AfvMsDFxoa6MqPzYIRZcPGY54ZWpQdJ3fy08A=; b=MdFDCfPDYzfjJhPT7VaxT4Ic6W1+JjemOxdtROvj+ibrs/oThgFJGsYM6r6RAShuco nV0PuQDZcHfs2C7gpxve9pQoQg0iuqfokrglhjygrRP3ebfKIqDEvtyMj8kOU5CJFkN0 IIUUpytKulLCh05k0+mxu9CCP9lZ28Aql1ysjP0rXWq649nWp4MrsO5d7EioWjVLoibI ZC9f4kT4H6F741hZwhivSP2YIojAS89ou8cPq6IdVbNC1Dw/ykag0JGFlLJCFpKMUcid x1LKA3K41pB2JAkjL/aCV6jano64O8GXvExVAt/O5fl2/1joDeYQHNZBtyWhPJ1KOkw+ cQfw== X-Gm-Message-State: APjAAAVHVu3hWdHATCYr0ofwT5xmVAUF2rShml/0GAOKPTcoqb+b254Q RUDlCZQSpYMaP85GpO8prIE= X-Google-Smtp-Source: APXvYqybn7DIZNOfZ06zClxsRkbE7Ow5wmqaD4/nQKQfQLDQYI3PdNsiEDFu/9jTQry21iikevzjJA== X-Received: by 2002:a65:52c3:: with SMTP id z3mr9694705pgp.387.1571404126440; Fri, 18 Oct 2019 06:08:46 -0700 (PDT) Received: from titan.hq.cloud.yunionyun.com ([161.117.5.46]) by smtp.gmail.com with ESMTPSA id 4sm5606696pja.29.2019.10.18.06.08.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Oct 2019 06:08:44 -0700 (PDT) From: Yousong Zhou To: nbd@nbd.name Date: Fri, 18 Oct 2019 13:07:33 +0000 Message-Id: <20191018130733.8419-1-yszhou4tech@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191018_060849_881632_8E6B4702 X-CRM114-Status: GOOD ( 11.95 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:442 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (yszhou4tech[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Subject: [OpenWrt-Devel] [PATCH] libpcap: build with cmake X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yousong Zhou , openwrt-devel@lists.openwrt.org Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org CAN and CAN-USB support related symbols are now handled by general linux support, see [1] InstallDev skips .a file and adds .pc pkgconfig file. "-ffunction-sections -fdata-sections" were removed as they not help much for shared libraries The change should also fix the issue that current build can leave out pcap_strlcpy() implmentation when building with glibc, see [2] Size comparison before and after the change -rw-r--r-- 1 yunion yunion 238042 Oct 18 11:42 ipkg-x86_64/libpcap/usr/lib/libpcap.so.1 lrwxrwxrwx 1 yunion yunion 16 Oct 18 13:03 ipkg-x86_64/libpcap/usr/lib/libpcap.so.1 -> libpcap.so.1.9.1 -rwxr-xr-x 1 yunion yunion 229867 Oct 18 13:03 ipkg-x86_64/libpcap/usr/lib/libpcap.so.1.9.1 [1] On Linux, handle all CAN captures with pcap-linux.c, in cooked mode, https://github.com/the-tcpdump-group/libpcap/commit/93ca5ff7030aaf1219e1de05ec89a68384bfc50b [2] https://github.com/openwrt/packages/issues/10270 Signed-off-by: Yousong Zhou --- package/libs/libpcap/Makefile | 72 ++++---- .../patches/100-debian_shared_lib.patch | 168 ------------------ .../102-makefile_disable_manpages.patch | 77 -------- .../libpcap/patches/102-skip-manpages.patch | 75 ++++++++ 4 files changed, 105 insertions(+), 287 deletions(-) delete mode 100644 package/libs/libpcap/patches/100-debian_shared_lib.patch delete mode 100644 package/libs/libpcap/patches/102-makefile_disable_manpages.patch create mode 100644 package/libs/libpcap/patches/102-skip-manpages.patch diff --git a/package/libs/libpcap/Makefile b/package/libs/libpcap/Makefile index fae955a54d..630a45d8b3 100644 --- a/package/libs/libpcap/Makefile +++ b/package/libs/libpcap/Makefile @@ -9,22 +9,21 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libpcap PKG_VERSION:=1.9.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.us.tcpdump.org/release/ \ http://www.tcpdump.org/release/ PKG_HASH:=635237637c5b619bcceba91900666b64d56ecb7be63f298f601ec786ce087094 -PKG_FIXUP:=patch-libtool PKG_MAINTAINER:=Felix Fietkau -PKG_INSTALL:=1 +CMAKE_INSTALL:=1 PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=BSD-3-Clause include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/kernel.mk +include $(INCLUDE_DIR)/cmake.mk define Package/libpcap SECTION:=libs @@ -48,50 +47,39 @@ TARGET_CFLAGS += \ -ffunction-sections \ -fdata-sections -CONFIGURE_VARS += \ - ac_cv_linux_vers=$(LINUX_VERSION) \ - ac_cv_header_libusb_1_0_libusb_h=no - -ifeq ($(CONFIG_PCAP_HAS_NETFILTER),) -CONFIGURE_VARS += \ - ac_cv_netfilter_can_compile=no -endif - -CONFIGURE_ARGS += \ - --enable-shared \ - --disable-yydebug \ - --with-pcap=linux \ - --without-septel \ - --without-dag \ - --without-libnl \ - --without-snf \ - --disable-can \ - --disable-canusb \ - --disable-dbus \ - --disable-bluetooth - -ifeq ($(CONFIG_IPV6),y) -CONFIGURE_ARGS += \ - --enable-ipv6 -endif - -MAKE_FLAGS += \ - CCOPT="$(TARGET_CFLAGS) -I$(BUILD_DIR)/linux/include" - -define Build/Configure - $(call Build/Configure/Default) - $(if $(CONFIG_PCAP_HAS_USB),,$(SED) '/^#define PCAP_SUPPORT_USB/D' $(PKG_BUILD_DIR)/config.h) - $(if $(CONFIG_PCAP_HAS_USB),,$(SED) 's/pcap-usb-linux.c *//' $(PKG_BUILD_DIR)/Makefile) - $(if $(CONFIG_PCAP_HAS_BT),,$(SED) '/^#define PCAP_SUPPORT_BT/D' $(PKG_BUILD_DIR)/config.h) - $(if $(CONFIG_PCAP_HAS_BT),,$(SED) 's/pcap-bt-linux.c *//' $(PKG_BUILD_DIR)/Makefile) -endef +CMAKE_OPTIONS += \ + -DBUILD_SHARED_LIBS=on \ + -DBUILD_WITH_LIBNL=off \ + +# grep 'option(DISABLE_' CMakeLists.txt | cut -f2 -d'(' | cut -f1 -d' ' | sort --unique +CMAKE_OPTIONS += \ + -DDISABLE_DAG=on \ + -DDISABLE_DBUS=on \ + -DDISABLE_NETMAP=on \ + -DDISABLE_RDMA=on \ + -DDISABLE_SEPTEL=on \ + -DDISABLE_SNF=on \ + -DDISABLE_TC=on \ + +# Debugging options +CMAKE_OPTIONS += \ + -DBDEBUG=off \ + -DYYDEBUG=off \ + +CMAKE_OPTIONS += $(if $(CONFIG_PCAP_HAS_USB) ,,-DDISABLE_USB=on) +CMAKE_OPTIONS += $(if $(CONFIG_PCAP_HAS_BT) ,,-DDISABLE_BLUETOOTH=on) +CMAKE_OPTIONS += $(if $(CONFIG_PCAP_HAS_NETFILTER) ,,-DPCAP_SUPPORT_NETFILTER=off) + +CMAKE_OPTIONS += $(if $(CONFIG_IPV6),-DINET6=on,-DINET6=off) define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/usr/include/pcap* $(1)/usr/include/ $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.{a,so*} $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpcap.pc $(1)/usr/lib/pkgconfig/ endef define Package/libpcap/install diff --git a/package/libs/libpcap/patches/100-debian_shared_lib.patch b/package/libs/libpcap/patches/100-debian_shared_lib.patch deleted file mode 100644 index 454490fbfa..0000000000 --- a/package/libs/libpcap/patches/100-debian_shared_lib.patch +++ /dev/null @@ -1,168 +0,0 @@ -Debian-specific modifications to the upstream Makefile.in to -build a shared library. - ---- a/Makefile.in -+++ b/Makefile.in -@@ -40,6 +40,13 @@ mandir = @mandir@ - srcdir = @srcdir@ - VPATH = @srcdir@ - -+# some defines for shared library compilation -+LIBVERSION=1 -+LIBNAME=pcap -+LIBRARY=lib$(LIBNAME).a -+SOLIBRARY=lib$(LIBNAME).so -+SHAREDLIB=$(SOLIBRARY).$(LIBVERSION) -+ - # - # You shouldn't need to edit anything below. - # -@@ -69,7 +76,8 @@ INSTALL_RPCAPD=@INSTALL_RPCAPD@ - EXTRA_NETWORK_LIBS=@EXTRA_NETWORK_LIBS@ - - # Standard CFLAGS for building members of a shared library --FULL_CFLAGS = $(CCOPT) @V_LIB_CCOPT_FAT@ $(SHLIB_CCOPT) $(INCLS) $(DEFS) $(CFLAGS) -+FULL_CFLAGS = $(CCOPT) @V_LIB_CCOPT_FAT@ $(SHLIB_CCOPT) $(INCLS) $(DEFS) $(CFLAGS) $(CPPFLAGS) -+CFLAGS_SHARED = -shared -Wl,-soname,$(SHAREDLIB) - - INSTALL = @INSTALL@ - INSTALL_PROGRAM = @INSTALL_PROGRAM@ -@@ -84,7 +92,11 @@ YACC = @YACC@ - # problem if you don't own the file but can write to the directory. - .c.o: - @rm -f $@ -- $(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c -+ $(CC) $(FULL_CFLAGS) -c -o $@ $(srcdir)/$*.c -+ -+%_pic.o: %.c %.o -+ @rm -f $@ -+ $(CC) -fPIC $(FULL_CFLAGS) -c -o $@ $(srcdir)/$*.c - - PSRC = pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @BT_MONITOR_SRC@ @NETFILTER_SRC@ @DBUS_SRC@ @NETMAP_SRC@ @RDMA_SRC@ - FSRC = @V_FINDALLDEVS@ -@@ -101,6 +113,7 @@ SRC = $(PSRC) $(FSRC) $(CSRC) $(SSRC) $( - # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot - # hack the extra indirection - OBJ = $(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) $(LIBOBJS) -+OBJ_PIC = $(PSRC:.c=_pic.o) $(FSRC:.c=_pic.o) $(CSRC:.c=_pic.o) $(SSRC:.c=_pic.o) $(GENSRC:.c=_pic.o) - PUBHDR = \ - pcap.h \ - pcap-bpf.h \ -@@ -155,7 +168,7 @@ TAGFILES = \ - - CLEANFILES = $(OBJ) libpcap.a libpcap.so.`cat $(srcdir)/VERSION` \ - $(PROG)-`cat $(srcdir)/VERSION`.tar.gz $(GENSRC) $(GENHDR) \ -- lex.yy.c pcap-config libpcap.pc -+ lex.yy.c pcap-config libpcap.pc $(OBJ_PIC) - - MAN1 = pcap-config.1 - -@@ -392,7 +405,7 @@ libpcap.a: $(OBJ) - $(AR) rc $@ $(OBJ) $(ADDLARCHIVEOBJS) - $(RANLIB) $@ - --shared: libpcap.$(DYEXT) -+shared: $(SHAREDLIB) - - libpcap.so: $(OBJ) - @rm -f $@ -@@ -468,6 +481,12 @@ libpcap.shareda: $(OBJ) - # - libpcap.none: - -+$(SHAREDLIB): $(OBJ_PIC) -+ -@rm -f $@ -+ -@rm -f $(SOLIBRARY) -+ $(CC) $(CFLAGS_SHARED) $(LDFLAGS) -o $(SHAREDLIB) $(OBJ_PIC) -lc $(LIBS) -+ ln -s $(SHAREDLIB) $(SOLIBRARY) -+ - scanner.c: $(srcdir)/scanner.l - $(LEX) -P pcap_ --header-file=scanner.h --nounput -o scanner.c $< - scanner.h: scanner.c -@@ -480,6 +499,9 @@ scanner.h: scanner.c - scanner.o: scanner.c grammar.h - $(CC) $(FULL_CFLAGS) -c scanner.c - -+scanner_pic.o: scanner.c grammar.h -+ $(CC) -fPIC $(FULL_CFLAGS) -o $@ -c scanner.c -+ - grammar.c: $(srcdir)/grammar.y - $(YACC) -p pcap_ -o grammar.c -d $< - grammar.h: grammar.c -@@ -492,6 +514,9 @@ grammar.h: grammar.c - grammar.o: grammar.c scanner.h - $(CC) $(FULL_CFLAGS) -c grammar.c - -+grammar_pic.o: grammar.c scanner.h -+ $(CC) -fPIC $(FULL_CFLAGS) -o $@ -c grammar.c -+ - gencode.o: $(srcdir)/gencode.c grammar.h scanner.h - $(CC) $(FULL_CFLAGS) -c $(srcdir)/gencode.c - -@@ -539,6 +564,9 @@ pcap-config: $(srcdir)/pcap-config.in ./ - mv $@.tmp $@ - chmod a+x $@ - -+bpf_filter_pic.o: bpf_filter.c -+ $(CC) -fPIC $(FULL_CFLAGS) -c bpf_filter.c -o $@ -+ - # - # Remote pcap daemon. - # -@@ -632,14 +660,11 @@ install: install-shared install-archive - $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@/`echo $$i | sed 's/.manmisc.in/.@MAN_MISC_INFO@/'`; done - - install-shared: install-shared-$(DYEXT) --install-shared-so: libpcap.so -+install-shared-so: $(SHAREDLIB) - [ -d $(DESTDIR)$(libdir) ] || \ - (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir)) -- VER=`cat $(srcdir)/VERSION`; \ -- MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \ -- $(INSTALL_PROGRAM) libpcap.so.$$VER $(DESTDIR)$(libdir)/libpcap.so.$$VER; \ -- ln -sf libpcap.so.$$VER $(DESTDIR)$(libdir)/libpcap.so.$$MAJOR_VER; \ -- ln -sf libpcap.so.$$MAJOR_VER $(DESTDIR)$(libdir)/libpcap.so -+ $(INSTALL_DATA) $(SHAREDLIB) $(DESTDIR)$(libdir)/ -+ ln -sf $(SHAREDLIB) $(DESTDIR)$(libdir)/$(SOLIBRARY) - install-shared-dylib: libpcap.dylib - [ -d $(DESTDIR)$(libdir) ] || \ - (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir)) ---- a/aclocal.m4 -+++ b/aclocal.m4 -@@ -507,7 +507,7 @@ AC_DEFUN(AC_LBL_SHLIBS_INIT, - esac - ;; - esac -- V_SHLIB_CCOPT="$V_SHLIB_CCOPT $PIC_OPT" -+ V_SHLIB_CCOPT="$V_SHLIB_CCOPT" - V_SONAME_OPT="-Wl,-soname," - V_RPATH_OPT="-Wl,-rpath," - ;; -@@ -570,7 +570,7 @@ AC_DEFUN(AC_LBL_SHLIBS_INIT, - # - # "cc" is GCC. - # -- V_SHLIB_CCOPT="$V_SHLIB_CCOPT -fpic" -+ V_SHLIB_CCOPT="$V_SHLIB_CCOPT" - V_SHLIB_CMD="\$(CC)" - V_SHLIB_OPT="-shared" - V_SONAME_OPT="-Wl,-soname," ---- a/pcap-config.in -+++ b/pcap-config.in -@@ -41,16 +41,6 @@ do - esac - shift - done --if [ "$V_RPATH_OPT" != "" ] --then -- # -- # If libdir isn't /usr/lib, add it to the run-time linker path. -- # -- if [ "$libdir" != "/usr/lib" ] -- then -- RPATH=$V_RPATH_OPT$libdir -- fi --fi - if [ "$static" = 1 ] - then - # diff --git a/package/libs/libpcap/patches/102-makefile_disable_manpages.patch b/package/libs/libpcap/patches/102-makefile_disable_manpages.patch deleted file mode 100644 index bd1702be0f..0000000000 --- a/package/libs/libpcap/patches/102-makefile_disable_manpages.patch +++ /dev/null @@ -1,77 +0,0 @@ ---- a/Makefile.in -+++ b/Makefile.in -@@ -588,14 +588,6 @@ install: install-shared install-archive - (mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir)) - [ -d $(DESTDIR)$(includedir)/pcap ] || \ - (mkdir -p $(DESTDIR)$(includedir)/pcap; chmod 755 $(DESTDIR)$(includedir)/pcap) -- [ -d $(DESTDIR)$(mandir)/man1 ] || \ -- (mkdir -p $(DESTDIR)$(mandir)/man1; chmod 755 $(DESTDIR)$(mandir)/man1) -- [ -d $(DESTDIR)$(mandir)/man3 ] || \ -- (mkdir -p $(DESTDIR)$(mandir)/man3; chmod 755 $(DESTDIR)$(mandir)/man3) -- [ -d $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@ ] || \ -- (mkdir -p $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@; chmod 755 $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@) -- [ -d $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@ ] || \ -- (mkdir -p $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@; chmod 755 $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@) - for i in $(PUBHDR); do \ - $(INSTALL_DATA) $(srcdir)/$$i \ - $(DESTDIR)$(includedir)/$$i; done -@@ -605,59 +597,6 @@ install: install-shared install-archive - [ -d $(DESTDIR)$(libdir)/pkgconfig ] || \ - (mkdir -p $(DESTDIR)$(libdir)/pkgconfig; chmod 755 $(DESTDIR)$(libdir)/pkgconfig) - $(INSTALL_DATA) libpcap.pc $(DESTDIR)$(libdir)/pkgconfig/libpcap.pc -- for i in $(MAN1); do \ -- $(INSTALL_DATA) $(srcdir)/$$i \ -- $(DESTDIR)$(mandir)/man1/$$i; done -- for i in $(MAN3PCAP_NOEXPAND); do \ -- $(INSTALL_DATA) $(srcdir)/$$i \ -- $(DESTDIR)$(mandir)/man3/$$i; done -- for i in $(MAN3PCAP_EXPAND:.in=); do \ -- $(INSTALL_DATA) $$i \ -- $(DESTDIR)$(mandir)/man3/$$i; done -- (cd $(DESTDIR)$(mandir)/man3 && \ -- rm -f pcap_datalink_val_to_description.3pcap && \ -- $(LN_S) pcap_datalink_val_to_name.3pcap \ -- pcap_datalink_val_to_description.3pcap && \ -- rm -f pcap_datalink_val_to_description_or_dlt.3pcap && \ -- $(LN_S) pcap_datalink_val_to_name.3pcap \ -- pcap_datalink_val_to_description_or_dlt.3pcap && \ -- rm -f pcap_dump_fopen.3pcap && \ -- $(LN_S) pcap_dump_open.3pcap pcap_dump_fopen.3pcap && \ -- rm -f pcap_freealldevs.3pcap && \ -- $(LN_S) pcap_findalldevs.3pcap pcap_freealldevs.3pcap && \ -- rm -f pcap_perror.3pcap && \ -- $(LN_S) pcap_geterr.3pcap pcap_perror.3pcap && \ -- rm -f pcap_sendpacket.3pcap && \ -- $(LN_S) pcap_inject.3pcap pcap_sendpacket.3pcap && \ -- rm -f pcap_free_datalinks.3pcap && \ -- $(LN_S) pcap_list_datalinks.3pcap pcap_free_datalinks.3pcap && \ -- rm -f pcap_free_tstamp_types.3pcap && \ -- $(LN_S) pcap_list_tstamp_types.3pcap pcap_free_tstamp_types.3pcap && \ -- rm -f pcap_dispatch.3pcap && \ -- $(LN_S) pcap_loop.3pcap pcap_dispatch.3pcap && \ -- rm -f pcap_minor_version.3pcap && \ -- $(LN_S) pcap_major_version.3pcap pcap_minor_version.3pcap && \ -- rm -f pcap_next.3pcap && \ -- $(LN_S) pcap_next_ex.3pcap pcap_next.3pcap && \ -- rm -f pcap_open_dead_with_tstamp_precision.3pcap && \ -- $(LN_S) pcap_open_dead.3pcap \ -- pcap_open_dead_with_tstamp_precision.3pcap && \ -- rm -f pcap_open_offline_with_tstamp_precision.3pcap && \ -- $(LN_S) pcap_open_offline.3pcap pcap_open_offline_with_tstamp_precision.3pcap && \ -- rm -f pcap_fopen_offline.3pcap && \ -- $(LN_S) pcap_open_offline.3pcap pcap_fopen_offline.3pcap && \ -- rm -f pcap_fopen_offline_with_tstamp_precision.3pcap && \ -- $(LN_S) pcap_open_offline.3pcap pcap_fopen_offline_with_tstamp_precision.3pcap && \ -- rm -f pcap_tstamp_type_val_to_description.3pcap && \ -- $(LN_S) pcap_tstamp_type_val_to_name.3pcap pcap_tstamp_type_val_to_description.3pcap && \ -- rm -f pcap_getnonblock.3pcap && \ -- $(LN_S) pcap_setnonblock.3pcap pcap_getnonblock.3pcap) -- for i in $(MANFILE); do \ -- $(INSTALL_DATA) `echo $$i | sed 's/.manfile.in/.manfile/'` \ -- $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@/`echo $$i | sed 's/.manfile.in/.@MAN_FILE_FORMATS@/'`; done -- for i in $(MANMISC); do \ -- $(INSTALL_DATA) `echo $$i | sed 's/.manmisc.in/.manmisc/'` \ -- $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@/`echo $$i | sed 's/.manmisc.in/.@MAN_MISC_INFO@/'`; done - - install-shared: install-shared-$(DYEXT) - install-shared-so: $(SHAREDLIB) diff --git a/package/libs/libpcap/patches/102-skip-manpages.patch b/package/libs/libpcap/patches/102-skip-manpages.patch new file mode 100644 index 0000000000..28f572c913 --- /dev/null +++ b/package/libs/libpcap/patches/102-skip-manpages.patch @@ -0,0 +1,75 @@ +From f172e36e436d714f4def1439b13efd147a6a8411 Mon Sep 17 00:00:00 2001 +From: Yousong Zhou +Date: Fri, 18 Oct 2019 12:43:22 +0000 +Subject: [PATCH] skip manpages + +--- + CMakeLists.txt | 55 -------------------------------------------------- + 1 file changed, 55 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 55b93f14..acf1a904 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2397,61 +2397,6 @@ if(NOT MSVC) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpcap.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libpcap.pc @ONLY) + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/pcap-config DESTINATION bin) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpcap.pc DESTINATION lib/pkgconfig) +- +- # +- # Man pages. +- # +- # For each section of the manual for which we have man pages +- # that require macro expansion, do the expansion. +- # +- set(MAN1 "") +- foreach(MANPAGE ${MAN1_NOEXPAND}) +- set(MAN1 ${MAN1} ${CMAKE_CURRENT_SOURCE_DIR}/${MANPAGE}) +- endforeach(MANPAGE) +- install(FILES ${MAN1} DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) +- +- set(MAN3PCAP "") +- foreach(MANPAGE ${MAN3PCAP_NOEXPAND}) +- set(MAN3PCAP ${MAN3PCAP} ${CMAKE_CURRENT_SOURCE_DIR}/${MANPAGE}) +- endforeach(MANPAGE) +- foreach(TEMPLATE_MANPAGE ${MAN3PCAP_EXPAND}) +- string(REPLACE ".in" "" MANPAGE ${TEMPLATE_MANPAGE}) +- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${TEMPLATE_MANPAGE} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE} @ONLY) +- set(MAN3PCAP ${MAN3PCAP} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE}) +- endforeach(TEMPLATE_MANPAGE) +- install(FILES ${MAN3PCAP} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) +- install_manpage_symlink(pcap_datalink_val_to_name.3pcap pcap_datalink_val_to_description.3pcap ${CMAKE_INSTALL_MANDIR}/man3) +- install_manpage_symlink(pcap_dump_open.3pcap pcap_dump_fopen.3pcap ${CMAKE_INSTALL_MANDIR}/man3) +- install_manpage_symlink(pcap_findalldevs.3pcap pcap_freealldevs.3pcap ${CMAKE_INSTALL_MANDIR}/man3) +- install_manpage_symlink(pcap_geterr.3pcap pcap_perror.3pcap ${CMAKE_INSTALL_MANDIR}/man3) +- install_manpage_symlink(pcap_inject.3pcap pcap_sendpacket.3pcap ${CMAKE_INSTALL_MANDIR}/man3) +- install_manpage_symlink(pcap_list_datalinks.3pcap pcap_free_datalinks.3pcap ${CMAKE_INSTALL_MANDIR}/man3) +- install_manpage_symlink(pcap_list_tstamp_types.3pcap pcap_free_tstamp_types.3pcap ${CMAKE_INSTALL_MANDIR}/man3) +- install_manpage_symlink(pcap_loop.3pcap pcap_dispatch.3pcap ${CMAKE_INSTALL_MANDIR}/man3) +- install_manpage_symlink(pcap_major_version.3pcap pcap_minor_version.3pcap ${CMAKE_INSTALL_MANDIR}/man3) +- install_manpage_symlink(pcap_next_ex.3pcap pcap_next.3pcap ${CMAKE_INSTALL_MANDIR}/man3) +- install_manpage_symlink(pcap_open_dead.3pcap pcap_open_dead_with_tstamp_precision.3pcap ${CMAKE_INSTALL_MANDIR}/man3) +- install_manpage_symlink(pcap_open_offline.3pcap pcap_open_offline_with_tstamp_precision.3pcap ${CMAKE_INSTALL_MANDIR}/man3) +- install_manpage_symlink(pcap_open_offline.3pcap pcap_fopen_offline.3pcap ${CMAKE_INSTALL_MANDIR}/man3) +- install_manpage_symlink(pcap_open_offline.3pcap pcap_fopen_offline_with_tstamp_precision.3pcap ${CMAKE_INSTALL_MANDIR}/man3) +- install_manpage_symlink(pcap_tstamp_type_val_to_name.3pcap pcap_tstamp_type_val_to_description.3pcap ${CMAKE_INSTALL_MANDIR}/man3) +- install_manpage_symlink(pcap_setnonblock.3pcap pcap_getnonblock.3pcap ${CMAKE_INSTALL_MANDIR}/man3) +- +- set(MANFILE "") +- foreach(TEMPLATE_MANPAGE ${MANFILE_EXPAND}) +- string(REPLACE ".manfile.in" ".${MAN_FILE_FORMATS}" MANPAGE ${TEMPLATE_MANPAGE}) +- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${TEMPLATE_MANPAGE} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE} @ONLY) +- set(MANFILE ${MANFILE} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE}) +- endforeach(TEMPLATE_MANPAGE) +- install(FILES ${MANFILE} DESTINATION ${CMAKE_INSTALL_MANDIR}/man${MAN_FILE_FORMATS}) +- +- set(MANMISC "") +- foreach(TEMPLATE_MANPAGE ${MANMISC_EXPAND}) +- string(REPLACE ".manmisc.in" ".${MAN_MISC_INFO}" MANPAGE ${TEMPLATE_MANPAGE}) +- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${TEMPLATE_MANPAGE} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE} @ONLY) +- set(MANMISC ${MANMISC} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE}) +- endforeach(TEMPLATE_MANPAGE) +- install(FILES ${MANMISC} DESTINATION ${CMAKE_INSTALL_MANDIR}/man${MAN_MISC_INFO}) + endif(NOT MSVC) + + # uninstall target