#!/usr/bin/make -f # debian/rules file - for dnsmasq. # Copyright 2001-2020 by Simon Kelley # Based on the sample in the debian hello package which carries the following: # Copyright 1994,1995 by Ian Jackson. # I hereby give you perpetual unlimited permission to copy, # modify and relicense this file, provided that you do not remove # my name from the file itself. (I assert my moral right of # paternity under the Copyright, Designs and Patents Act 1988.) # This file may have to be extensively modified package=dnsmasq-base dpkg_buildflags := DEB_BUILD_MAINT_OPTIONS="hardening=+all,+pie,+bindnow" dpkg-buildflags CFLAGS = $(shell $(dpkg_buildflags) --get CFLAGS) CFLAGS += $(shell $(dpkg_buildflags) --get CPPFLAGS) CFLAGS += -Wall -W LDFLAGS = $(shell $(dpkg_buildflags) --get LDFLAGS) DEB_COPTS = $(COPTS) TARGET = install-i18n DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) BUILD_DATE := $(shell dpkg-parsechangelog --show-field Date) ifeq ($(origin CC),default) CC = $(DEB_HOST_GNU_TYPE)-gcc endif # Support non-cross-builds on systems without gnu-triplet-binaries for pkg-config. ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) PKG_CONFIG=pkg-config else PKG_CONFIG=$(DEB_HOST_GNU_TYPE)-pkg-config endif # Force package version based on git tags. ifneq (,$(filter gitversion,$(DEB_BUILD_OPTIONS))) PACKAGE_VERSION = $(shell bld/get-version `pwd` | sed 's/test/~&/; s/[a-z]/~&/; s/-/./g; s/$$/-1/; s/^/-v/';) endif ifeq (,$(filter nodbus,$(DEB_BUILD_OPTIONS))) DEB_COPTS += -DHAVE_DBUS endif ifeq (,$(filter noidn, $(DEB_BUILD_OPTIONS))) DEB_COPTS += -DHAVE_LIBIDN2 endif ifeq (,$(filter noconntrack,$(DEB_BUILD_OPTIONS))) ifeq ($(DEB_HOST_ARCH_OS),linux) DEB_COPTS += -DHAVE_CONNTRACK endif endif ifneq (,$(filter noipset,$(DEB_BUILD_OPTIONS))) DEB_COPTS += -DNO_IPSET endif ifneq (,$(filter nodhcp6,$(DEB_BUILD_OPTIONS))) DEB_COPTS += -DNO_DHCP6 endif ifneq (,$(filter noipv6,$(DEB_BUILD_OPTIONS))) DEB_COPTS += -DNO_IPV6 endif ifneq (,$(filter notftp,$(DEB_BUILD_OPTIONS))) DEB_COPTS += -DNO_TFTP endif ifneq (,$(filter nodhcp,$(DEB_BUILD_OPTIONS))) DEB_COPTS += -DNO_DHCP endif ifneq (,$(filter noscript,$(DEB_BUILD_OPTIONS))) DEB_COPTS += -DNO_SCRIPT endif ifneq (,$(filter nortc,$(DEB_BUILD_OPTIONS))) DEB_COPTS += -DHAVE_BROKEN_RTC endif ifneq (,$(filter noi18n,$(DEB_BUILD_OPTIONS))) TARGET = install endif ifneq (,$(filter uselua,$(DEB_BUILD_OPTIONS))) DEB_COPTS += -DHAVE_LUASCRIPT endif ifeq (,$(filter nodnssec,$(DEB_BUILD_OPTIONS))) DEB_COPTS += -DHAVE_DNSSEC endif ifeq ($(DEB_HOST_ARCH_OS),kfreebsd) # For strlcpy in FreeBSD LIBS += $(shell ${PKG_CONFIG} --libs libbsd-overlay) CFLAGS += $(shell ${PKG_CONFIG} --cflags libbsd-overlay) endif define build_tree rm -rf $1 install -m 755 \ -d $1/DEBIAN \ -d $1/etc/dbus-1/system.d \ -d $1/usr/share/doc/$(package) \ -d $1/usr/share/doc/$(package)/examples \ -d $1/usr/share/$(package) \ -d $1/var/lib/misc endef define add_docs # Need to remove paypal links in Debian Package for policy reasons. sed -e /\