]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/dnsmasq/dnsmasq.mk
dnsmasq: bump to version 2.79
[coffee/buildroot.git] / package / dnsmasq / dnsmasq.mk
1 ################################################################################
2 #
3 # dnsmasq
4 #
5 ################################################################################
6
7 DNSMASQ_VERSION = 2.79
8 DNSMASQ_SOURCE = dnsmasq-$(DNSMASQ_VERSION).tar.xz
9 DNSMASQ_SITE = http://thekelleys.org.uk/dnsmasq
10 DNSMASQ_MAKE_ENV = $(TARGET_MAKE_ENV) CC="$(TARGET_CC)"
11 DNSMASQ_MAKE_OPTS = COPTS="$(DNSMASQ_COPTS)" PREFIX=/usr CFLAGS="$(TARGET_CFLAGS)"
12 DNSMASQ_MAKE_OPTS += DESTDIR=$(TARGET_DIR) LDFLAGS="$(TARGET_LDFLAGS)"
13 DNSMASQ_DEPENDENCIES = host-pkgconf
14 DNSMASQ_LICENSE = GPL-2.0 or GPL-3.0
15 DNSMASQ_LICENSE_FILES = COPYING COPYING-v3
16
17 ifneq ($(BR2_PACKAGE_DNSMASQ_DHCP),y)
18 DNSMASQ_COPTS += -DNO_DHCP
19 endif
20
21 ifeq ($(BR2_PACKAGE_DNSMASQ_DNSSEC),y)
22 DNSMASQ_DEPENDENCIES += gmp nettle
23 DNSMASQ_COPTS += -DHAVE_DNSSEC
24 ifeq ($(BR2_STATIC_LIBS),y)
25 DNSMASQ_COPTS += -DHAVE_DNSSEC_STATIC
26 endif
27 endif
28
29 ifneq ($(BR2_PACKAGE_DNSMASQ_TFTP),y)
30 DNSMASQ_COPTS += -DNO_TFTP
31 endif
32
33 # NLS requires IDN so only enable it (i18n) when IDN is true
34 ifeq ($(BR2_PACKAGE_DNSMASQ_IDN),y)
35 DNSMASQ_DEPENDENCIES += libidn $(TARGET_NLS_DEPENDENCIES)
36 DNSMASQ_MAKE_OPTS += LIBS+=$(TARGET_NLS_LIBS)
37 DNSMASQ_COPTS += -DHAVE_IDN
38 DNSMASQ_I18N = $(if $(BR2_SYSTEM_ENABLE_NLS),-i18n)
39 endif
40
41 ifeq ($(BR2_PACKAGE_DNSMASQ_CONNTRACK),y)
42 DNSMASQ_DEPENDENCIES += libnetfilter_conntrack
43 DNSMASQ_COPTS += -DHAVE_CONNTRACK
44 endif
45
46 ifeq ($(BR2_PACKAGE_DNSMASQ_LUA),y)
47 DNSMASQ_DEPENDENCIES += lua
48 DNSMASQ_COPTS += -DHAVE_LUASCRIPT
49
50 # liblua uses dlopen when dynamically linked
51 ifneq ($(BR2_STATIC_LIBS),y)
52 DNSMASQ_MAKE_OPTS += LIBS+="-ldl"
53 endif
54
55 define DNSMASQ_TWEAK_LIBLUA
56         $(SED) 's/lua5.2/lua/g' $(DNSMASQ_DIR)/Makefile
57 endef
58 endif
59
60 ifeq ($(BR2_PACKAGE_DBUS),y)
61 DNSMASQ_DEPENDENCIES += dbus
62 DNSMASQ_COPTS += -DHAVE_DBUS
63
64 define DNSMASQ_INSTALL_DBUS
65         $(INSTALL) -m 0644 -D $(@D)/dbus/dnsmasq.conf \
66                 $(TARGET_DIR)/etc/dbus-1/system.d/dnsmasq.conf
67 endef
68 endif
69
70 define DNSMASQ_FIX_PKGCONFIG
71         $(SED) 's^PKG_CONFIG = pkg-config^PKG_CONFIG = $(PKG_CONFIG_HOST_BINARY)^' \
72                 $(DNSMASQ_DIR)/Makefile
73 endef
74
75 define DNSMASQ_BUILD_CMDS
76         $(DNSMASQ_FIX_PKGCONFIG)
77         $(DNSMASQ_TWEAK_LIBLUA)
78         $(DNSMASQ_MAKE_ENV) $(MAKE) -C $(@D) $(DNSMASQ_MAKE_OPTS) all$(DNSMASQ_I18N)
79 endef
80
81 define DNSMASQ_INSTALL_TARGET_CMDS
82         $(DNSMASQ_MAKE_ENV) $(MAKE) -C $(@D) $(DNSMASQ_MAKE_OPTS) install$(DNSMASQ_I18N)
83         mkdir -p $(TARGET_DIR)/var/lib/misc/
84         $(DNSMASQ_INSTALL_DBUS)
85 endef
86
87 define DNSMASQ_INSTALL_INIT_SYSV
88         $(INSTALL) -m 755 -D package/dnsmasq/S80dnsmasq \
89                 $(TARGET_DIR)/etc/init.d/S80dnsmasq
90 endef
91
92 $(eval $(generic-package))