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