#! /usr/bin/make -f # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 export DEB_LDFLAGS_MAINT_APPEND = -lpthread debbuild=debian/build-deb udebbuild=debian/build-udeb include /usr/share/dpkg/architecture.mk CONFFILE=/etc/cdebconf.conf #package names LIBDEBCONFDEV=libdebconfclient0-dev LIBDEBCONF=libdebconfclient0 DEB_FRONTENDS=passthrough text newt gtk UDEB_FRONTENDS=passthrough text newt gtk ifneq ($(filter pkg.cdebconf.nogtk,$(DEB_BUILD_PROFILES)),) DEB_FRONTENDS:=$(filter-out gtk,$(DEB_FRONTENDS)) UDEB_FRONTENDS:=$(filter-out gtk,$(UDEB_FRONTENDS)) endif ifeq ($(DEB_HOST_ARCH_OS),linux) SELINUXFLAG=--enable-selinux else SELINUXFLAG=--disable-selinux endif SIZEOPTFLAG=-Os SPEEDOPTFLAG=-O2 DEBUG_CONFIGURE_OPT= ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) DEBUGOPTFLAG=-g SIZEOPTFLAG= SPEEDOPTFLAG= DEBUG_CONFIGURE_OPT=--with-debug=yes endif BUILDFLAGS_DEB=$(shell DEB_CFLAGS_MAINT_APPEND="$(DEBUGOPTFLAG) $(SPEEDOPTFLAG)" dpkg-buildflags --export=cmdline) BUILDFLAGS_UDEB=$(shell DEB_CFLAGS_MAINT_APPEND="$(DEBUGOPTFLAG) $(SIZEOPTFLAG) -fomit-frame-pointer" dpkg-buildflags --export=cmdline) %: dh $@ override_dh_auto_clean: dh_auto_clean -B$(debbuild) dh_auto_clean -B$(udebbuild) [ ! -f globalmakeflags ] || $(MAKE) -C src/test clean dh_auto_clean override_dh_auto_configure: dh_auto_configure -B$(debbuild) -- \ --libexecdir=\$${prefix}/lib \ --without-rpath \ --with-db="textdb rfc822db stack" \ --with-frontend="$(DEB_FRONTENDS)" \ --with-textwrap \ $(SELINUXFLAG) \ --with-conffile=$(CONFFILE) \ $(BUILDFLAGS_DEB) \ $(DEBUG_CONFIGURE_OPT) dh_auto_configure -B$(udebbuild) -- \ --libexecdir=\$${prefix}/lib \ --enable-d-i \ --without-rpath \ --with-db="rfc822db stack" \ --with-frontend="$(UDEB_FRONTENDS)" \ --with-default-frontend=newt \ --with-syslog-logging \ --with-textwrap \ --disable-selinux \ --with-conffile=$(CONFFILE) \ $(BUILDFLAGS_UDEB) \ $(DEBUG_CONFIGURE_OPT) override_dh_auto_build: dh_auto_build -B$(debbuild) dh_auto_build -B$(udebbuild) override_dh_auto_install: dh_auto_install -B$(debbuild) --destdir=$(CURDIR)/debian/tmp/deb dh_auto_install -B$(udebbuild) --destdir=$(CURDIR)/debian/tmp/udeb execute_after_dh_install: ifneq ($(filter pkg.cdebconf.nogtk,$(DEB_BUILD_PROFILES)),) # If the pkg.cdebconf.nogtk build profile is enabled and therefore # DEB_FRONTENDS doesn't include gtk, the main build system doesn't # automatically include cdebconf_gtk.h in the libdebconfclient0-dev # package. As we want libdebconfclient0-dev to have identical # contents whether the pkg.cdebconf.nogtk profile is used or not, we # need to explicitly install cdebconf_gtk.h if the pkg.cdebconf.nogtk # profile is enabled. dh_install -plibdebconfclient0-dev src/modules/frontend/gtk/cdebconf_gtk.h usr/include/cdebconf/ endif # Disable dh_dwz to match pre-dh d/rules sequence. override_dh_dwz: override_dh_makeshlibs: dh_makeshlibs --add-udeb=libdebconfclient0-udeb