treewide: remove BUILD_PARALLEL from CMake packages
[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.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
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 CMAKE_OPTIONS += \
47 -DBUILD_SHARED_LIBS=ON \
48 -DBUILD_WITH_LIBNL=OFF \
49 -DINET6=O$(if $(CONFIG_IPV6),N,FF) \
50 -DPCAP_SUPPORT_NETFILTER=O$(if $(CONFIG_PCAP_HAS_NETFILTER),N,FF)
51
52 # grep 'option(DISABLE_' CMakeLists.txt | cut -f2 -d'(' | cut -f1 -d' ' | sort --unique
53 CMAKE_OPTIONS += \
54 -DDISABLE_BLUETOOTH=O$(if $(CONFIG_PCAP_HAS_BT),FF,N) \
55 -DDISABLE_DAG=ON \
56 -DDISABLE_DBUS=ON \
57 -DDISABLE_DPDK=ON \
58 -DDISABLE_LINUX_USBMON=O$(if $(CONFIG_PCAP_HAS_USB),FF,N) \
59 -DDISABLE_NETMAP=ON \
60 -DDISABLE_RDMA=ON \
61 -DDISABLE_SEPTEL=ON \
62 -DDISABLE_SNF=ON \
63 -DDISABLE_TC=ON \
64
65 # Debugging options
66 CMAKE_OPTIONS += \
67 -DBDEBUG=OFF \
68 -DYYDEBUG=OFF \
69
70 define Build/InstallDev
71 $(call Build/InstallDev/cmake,$(1))
72 $(SED) \
73 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
74 $(1)/usr/bin/pcap-config
75 $(INSTALL_DIR) $(2)/bin
76 $(LN) ../../usr/bin/pcap-config $(2)/bin/pcap-config
77 endef
78
79 define Package/libpcap/install
80 $(INSTALL_DIR) $(1)/usr/lib
81 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so.* $(1)/usr/lib/
82 endef
83
84 $(eval $(call BuildPackage,libpcap))