procd: make mDNS TXT record parsing more solid
[openwrt/openwrt.git] / package / libs / libpcap / Makefile
1 #
2 # Copyright (C) 2006-2013 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
10 PKG_NAME:=libpcap
11 PKG_VERSION:=1.10.1
12 PKG_RELEASE:=$(AUTORELEASE)
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://www.tcpdump.org/release/
16 PKG_HASH:=ed285f4accaf05344f90975757b3dbfe772ba41d1c401c2648b7fa45b711bdd4
17
18 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
19 PKG_LICENSE:=BSD-3-Clause
20 PKG_LICENSE_FILES:=LICENSE
21 PKG_CPE_ID:=cpe:/a:tcpdump:libpcap
22
23 PKG_ASLR_PIE_REGULAR:=1
24
25 PKG_CONFIG_DEPENDS := CONFIG_PACKAGE_rpcapd
26
27 include $(INCLUDE_DIR)/package.mk
28 include $(INCLUDE_DIR)/cmake.mk
29
30 define Package/libpcap
31 SECTION:=libs
32 CATEGORY:=Libraries
33 TITLE:=Low-level packet capture library
34 URL:=http://www.tcpdump.org/
35 MENU:=1
36 ABI_VERSION:=1
37 endef
38
39 define Package/libpcap/description
40 This package contains a system-independent library for user-level network packet
41 capture.
42 endef
43
44 define Package/libpcap/config
45 source "$(SOURCE)/Config.in"
46 endef
47
48 define Package/rpcapd
49 SECTION:=net
50 CATEGORY:=Network
51 TITLE:=Capture daemon to be controlled by a remote libpcap application
52 URL:=http://www.tcpdump.org/
53 DEPENDS+= +libpcap
54 endef
55
56 ifdef CONFIG_PACKAGE_rpcapd
57 CMAKE_OPTIONS += \
58 -DENABLE_REMOTE=ON
59 endif
60
61 CMAKE_OPTIONS += \
62 -DBUILD_SHARED_LIBS=ON \
63 -DBUILD_WITH_LIBNL=OFF \
64 -DINET6=O$(if $(CONFIG_IPV6),N,FF) \
65 -DPCAP_SUPPORT_NETFILTER=O$(if $(CONFIG_PCAP_HAS_NETFILTER),N,FF)
66
67 # grep 'option(DISABLE_' CMakeLists.txt | cut -f2 -d'(' | cut -f1 -d' ' | sort --unique
68 CMAKE_OPTIONS += \
69 -DDISABLE_BLUETOOTH=O$(if $(CONFIG_PCAP_HAS_BT),FF,N) \
70 -DDISABLE_DAG=ON \
71 -DDISABLE_DBUS=ON \
72 -DDISABLE_DPDK=ON \
73 -DDISABLE_LINUX_USBMON=O$(if $(CONFIG_PCAP_HAS_USB),FF,N) \
74 -DDISABLE_NETMAP=ON \
75 -DDISABLE_RDMA=ON \
76 -DDISABLE_SEPTEL=ON \
77 -DDISABLE_SNF=ON \
78 -DDISABLE_TC=ON \
79
80 # Debugging options
81 CMAKE_OPTIONS += \
82 -DBDEBUG=OFF \
83 -DYYDEBUG=OFF \
84
85 define Build/InstallDev
86 $(call Build/InstallDev/cmake,$(1))
87 $(SED) \
88 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
89 $(1)/usr/bin/pcap-config
90 $(INSTALL_DIR) $(2)/bin
91 $(LN) ../../usr/bin/pcap-config $(2)/bin/pcap-config
92 endef
93
94 define Package/libpcap/install
95 $(INSTALL_DIR) $(1)/usr/lib
96 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so.* $(1)/usr/lib/
97 endef
98
99 define Package/rpcapd/install
100 $(INSTALL_DIR) $(1)/usr/sbin
101 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rpcapd $(1)/usr/sbin/
102 endef
103
104 $(eval $(call BuildPackage,libpcap))
105 $(eval $(call BuildPackage,rpcapd))