#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/simple-patchsys.mk
include /usr/share/cdbs/1/class/gnome.mk
include /usr/share/gnome-pkg-tools/1/rules/uploaders.mk
include /usr/share/gnome-pkg-tools/1/rules/gnome-version.mk
include /usr/share/gnome-pkg-tools/1/rules/clean-la.mk
-include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk

# this relies on the fact that the first package is the shared library to
# retrieve the package name (with SONAME)
LIB_PKG := $(shell sed -n 's/^Package: //p' debian/control | head -n 1)
DEBUG_PKG := $(LIB_PKG)-dbg

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

DEB_DH_STRIP_ARGS += --dbg-package=$(DEBUG_PKG)
DEB_CONFIGURE_EXTRA_FLAGS += --libexecdir=\$${prefix}/lib/$(LIB_PKG)

binary-install/$(LIB_PKG)::
	dh_gtkmodules -p$(LIB_PKG)
