avahi: backport CVE fixes from upstream
[feed/packages.git] / libs / getdns / Makefile
1 # This is free software, licensed under the GNU General Public License v2.
2 # See /LICENSE for more information.
3 #
4
5 include $(TOPDIR)/rules.mk
6
7 PKG_NAME:=getdns
8 PKG_VERSION:=1.7.3
9 PKG_RELEASE:=2
10
11 PKG_LICENSE:=BSD-3-Clause
12 PKG_LICENSE_FILES:=LICENSE
13 PKG_MAINTAINER:=
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=https://getdnsapi.net/dist/
17 PKG_HASH:=f1404ca250f02e37a118aa00cf0ec2cbe11896e060c6d369c6761baea7d55a2c
18
19 CMAKE_INSTALL:=1
20
21 PKG_CONFIG_DEPENDS:= \
22 CONFIG_GETDNS_BUILD_LIBEVENT2 \
23 CONFIG_GETDNS_ENABLE_STUB_ONLY \
24 CONFIG_GETDNS_ENABLE_IDN_LIBIDN2
25
26 include $(INCLUDE_DIR)/package.mk
27 include $(INCLUDE_DIR)/cmake.mk
28
29 define Package/getdns/Default
30 TITLE:=getdns
31 URL:=https://getdnsapi.net/
32 endef
33
34 define Package/getdns
35 $(call Package/getdns/Default)
36 SECTION:=libs
37 CATEGORY:=Libraries
38 TITLE+= (library)
39 DEPENDS+= +libopenssl +GETDNS_BUILD_LIBEVENT2:libevent2 +!GETDNS_ENABLE_STUB_ONLY:libunbound +GETDNS_ENABLE_IDN_LIBIDN2:libidn2
40 MENU:=1
41 endef
42
43 define Package/getdns/description
44 This package contains the getdns library (libgetdns).
45 This package also contains the "getdns_query" command line wrapper for getdns exposing the features of this implementation (both in the official API and the additional API functions).
46 endef
47
48 define Package/getdns/config
49 source "$(SOURCE)/Config.in"
50 endef
51
52 # CMAKE options for GetDNS are described in this document:
53 # https://getdnsapi.net/quick-start/cmake-quick-start/
54 CMAKE_OPTIONS += -DBUILD_LIBEV=OFF
55 CMAKE_OPTIONS += -DBUILD_LIBUV=OFF
56
57 CMAKE_OPTIONS += -DBUILD_LIBEVENT2=$(if $(CONFIG_GETDNS_BUILD_LIBEVENT2),ON,OFF)
58 CMAKE_OPTIONS += -DENABLE_STUB_ONLY=$(if $(CONFIG_GETDNS_ENABLE_STUB_ONLY),ON,OFF)
59 CMAKE_OPTIONS += -DUSE_LIBIDN2=$(if $(CONFIG_GETDNS_ENABLE_IDN_LIBIDN2),ON,OFF)
60
61 # getdns will use libbsd for the functions inet_pton, inet_ntop, strlcpy if
62 # present, otherwise it will use builtin code for these functions. In order to
63 # force the use of the built in code and remove the libbsd dependency disable
64 # the test for libbsd.
65 CMAKE_OPTIONS += -DBSD_LIBRARY=OFF
66
67 # Disable static linking to ensure that utility programs such as getdns_query
68 # don't end up as large statically linked binaries.
69 CMAKE_OPTIONS += -DENABLE_STATIC=OFF
70 CMAKE_OPTIONS += -DENABLE_SHARED=ON # This is the default
71
72 define Package/getdns/install
73 $(INSTALL_DIR) $(1)/usr/lib
74 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgetdns.so.* $(1)/usr/lib/
75 $(INSTALL_DIR) $(1)/usr/sbin
76 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/getdns_query $(1)/usr/sbin/getdns_query
77 endef
78
79 $(eval $(call BuildPackage,getdns))