#!/usr/bin/make -f include /usr/share/dpkg/pkg-info.mk include /usr/share/dpkg/architecture.mk include /usr/share/dpkg/buildflags.mk export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed MAKEARGS=V=1 \ DESTDIR=debian/haproxy \ PREFIX=/usr \ IGNOREGIT=true \ MANDIR=/usr/share/man \ DOCDIR=/usr/share/doc/haproxy \ USE_PCRE2=1 \ USE_PCRE2_JIT=1 \ USE_OPENSSL=1 \ USE_ZLIB=1 \ USE_LUA=1 \ LUA_INC=/usr/include/lua5.3 \ EXTRA_OBJS="contrib/prometheus-exporter/service-prometheus.o" ifeq ($(DEB_HOST_ARCH_OS),linux) MAKEARGS+= TARGET=linux-glibc USE_SYSTEMD=1 else ifeq ($(DEB_HOST_ARCH_OS),kfreebsd) MAKEARGS+= TARGET=freebsd else MAKEARGS+= TARGET=generic endif ifneq ($(filter amd64 i386,$(DEB_HOST_ARCH_CPU)),) MAKEARGS+= USE_REGPARM=1 endif ifneq ($(filter armel mips mipsel m68k powerpc powerpcspe sh4 riscv64,$(DEB_HOST_ARCH)),) MAKEARGS+= ADDLIB="-latomic -Wl,--no-as-needed -lgcc_s -Wl,--as-needed" else MAKEARGS+= ADDLIB="-Wl,--no-as-needed -lgcc_s -Wl,--as-needed" endif MAKEARGS += DEBUG_CFLAGS="$(CFLAGS) $(CPPFLAGS)" MAKEARGS += LDFLAGS="$(LDFLAGS)" MAKEARGS += VERSION="$(DEB_VERSION_UPSTREAM)" MAKEARGS += SUBVERS="-$(lastword $(subst -, ,$(DEB_VERSION)))" MAKEARGS += VERDATE="$(shell TZ=UTC date -d "@$(SOURCE_DATE_EPOCH)" "+%Y/%m/%d")" %: dh $@ --with sphinxdoc override_dh_auto_configure: override_dh_auto_build-arch: make $(MAKEARGS) make -C contrib/systemd $(MAKEARGS) dh_auto_build -Dcontrib/halog $(MAKE) -C doc/lua-api man override_dh_auto_build-indep: # Build the HTML documentation, after patching dconv patch -p1 < $(CURDIR)/debian/patches/debianize-dconv.patch for doc in intro configuration management; do \ python3 -B $(CURDIR)/debian/dconv/haproxy-dconv.py \ -i $(CURDIR)/doc/$${doc}.txt \ -o $(CURDIR)/doc/$${doc}.html ;\ done patch -p1 -R < $(CURDIR)/debian/patches/debianize-dconv.patch $(MAKE) -C doc/lua-api html override_dh_auto_clean: make -C contrib/systemd clean $(MAKE) -C doc/lua-api clean dh_auto_clean dh_auto_clean -Dcontrib/halog override_dh_auto_install-arch: make $(MAKEARGS) install install -m 0644 -D debian/rsyslog.conf debian/haproxy/etc/rsyslog.d/49-haproxy.conf install -m 0644 -D debian/logrotate.conf debian/haproxy/etc/logrotate.d/haproxy override_dh_auto_install-indep: override_dh_installdocs: dh_installdocs -Xsystemd/ -Xhalog/ override_dh_installexamples: dh_installexamples -X build.cfg override_dh_installinit: dh_installinit --no-restart-after-upgrade --no-stop-on-upgrade override_dh_installsystemd: dh_installsystemd --no-restart-after-upgrade --no-stop-on-upgrade override_dh_strip: dh_strip --dbgsym-migration="haproxy-dbg"