6168d4c45944b9a3f917153721f427df1b1c6b9c
[openwrt/staging/mkresin.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.0
12 PKG_RELEASE:=1
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:=8d12b42623eeefee872f123bd0dc85d535b00df4d42e865f993c40f7bfc92b1e
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 PKG_BUILD_PARALLEL:=1
25
26 include $(INCLUDE_DIR)/package.mk
27 include $(INCLUDE_DIR)/cmake.mk
28
29 define Package/libpcap
30 SECTION:=libs
31 CATEGORY:=Libraries
32 TITLE:=Low-level packet capture library
33 URL:=http://www.tcpdump.org/
34 MENU:=1
35 ABI_VERSION:=1
36 endef
37
38 define Package/libpcap/description
39 This package contains a system-independent library for user-level network packet
40 capture.
41 endef
42
43 define Package/libpcap/config
44 source "$(SOURCE)/Config.in"
45 endef
46
47 CMAKE_OPTIONS += \
48 -DBUILD_SHARED_LIBS=ON \
49 -DBUILD_WITH_LIBNL=OFF \
50 -DINET6=O$(if $(CONFIG_IPV6),N,FF) \
51 -DPCAP_SUPPORT_NETFILTER=O$(if $(CONFIG_PCAP_HAS_NETFILTER),N,FF)
52
53 # grep 'option(DISABLE_' CMakeLists.txt | cut -f2 -d'(' | cut -f1 -d' ' | sort --unique
54 CMAKE_OPTIONS += \
55 -DDISABLE_BLUETOOTH=O$(if $(CONFIG_PCAP_HAS_BT),FF,N) \
56 -DDISABLE_DAG=ON \
57 -DDISABLE_DBUS=ON \
58 -DDISABLE_DPDK=ON \
59 -DDISABLE_LINUX_USBMON=O$(if $(CONFIG_PCAP_HAS_USB),FF,N) \
60 -DDISABLE_NETMAP=ON \
61 -DDISABLE_RDMA=ON \
62 -DDISABLE_SEPTEL=ON \
63 -DDISABLE_SNF=ON \
64 -DDISABLE_TC=ON \
65
66 # Debugging options
67 CMAKE_OPTIONS += \
68 -DBDEBUG=OFF \
69 -DYYDEBUG=OFF \
70
71 define Build/InstallDev
72 $(call Build/InstallDev/cmake,$(1))
73 $(SED) \
74 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
75 $(1)/usr/bin/pcap-config
76 $(INSTALL_DIR) $(2)/bin
77 $(LN) ../../usr/bin/pcap-config $(2)/bin/pcap-config
78 endef
79
80 define Package/libpcap/install
81 $(INSTALL_DIR) $(1)/usr/lib
82 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so.* $(1)/usr/lib/
83 endef
84
85 $(eval $(call BuildPackage,libpcap))