#!/usr/bin/make -f

DEB_MAKE_FLAVORS = gtk2 gtk3
DEB_BUILDDIR = build

include /usr/share/cdbs/1/class/gnome.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/utils.mk

LDFLAGS += -Wl,-z,defs -Wl,--as-needed

DEB_CONFIGURE_EXTRA_FLAGS_gtk2 = --with-gtk=2
DEB_CONFIGURE_EXTRA_FLAGS_gtk3 = --with-gtk=3
DEB_CONFIGURE_EXTRA_FLAGS += --enable-introspection=no --enable-gtk-doc \
	--libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
	$(DEB_CONFIGURE_EXTRA_FLAGS_$(cdbs_make_curflavor))

# install flavors on top of each other (gtk3 wins because it is last)
DEB_MAKE_DESTDIRSKEL = $(cdbs_curdestdir)

DEB_DBG_PACKAGE_bamfdaemon = bamf-dbg
DEB_DBG_PACKAGE_libbamf0 = bamf-dbg
DEB_DBG_PACKAGE_libbamf3-0 = bamf-dbg

common-binary-post-install-arch::
	find debian/tmp/usr/lib -name \*.la -exec rm {} \;
	find debian/tmp/usr/lib -name \*.a -exec rm {} \;

common-binary-predeb-arch:: list-missing
