| 1 |
#! /usr/bin/make -f |
| 2 |
# Sample debian/rules that uses debhelper. |
| 3 |
# GNU copyright 1997 to 1999 by Joey Hess. |
| 4 |
|
| 5 |
# Uncomment this to turn on verbose mode. |
| 6 |
#export DH_VERBOSE=1 |
| 7 |
|
| 8 |
export DEB_LDFLAGS_MAINT_APPEND = -lpthread |
| 9 |
|
| 10 |
debbuild=debian/build-deb |
| 11 |
udebbuild=debian/build-udeb |
| 12 |
|
| 13 |
include /usr/share/dpkg/architecture.mk |
| 14 |
|
| 15 |
CONFFILE=/etc/cdebconf.conf |
| 16 |
|
| 17 |
#package names |
| 18 |
LIBDEBCONFDEV=libdebconfclient0-dev |
| 19 |
LIBDEBCONF=libdebconfclient0 |
| 20 |
|
| 21 |
DEB_FRONTENDS=passthrough text newt gtk |
| 22 |
UDEB_FRONTENDS=passthrough text newt gtk |
| 23 |
|
| 24 |
ifneq ($(filter pkg.cdebconf.nogtk,$(DEB_BUILD_PROFILES)),) |
| 25 |
DEB_FRONTENDS:=$(filter-out gtk,$(DEB_FRONTENDS)) |
| 26 |
UDEB_FRONTENDS:=$(filter-out gtk,$(UDEB_FRONTENDS)) |
| 27 |
endif |
| 28 |
|
| 29 |
ifeq ($(DEB_HOST_ARCH_OS),linux) |
| 30 |
SELINUXFLAG=--enable-selinux |
| 31 |
else |
| 32 |
SELINUXFLAG=--disable-selinux |
| 33 |
endif |
| 34 |
|
| 35 |
SIZEOPTFLAG=-Os |
| 36 |
SPEEDOPTFLAG=-O2 |
| 37 |
DEBUG_CONFIGURE_OPT= |
| 38 |
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) |
| 39 |
DEBUGOPTFLAG=-g |
| 40 |
SIZEOPTFLAG= |
| 41 |
SPEEDOPTFLAG= |
| 42 |
DEBUG_CONFIGURE_OPT=--with-debug=yes |
| 43 |
endif |
| 44 |
BUILDFLAGS_DEB=$(shell DEB_CFLAGS_MAINT_APPEND="$(DEBUGOPTFLAG) $(SPEEDOPTFLAG)" dpkg-buildflags --export=cmdline) |
| 45 |
BUILDFLAGS_UDEB=$(shell DEB_CFLAGS_MAINT_APPEND="$(DEBUGOPTFLAG) $(SIZEOPTFLAG) -fomit-frame-pointer" dpkg-buildflags --export=cmdline) |
| 46 |
|
| 47 |
%: |
| 48 |
dh $@ |
| 49 |
|
| 50 |
override_dh_auto_clean: |
| 51 |
dh_auto_clean -B$(debbuild) |
| 52 |
dh_auto_clean -B$(udebbuild) |
| 53 |
[ ! -f globalmakeflags ] || $(MAKE) -C src/test clean |
| 54 |
dh_auto_clean |
| 55 |
|
| 56 |
override_dh_auto_configure: |
| 57 |
dh_auto_configure -B$(debbuild) -- \ |
| 58 |
--libexecdir=\$${prefix}/lib \ |
| 59 |
--without-rpath \ |
| 60 |
--with-db="textdb rfc822db stack" \ |
| 61 |
--with-frontend="$(DEB_FRONTENDS)" \ |
| 62 |
--with-textwrap \ |
| 63 |
$(SELINUXFLAG) \ |
| 64 |
--with-conffile=$(CONFFILE) \ |
| 65 |
$(BUILDFLAGS_DEB) \ |
| 66 |
$(DEBUG_CONFIGURE_OPT) |
| 67 |
dh_auto_configure -B$(udebbuild) -- \ |
| 68 |
--libexecdir=\$${prefix}/lib \ |
| 69 |
--enable-d-i \ |
| 70 |
--without-rpath \ |
| 71 |
--with-db="rfc822db stack" \ |
| 72 |
--with-frontend="$(UDEB_FRONTENDS)" \ |
| 73 |
--with-default-frontend=newt \ |
| 74 |
--with-syslog-logging \ |
| 75 |
--with-textwrap \ |
| 76 |
--disable-selinux \ |
| 77 |
--with-conffile=$(CONFFILE) \ |
| 78 |
$(BUILDFLAGS_UDEB) \ |
| 79 |
$(DEBUG_CONFIGURE_OPT) |
| 80 |
|
| 81 |
override_dh_auto_build: |
| 82 |
dh_auto_build -B$(debbuild) |
| 83 |
dh_auto_build -B$(udebbuild) |
| 84 |
|
| 85 |
override_dh_auto_install: |
| 86 |
dh_auto_install -B$(debbuild) --destdir=$(CURDIR)/debian/tmp/deb |
| 87 |
dh_auto_install -B$(udebbuild) --destdir=$(CURDIR)/debian/tmp/udeb |
| 88 |
|
| 89 |
execute_after_dh_install: |
| 90 |
ifneq ($(filter pkg.cdebconf.nogtk,$(DEB_BUILD_PROFILES)),) |
| 91 |
# If the pkg.cdebconf.nogtk build profile is enabled and therefore |
| 92 |
# DEB_FRONTENDS doesn't include gtk, the main build system doesn't |
| 93 |
# automatically include cdebconf_gtk.h in the libdebconfclient0-dev |
| 94 |
# package. As we want libdebconfclient0-dev to have identical |
| 95 |
# contents whether the pkg.cdebconf.nogtk profile is used or not, we |
| 96 |
# need to explicitly install cdebconf_gtk.h if the pkg.cdebconf.nogtk |
| 97 |
# profile is enabled. |
| 98 |
dh_install -plibdebconfclient0-dev src/modules/frontend/gtk/cdebconf_gtk.h usr/include/cdebconf/ |
| 99 |
endif |
| 100 |
|
| 101 |
# Disable dh_dwz to match pre-dh d/rules sequence. |
| 102 |
override_dh_dwz: |
| 103 |
|
| 104 |
override_dh_makeshlibs: |
| 105 |
dh_makeshlibs --add-udeb=libdebconfclient0-udeb |