Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 1 | #!/usr/bin/make -f |
| 2 | # debian/rules file - for dnsmasq. |
Simon Kelley | 2a8710a | 2020-01-05 16:40:06 +0000 | [diff] [blame] | 3 | # Copyright 2001-2020 by Simon Kelley |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 4 | # Based on the sample in the debian hello package which carries the following: |
| 5 | # Copyright 1994,1995 by Ian Jackson. |
| 6 | # I hereby give you perpetual unlimited permission to copy, |
| 7 | # modify and relicense this file, provided that you do not remove |
| 8 | # my name from the file itself. (I assert my moral right of |
| 9 | # paternity under the Copyright, Designs and Patents Act 1988.) |
| 10 | # This file may have to be extensively modified |
| 11 | |
| 12 | package=dnsmasq-base |
| 13 | |
Simon Kelley | a24c31e | 2017-04-16 22:45:53 +0100 | [diff] [blame] | 14 | dpkg_buildflags := DEB_BUILD_MAINT_OPTIONS="hardening=+all,+pie,+bindnow" dpkg-buildflags |
Simon Ruderich | 91f4a5e | 2014-05-20 20:27:31 +0100 | [diff] [blame] | 15 | |
| 16 | CFLAGS = $(shell $(dpkg_buildflags) --get CFLAGS) |
| 17 | CFLAGS += $(shell $(dpkg_buildflags) --get CPPFLAGS) |
Simon Kelley | 97c83bb | 2012-05-28 18:21:59 +0100 | [diff] [blame] | 18 | CFLAGS += -Wall -W |
| 19 | |
Simon Ruderich | 91f4a5e | 2014-05-20 20:27:31 +0100 | [diff] [blame] | 20 | LDFLAGS = $(shell $(dpkg_buildflags) --get LDFLAGS) |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 21 | |
Simon Kelley | 8f6213c | 2014-01-28 11:16:49 +0000 | [diff] [blame] | 22 | DEB_COPTS = $(COPTS) |
Simon Kelley | 97c83bb | 2012-05-28 18:21:59 +0100 | [diff] [blame] | 23 | |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 24 | TARGET = install-i18n |
| 25 | |
Simon Kelley | 6ac3bc0 | 2014-10-03 08:48:11 +0100 | [diff] [blame] | 26 | DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) |
Simon Kelley | c6af3a3 | 2016-08-31 22:38:48 +0100 | [diff] [blame] | 27 | DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) |
| 28 | DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) |
Simon Kelley | 24e9207 | 2015-06-04 22:32:43 +0100 | [diff] [blame] | 29 | BUILD_DATE := $(shell dpkg-parsechangelog --show-field Date) |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 30 | |
Simon Kelley | c6af3a3 | 2016-08-31 22:38:48 +0100 | [diff] [blame] | 31 | ifeq ($(origin CC),default) |
| 32 | CC = $(DEB_HOST_GNU_TYPE)-gcc |
| 33 | endif |
| 34 | |
| 35 | # Support non-cross-builds on systems without gnu-triplet-binaries for pkg-config. |
| 36 | ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) |
| 37 | PKG_CONFIG=pkg-config |
| 38 | else |
| 39 | PKG_CONFIG=$(DEB_HOST_GNU_TYPE)-pkg-config |
| 40 | endif |
| 41 | |
Simon Kelley | 02ed24d | 2013-09-09 18:06:45 +0100 | [diff] [blame] | 42 | # Force package version based on git tags. |
| 43 | ifneq (,$(filter gitversion,$(DEB_BUILD_OPTIONS))) |
Simon Kelley | 1d1c795 | 2013-10-02 14:52:23 +0100 | [diff] [blame] | 44 | PACKAGE_VERSION = $(shell bld/get-version `pwd` | sed 's/test/~&/; s/[a-z]/~&/; s/-/./g; s/$$/-1/; s/^/-v/';) |
Simon Kelley | 02ed24d | 2013-09-09 18:06:45 +0100 | [diff] [blame] | 45 | endif |
| 46 | |
Simon Kelley | 6277978 | 2012-02-10 21:19:25 +0000 | [diff] [blame] | 47 | ifeq (,$(filter nodbus,$(DEB_BUILD_OPTIONS))) |
Simon Kelley | 8f6213c | 2014-01-28 11:16:49 +0000 | [diff] [blame] | 48 | DEB_COPTS += -DHAVE_DBUS |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 49 | endif |
| 50 | |
Simon Kelley | 43cdf1c | 2017-05-21 22:12:44 +0100 | [diff] [blame] | 51 | ifeq (,$(filter noidn, $(DEB_BUILD_OPTIONS))) |
Simon Kelley | 5a91334 | 2019-08-23 22:31:30 +0100 | [diff] [blame] | 52 | DEB_COPTS += -DHAVE_LIBIDN2 |
Simon Kelley | 43cdf1c | 2017-05-21 22:12:44 +0100 | [diff] [blame] | 53 | endif |
| 54 | |
Simon Kelley | 6277978 | 2012-02-10 21:19:25 +0000 | [diff] [blame] | 55 | ifeq (,$(filter noconntrack,$(DEB_BUILD_OPTIONS))) |
Simon Kelley | 6ac3bc0 | 2014-10-03 08:48:11 +0100 | [diff] [blame] | 56 | ifeq ($(DEB_HOST_ARCH_OS),linux) |
Simon Kelley | 8f6213c | 2014-01-28 11:16:49 +0000 | [diff] [blame] | 57 | DEB_COPTS += -DHAVE_CONNTRACK |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 58 | endif |
| 59 | endif |
| 60 | |
Simon Kelley | 3ddad24 | 2013-03-21 17:56:06 +0000 | [diff] [blame] | 61 | ifneq (,$(filter noipset,$(DEB_BUILD_OPTIONS))) |
Simon Kelley | 8f6213c | 2014-01-28 11:16:49 +0000 | [diff] [blame] | 62 | DEB_COPTS += -DNO_IPSET |
Simon Kelley | 3b323bd | 2013-02-22 21:55:29 +0000 | [diff] [blame] | 63 | endif |
| 64 | |
Simon Kelley | 96c3879 | 2012-02-16 20:07:17 +0000 | [diff] [blame] | 65 | ifneq (,$(filter nodhcp6,$(DEB_BUILD_OPTIONS))) |
Simon Kelley | 8f6213c | 2014-01-28 11:16:49 +0000 | [diff] [blame] | 66 | DEB_COPTS += -DNO_DHCP6 |
Simon Kelley | 127ea40 | 2012-02-11 22:14:52 +0000 | [diff] [blame] | 67 | endif |
| 68 | |
Simon Kelley | 6277978 | 2012-02-10 21:19:25 +0000 | [diff] [blame] | 69 | ifneq (,$(filter noipv6,$(DEB_BUILD_OPTIONS))) |
Simon Kelley | 8f6213c | 2014-01-28 11:16:49 +0000 | [diff] [blame] | 70 | DEB_COPTS += -DNO_IPV6 |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 71 | endif |
| 72 | |
Simon Kelley | 6277978 | 2012-02-10 21:19:25 +0000 | [diff] [blame] | 73 | ifneq (,$(filter notftp,$(DEB_BUILD_OPTIONS))) |
Simon Kelley | 8f6213c | 2014-01-28 11:16:49 +0000 | [diff] [blame] | 74 | DEB_COPTS += -DNO_TFTP |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 75 | endif |
| 76 | |
Simon Kelley | 6277978 | 2012-02-10 21:19:25 +0000 | [diff] [blame] | 77 | ifneq (,$(filter nodhcp,$(DEB_BUILD_OPTIONS))) |
Simon Kelley | 8f6213c | 2014-01-28 11:16:49 +0000 | [diff] [blame] | 78 | DEB_COPTS += -DNO_DHCP |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 79 | endif |
| 80 | |
Simon Kelley | 6277978 | 2012-02-10 21:19:25 +0000 | [diff] [blame] | 81 | ifneq (,$(filter noscript,$(DEB_BUILD_OPTIONS))) |
Simon Kelley | 8f6213c | 2014-01-28 11:16:49 +0000 | [diff] [blame] | 82 | DEB_COPTS += -DNO_SCRIPT |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 83 | endif |
| 84 | |
Simon Kelley | 6277978 | 2012-02-10 21:19:25 +0000 | [diff] [blame] | 85 | ifneq (,$(filter nortc,$(DEB_BUILD_OPTIONS))) |
Simon Kelley | 8f6213c | 2014-01-28 11:16:49 +0000 | [diff] [blame] | 86 | DEB_COPTS += -DHAVE_BROKEN_RTC |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 87 | endif |
| 88 | |
Simon Kelley | 6277978 | 2012-02-10 21:19:25 +0000 | [diff] [blame] | 89 | ifneq (,$(filter noi18n,$(DEB_BUILD_OPTIONS))) |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 90 | TARGET = install |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 91 | endif |
| 92 | |
Simon Kelley | 6277978 | 2012-02-10 21:19:25 +0000 | [diff] [blame] | 93 | ifneq (,$(filter uselua,$(DEB_BUILD_OPTIONS))) |
Simon Kelley | 8f6213c | 2014-01-28 11:16:49 +0000 | [diff] [blame] | 94 | DEB_COPTS += -DHAVE_LUASCRIPT |
Simon Kelley | 6277978 | 2012-02-10 21:19:25 +0000 | [diff] [blame] | 95 | endif |
| 96 | |
Simon Kelley | 160f650 | 2014-02-04 16:49:41 +0000 | [diff] [blame] | 97 | ifeq (,$(filter nodnssec,$(DEB_BUILD_OPTIONS))) |
Simon Kelley | 8f6213c | 2014-01-28 11:16:49 +0000 | [diff] [blame] | 98 | DEB_COPTS += -DHAVE_DNSSEC |
Simon Kelley | 00ec693 | 2014-01-28 11:08:57 +0000 | [diff] [blame] | 99 | endif |
| 100 | |
Simon Kelley | 00fe2f4 | 2020-04-19 21:59:13 +0100 | [diff] [blame] | 101 | ifeq ($(DEB_HOST_ARCH_OS),kfreebsd) |
Simon Kelley | 6ac3bc0 | 2014-10-03 08:48:11 +0100 | [diff] [blame] | 102 | # For strlcpy in FreeBSD |
Simon Kelley | 00fe2f4 | 2020-04-19 21:59:13 +0100 | [diff] [blame] | 103 | LIBS += $(shell ${PKG_CONFIG} --libs libbsd-overlay) |
| 104 | CFLAGS += $(shell ${PKG_CONFIG} --cflags libbsd-overlay) |
Simon Kelley | 6ac3bc0 | 2014-10-03 08:48:11 +0100 | [diff] [blame] | 105 | endif |
| 106 | |
Simon Kelley | 30e4a94 | 2018-02-16 19:56:56 +0000 | [diff] [blame] | 107 | define build_tree |
| 108 | rm -rf $1 |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 109 | install -m 755 \ |
Simon Kelley | 30e4a94 | 2018-02-16 19:56:56 +0000 | [diff] [blame] | 110 | -d $1/DEBIAN \ |
| 111 | -d $1/etc/dbus-1/system.d \ |
| 112 | -d $1/usr/share/doc/$(package) \ |
| 113 | -d $1/usr/share/doc/$(package)/examples \ |
| 114 | -d $1/usr/share/$(package) \ |
| 115 | -d $1/var/lib/misc |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 116 | |
Simon Kelley | 30e4a94 | 2018-02-16 19:56:56 +0000 | [diff] [blame] | 117 | endef |
| 118 | |
| 119 | define add_docs |
Simon Kelley | 933878f | 2014-09-09 14:28:01 +0100 | [diff] [blame] | 120 | # Need to remove paypal links in Debian Package for policy reasons. |
Simon Kelley | 30e4a94 | 2018-02-16 19:56:56 +0000 | [diff] [blame] | 121 | sed -e /\<H2\>Donations/Q -e /icon.png/d doc.html -e /favicon.ico/d >$1/usr/share/doc/$(package)/doc.html |
| 122 | echo "</BODY>" >>$1/usr/share/doc/$(package)/doc.html |
| 123 | install -m 644 setup.html $1/usr/share/doc/$(package)/. |
| 124 | install -m 644 dnsmasq.conf.example $1/usr/share/doc/$(package)/examples/. |
| 125 | install -m 644 FAQ $1/usr/share/doc/$(package)/. |
| 126 | gzip -9n $1/usr/share/doc/$(package)/FAQ |
| 127 | install -m 644 CHANGELOG $1/usr/share/doc/$(package)/changelog |
| 128 | gzip -9n $1/usr/share/doc/$(package)/changelog |
| 129 | install -m 644 CHANGELOG.archive $1/usr/share/doc/$(package)/changelog.archive |
| 130 | gzip -9n $1/usr/share/doc/$(package)/changelog.archive |
| 131 | install -m 644 dbus/DBus-interface $1/usr/share/doc/$(package)/. |
| 132 | gzip -9n $1/usr/share/doc/$(package)/DBus-interface |
Simon Kelley | 343b7b4 | 2019-04-08 16:50:13 +0100 | [diff] [blame] | 133 | install -m 644 debian/systemd_howto $1/usr/share/doc/$(package)/. |
| 134 | gzip -9n $1/usr/share/doc/$(package)/systemd_howto |
Simon Kelley | 30e4a94 | 2018-02-16 19:56:56 +0000 | [diff] [blame] | 135 | gzip -9n $1/usr/share/man/man8/dnsmasq.8 |
| 136 | for f in $1/usr/share/man/*; do \ |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 137 | if [ -f $$f/man8/dnsmasq.8 ]; then \ |
Chris Lamb | b467a45 | 2015-02-09 11:52:30 +0000 | [diff] [blame] | 138 | gzip -9n $$f/man8/dnsmasq.8 ; \ |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 139 | fi \ |
| 140 | done |
Simon Kelley | 30e4a94 | 2018-02-16 19:56:56 +0000 | [diff] [blame] | 141 | endef |
| 142 | |
| 143 | define add_files |
| 144 | install -m 644 trust-anchors.conf $1/usr/share/$(package)/. |
| 145 | install -m 644 debian/dnsmasq-base.conffiles $1/DEBIAN/conffiles |
| 146 | install -m 755 debian/dnsmasq-base.postinst $1/DEBIAN/postinst |
| 147 | install -m 755 debian/dnsmasq-base.postrm $1/DEBIAN/postrm |
| 148 | install -m 644 debian/changelog $1/usr/share/doc/$(package)/changelog.Debian |
| 149 | gzip -9n $1/usr/share/doc/$(package)/changelog.Debian |
| 150 | install -m 644 debian/readme $1/usr/share/doc/$(package)/README.Debian |
| 151 | install -m 644 debian/copyright $1/usr/share/doc/$(package)/copyright |
| 152 | install -m 644 debian/dbus.conf $1/etc/dbus-1/system.d/dnsmasq.conf |
| 153 | endef |
| 154 | |
| 155 | clean: |
| 156 | $(checkdir) |
| 157 | make BUILDDIR=debian/build/no-lua clean |
| 158 | make BUILDDIR=debian/build/lua clean |
| 159 | make -C contrib/lease-tools clean |
| 160 | rm -rf debian/build debian/trees debian/*~ debian/files debian/substvars debian/utils-substvars |
| 161 | |
| 162 | binary-indep: checkroot |
| 163 | $(checkdir) |
| 164 | rm -rf debian/trees/daemon |
| 165 | install -m 755 \ |
| 166 | -d debian/trees/daemon/DEBIAN \ |
Simon Kelley | 343b7b4 | 2019-04-08 16:50:13 +0100 | [diff] [blame] | 167 | -d debian/trees/daemon/usr/share/doc/dnsmasq \ |
Simon Kelley | 30e4a94 | 2018-02-16 19:56:56 +0000 | [diff] [blame] | 168 | -d debian/trees/daemon/etc/init.d \ |
| 169 | -d debian/trees/daemon/etc/dnsmasq.d \ |
| 170 | -d debian/trees/daemon/etc/resolvconf/update.d \ |
| 171 | -d debian/trees/daemon/usr/lib/resolvconf/dpkg-event.d \ |
| 172 | -d debian/trees/daemon/usr/share/dnsmasq \ |
Simon Kelley | ec2067d | 2020-04-12 16:09:19 +0100 | [diff] [blame] | 173 | -d debian/trees/daemon/usr/share/doc/dnsmasq \ |
Simon Kelley | 30e4a94 | 2018-02-16 19:56:56 +0000 | [diff] [blame] | 174 | -d debian/trees/daemon/etc/default \ |
| 175 | -d debian/trees/daemon/lib/systemd/system \ |
Simon Kelley | 118011f | 2018-09-17 23:15:37 +0100 | [diff] [blame] | 176 | -d debian/trees/daemon/usr/lib/tmpfiles.d \ |
Simon Kelley | 30e4a94 | 2018-02-16 19:56:56 +0000 | [diff] [blame] | 177 | -d debian/trees/daemon/etc/insserv.conf.d |
| 178 | install -m 644 debian/conffiles debian/trees/daemon/DEBIAN |
| 179 | install -m 755 debian/postinst debian/postrm debian/prerm debian/trees/daemon/DEBIAN |
Simon Kelley | 837e8f4 | 2020-06-26 22:13:27 +0100 | [diff] [blame] | 180 | if ! dpkg-vendor --derives-from Ubuntu; then \ |
| 181 | rm -f debian/dnsmasq.postinst.debhelper debian/dnsmasq.postrm.debhelper; \ |
| 182 | dh_runit -pdnsmasq -Pdebian/trees/daemon; \ |
| 183 | cat debian/dnsmasq.postinst.debhelper >> debian/trees/daemon/DEBIAN/postinst; \ |
| 184 | cat debian/dnsmasq.postrm.debhelper >> debian/trees/daemon/DEBIAN/postrm; \ |
| 185 | cd debian/trees/daemon && find etc/sv -type f -printf '/%p\n' >>DEBIAN/conffiles; \ |
| 186 | fi |
Simon Kelley | 30e4a94 | 2018-02-16 19:56:56 +0000 | [diff] [blame] | 187 | install -m 755 debian/init debian/trees/daemon/etc/init.d/dnsmasq |
| 188 | install -m 755 debian/resolvconf debian/trees/daemon/etc/resolvconf/update.d/dnsmasq |
| 189 | install -m 755 debian/resolvconf-package debian/trees/daemon/usr/lib/resolvconf/dpkg-event.d/dnsmasq |
| 190 | install -m 644 debian/installed-marker debian/trees/daemon/usr/share/dnsmasq |
| 191 | install -m 644 debian/default debian/trees/daemon/etc/default/dnsmasq |
| 192 | install -m 644 dnsmasq.conf.example debian/trees/daemon/etc/dnsmasq.conf |
| 193 | install -m 644 debian/readme.dnsmasq.d debian/trees/daemon/etc/dnsmasq.d/README |
| 194 | install -m 644 debian/systemd.service debian/trees/daemon/lib/systemd/system/dnsmasq.service |
Simon Kelley | 343b7b4 | 2019-04-08 16:50:13 +0100 | [diff] [blame] | 195 | install -m 644 debian/systemd@.service debian/trees/daemon/lib/systemd/system/dnsmasq@.service |
Simon Kelley | 118011f | 2018-09-17 23:15:37 +0100 | [diff] [blame] | 196 | install -m 644 debian/tmpfiles.conf debian/trees/daemon/usr/lib/tmpfiles.d/dnsmasq.conf |
Simon Kelley | 30e4a94 | 2018-02-16 19:56:56 +0000 | [diff] [blame] | 197 | install -m 644 debian/insserv debian/trees/daemon/etc/insserv.conf.d/dnsmasq |
Simon Kelley | ec2067d | 2020-04-12 16:09:19 +0100 | [diff] [blame] | 198 | install -m 644 debian/copyright debian/trees/daemon/usr/share/doc/dnsmasq/copyright |
| 199 | install -m 644 debian/changelog debian/trees/daemon/usr/share/doc/dnsmasq/changelog.Debian |
| 200 | gzip -9n debian/trees/daemon/usr/share/doc/dnsmasq/changelog.Debian |
Simon Kelley | 30e4a94 | 2018-02-16 19:56:56 +0000 | [diff] [blame] | 201 | cd debian/trees/daemon && find . -type f ! -regex '.*DEBIAN/.*' -printf '%P\0' | LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums |
Simon Kelley | 92025a4 | 2020-02-29 22:56:38 +0000 | [diff] [blame] | 202 | dpkg-gencontrol $(PACKAGE_VERSION) -Tdebian/dnsmasq.substvars -pdnsmasq -Pdebian/trees/daemon |
Simon Kelley | 30e4a94 | 2018-02-16 19:56:56 +0000 | [diff] [blame] | 203 | find debian/trees/daemon -depth -newermt '$(BUILD_DATE)' -print0 | xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 204 | chown -R root.root debian/trees/daemon |
| 205 | chmod -R g-ws debian/trees/daemon |
| 206 | dpkg --build debian/trees/daemon .. |
| 207 | |
| 208 | binary-arch: checkroot |
| 209 | $(call build_tree,debian/trees/base) |
Simon Kelley | 00fe2f4 | 2020-04-19 21:59:13 +0100 | [diff] [blame] | 210 | make $(TARGET) BUILDDIR=debian/build/no-lua PREFIX=/usr DESTDIR=`pwd`/debian/trees/base CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" COPTS="$(DEB_COPTS)" CC=$(CC) PKG_CONFIG=$(PKG_CONFIG) LIBS="$(LIBS)" |
Simon Kelley | 5d514f2 | 2019-03-01 16:52:02 +0000 | [diff] [blame] | 211 | ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS))) |
Simon Kelley | 30e4a94 | 2018-02-16 19:56:56 +0000 | [diff] [blame] | 212 | $(call add_docs,debian/trees/base) |
| 213 | else |
| 214 | rm -rf debian/trees/base/usr/share/man |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 215 | endif |
Simon Kelley | 30e4a94 | 2018-02-16 19:56:56 +0000 | [diff] [blame] | 216 | $(call add_files,debian/trees/base) |
| 217 | ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) |
| 218 | $(DEB_HOST_GNU_TYPE)-strip -R .note -R .comment debian/trees/base/usr/sbin/dnsmasq |
| 219 | endif |
| 220 | cd debian/trees/base && find . -type f ! -regex '.*DEBIAN/.*' -printf '%P\0' | LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums |
| 221 | dpkg-shlibdeps --warnings=1 debian/trees/base/usr/sbin/dnsmasq |
| 222 | dpkg-gencontrol $(PACKAGE_VERSION) -pdnsmasq-base -Pdebian/trees/base |
| 223 | find debian/trees/base -depth -newermt '$(BUILD_DATE)' -print0 | xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 224 | chown -R root.root debian/trees/base |
| 225 | chmod -R g-ws debian/trees/base |
| 226 | dpkg --build debian/trees/base .. |
| 227 | |
| 228 | $(call build_tree,debian/trees/lua-base) |
Simon Kelley | 00fe2f4 | 2020-04-19 21:59:13 +0100 | [diff] [blame] | 229 | make $(TARGET) BUILDDIR=debian/build/lua PREFIX=/usr DESTDIR=`pwd`/debian/trees/lua-base CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" COPTS="-DHAVE_LUASCRIPT $(DEB_COPTS)" CC=$(CC) PKG_CONFIG=$(PKG_CONFIG) LIBS="$(LIBS)" |
Simon Kelley | 5d514f2 | 2019-03-01 16:52:02 +0000 | [diff] [blame] | 230 | ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS))) |
Simon Kelley | 30e4a94 | 2018-02-16 19:56:56 +0000 | [diff] [blame] | 231 | $(call add_docs,debian/trees/lua-base) |
| 232 | else |
| 233 | rm -rf debian/trees/lua-base/usr/share/man |
| 234 | endif |
| 235 | $(call add_files,debian/trees/lua-base) |
Simon Kelley | 9a7be47 | 2018-03-23 20:43:53 +0000 | [diff] [blame] | 236 | install -m 755 -d debian/trees/lua-base/usr/share/lintian/overrides |
| 237 | install -m 644 debian/lintian-override debian/trees/lua-base/usr/share/lintian/overrides/dnsmasq-base-lua |
Simon Kelley | 30e4a94 | 2018-02-16 19:56:56 +0000 | [diff] [blame] | 238 | ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) |
| 239 | $(DEB_HOST_GNU_TYPE)-strip -R .note -R .comment debian/trees/lua-base/usr/sbin/dnsmasq |
| 240 | endif |
Simon Kelley | 26e27d0 | 2018-03-18 17:29:12 +0000 | [diff] [blame] | 241 | ln -s $(package) debian/trees/lua-base/usr/share/doc/dnsmasq-base-lua |
Simon Kelley | 30e4a94 | 2018-02-16 19:56:56 +0000 | [diff] [blame] | 242 | cd debian/trees/lua-base && find . -type f ! -regex '.*DEBIAN/.*' -printf '%P\0' | LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums |
| 243 | dpkg-shlibdeps --warnings=1 debian/trees/lua-base/usr/sbin/dnsmasq |
| 244 | dpkg-gencontrol $(PACKAGE_VERSION) -pdnsmasq-base-lua -Pdebian/trees/lua-base |
| 245 | find debian/trees/lua-base -depth -newermt '$(BUILD_DATE)' -print0 | xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 246 | chown -R root.root debian/trees/lua-base |
| 247 | chmod -R g-ws debian/trees/lua-base |
| 248 | dpkg --build debian/trees/lua-base .. |
| 249 | |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 250 | |
Simon Kelley | 6ac3bc0 | 2014-10-03 08:48:11 +0100 | [diff] [blame] | 251 | ifeq ($(DEB_HOST_ARCH_OS),linux) |
Simon Kelley | 30e4a94 | 2018-02-16 19:56:56 +0000 | [diff] [blame] | 252 | rm -rf debian/trees/utils |
| 253 | install -m 755 -d debian/trees/utils/DEBIAN \ |
| 254 | -d debian/trees/utils/usr/bin \ |
| 255 | -d debian/trees/utils/usr/share/doc/dnsmasq-utils |
Simon Kelley | 5d514f2 | 2019-03-01 16:52:02 +0000 | [diff] [blame] | 256 | ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS))) |
Simon Kelley | 30e4a94 | 2018-02-16 19:56:56 +0000 | [diff] [blame] | 257 | install -m 755 -d debian/trees/utils/usr/share/man/man1 |
| 258 | endif |
Simon Kelley | 00fe2f4 | 2020-04-19 21:59:13 +0100 | [diff] [blame] | 259 | make -C contrib/lease-tools PREFIX=/usr DESTDIR=`pwd`/debian/trees/utils CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" COPTS="$(DEB_COPTS)" CC=$(CC) PKG_CONFIG=$(PKG_CONFIG) LIBS="$(LIBS)" |
Simon Kelley | 30e4a94 | 2018-02-16 19:56:56 +0000 | [diff] [blame] | 260 | install -m 755 contrib/lease-tools/dhcp_release debian/trees/utils/usr/bin/dhcp_release |
| 261 | install -m 755 contrib/lease-tools/dhcp_release6 debian/trees/utils/usr/bin/dhcp_release6 |
| 262 | install -m 755 contrib/lease-tools/dhcp_lease_time debian/trees/utils/usr/bin/dhcp_lease_time |
Simon Kelley | 5d514f2 | 2019-03-01 16:52:02 +0000 | [diff] [blame] | 263 | ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS))) |
Simon Kelley | 30e4a94 | 2018-02-16 19:56:56 +0000 | [diff] [blame] | 264 | install -m 644 contrib/lease-tools/dhcp_release.1 debian/trees/utils/usr/share/man/man1/dhcp_release.1 |
| 265 | gzip -9n debian/trees/utils/usr/share/man/man1/dhcp_release.1 |
| 266 | install -m 644 contrib/lease-tools/dhcp_release6.1 debian/trees/utils/usr/share/man/man1/dhcp_release6.1 |
| 267 | gzip -9n debian/trees/utils/usr/share/man/man1/dhcp_release6.1 |
| 268 | install -m 644 contrib/lease-tools/dhcp_lease_time.1 debian/trees/utils/usr/share/man/man1/dhcp_lease_time.1 |
| 269 | gzip -9n debian/trees/utils/usr/share/man/man1/dhcp_lease_time.1 |
| 270 | endif |
| 271 | install -m 644 debian/copyright debian/trees/utils/usr/share/doc/dnsmasq-utils/copyright |
| 272 | install -m 644 debian/changelog debian/trees/utils/usr/share/doc/dnsmasq-utils/changelog.Debian |
| 273 | gzip -9n debian/trees/utils/usr/share/doc/dnsmasq-utils/changelog.Debian |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 274 | ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) |
Simon Kelley | 30e4a94 | 2018-02-16 19:56:56 +0000 | [diff] [blame] | 275 | $(DEB_HOST_GNU_TYPE)-strip -R .note -R .comment debian/trees/utils/usr/bin/dhcp_release |
| 276 | $(DEB_HOST_GNU_TYPE)-strip -R .note -R .comment debian/trees/utils/usr/bin/dhcp_release6 |
| 277 | $(DEB_HOST_GNU_TYPE)-strip -R .note -R .comment debian/trees/utils/usr/bin/dhcp_lease_time |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 278 | endif |
Simon Kelley | 30e4a94 | 2018-02-16 19:56:56 +0000 | [diff] [blame] | 279 | cd debian/trees/utils && find . -type f ! -regex '.*DEBIAN/.*' -printf '%P\0' | LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums |
| 280 | dpkg-shlibdeps -Tdebian/utils-substvars debian/trees/utils/usr/bin/dhcp_release debian/trees/utils/usr/bin/dhcp_release6 debian/trees/utils/usr/bin/dhcp_lease_time |
| 281 | dpkg-gencontrol $(PACKAGE_VERSION) -Tdebian/utils-substvars -pdnsmasq-utils -Pdebian/trees/utils |
| 282 | find debian/trees/utils -depth -newermt '$(BUILD_DATE)' -print0 | xargs -0r touch --no-dereference --date='$(BUILD_DATE)' |
| 283 | chown -R root.root debian/trees/utils |
| 284 | chmod -R g-ws debian/trees/utils |
| 285 | dpkg --build debian/trees/utils .. |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 286 | endif |
| 287 | |
| 288 | define checkdir |
| 289 | test -f Makefile -a -f debian/rules |
| 290 | endef |
| 291 | |
| 292 | # Below here is fairly generic really |
| 293 | |
| 294 | binary: binary-arch binary-indep |
Simon Kelley | 760169f | 2012-03-09 14:27:49 +0000 | [diff] [blame] | 295 | |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 296 | build: |
Simon Kelley | 760169f | 2012-03-09 14:27:49 +0000 | [diff] [blame] | 297 | build-arch: |
| 298 | build-indep: |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 299 | |
| 300 | checkroot: |
| 301 | test root = "`whoami`" |
| 302 | |
| 303 | .PHONY: binary binary-arch binary-indep clean checkroot |
| 304 | |
| 305 | |