#!/usr/bin/make -f

include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk

# see https://bugzilla.gnome.org/show_bug.cgi?id=594473 for details
export DEB_LDFLAGS_MAINT_STRIP = -Wl,-Bsymbolic-functions

EDS_VERSION = $(shell pkg-config --modversion evolution-data-server-1.2  | awk -F'.' '{print $$1 "." $$2}')
EDS_NEXTVERSION = $(shell pkg-config --modversion evolution-data-server-1.2  | awk -F'.' '{print $$1 "." $$2+1}')
EVO_VERSION = $(shell pkg-config --modversion evolution-shell-3.0  | awk -F'.' '{print $$1 "." $$2}')
EVO_NEXTVERSION = $(shell pkg-config --modversion evolution-shell-3.0  | awk -F'.' '{print $$1 "." $$2+1}')

%:
	dh $@ --with gnome

override_dh_gnome_clean:
	dh_gnome_clean --no-control

override_dh_autoreconf:
	dh_autoreconf --as-needed

override_dh_auto_configure:
	dh_auto_configure -- --enable-gtk-doc

override_dh_install:
	dh_install
	find debian/evolution-ews -name \*.la -delete

override_dh_makeshlibs:
	dh_makeshlibs -n -X/usr/lib/evolution-data-server/

override_dh_gencontrol:
	dh_gencontrol -- \
		-Veds:Version=$(EDS_VERSION) -Veds:NextVersion=$(EDS_NEXTVERSION) \
		-Vevo:Version=$(EVO_VERSION) -Vevo:NextVersion=$(EVO_NEXTVERSION)
