#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/autoreconf.mk
include /usr/share/cdbs/1/rules/buildvars.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/class/gnome.mk
include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk
include /usr/share/gnome-pkg-tools/1/rules/gnome-version.mk

ELIBDIR := usr/lib/evolution

DEB_DH_AUTORECONF_ARGS := --as-needed
DEB_SHLIBDEPS_INCLUDE := debian/evolution/$(ELIBDIR)
DEB_DH_MAKESHLIBS_ARGS_libevolution += -V'libevolution (>= $(DEB_VERSION)), libevolution (<< $(DEB_GNOME_NEXTVERSION))' --noscripts -X $(ELIBDIR)/modules
DEB_DH_MAKESHLIBS_ARGS_evolution += -V
DEB_DH_MAKESHLIBS_ARGS_ALL += --noscripts -X $(ELIBDIR)/plugins
DEB_DH_INSTALL_ARGS := --fail-missing -X.la

export DEB_LDFLAGS_MAINT_APPEND=-Wl,-z,defs -Wl,--as-needed -Wl,-O1
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
# see https://bugzilla.gnome.org/show_bug.cgi?id=594473 for details
export DEB_LDFLAGS_MAINT_STRIP=-Wl,-Bsymbolic-functions
include /usr/share/dpkg/buildflags.mk

DEB_REVISION := $(shell echo $(DEB_VERSION) | awk -F- '{ print $$NF }')

DEB_CONFIGURE_EXTRA_FLAGS += \
	--with-openldap \
	--enable-nls \
	--with-krb5=/usr \
	--sysconfdir=/etc \
	--libexecdir=/usr/lib \
	--enable-plugins=all \
	--enable-pst-import \
	--enable-python \
	--enable-contact-maps \
	--disable-autoar \
	--with-clutter \
	--with-sub-version=-$(DEB_REVISION)

ifneq ($(DEB_HOST_ARCH_OS), linux)
	DEB_CONFIGURE_EXTRA_FLAGS+=--disable-nm
else
	DEB_CONFIGURE_EXTRA_FLAGS+=--enable-nm
endif

clean::
	find -name '*.schemas' | xargs rm -f

common-binary-post-install-arch:: list-missing
