#!/usr/bin/make -f

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

DEB_DH_INSTALL_ARGS += --list-missing

DEB_CONFIGURE_SCRIPT := ./autogen.sh

DEB_CONFIGURE_EXTRA_FLAGS += \
						--localstatedir=/var \
						--libexecdir=/usr/lib/mate-panel \
						--disable-scrollkeeper \
						--disable-static \
						--enable-introspection \
						--enable-matecomponent

# enable ubuntu hack only in oneiric (not needed in precise)
ifeq ($(shell dpkg-vendor --is Ubuntu && echo yes),yes)
    ifeq ($(shell lsb_release -cs),oneiric)
        DEB_CONFIGURE_EXTRA_FLAGS += --enable-ubuntu
    endif
endif

# this fixes 'E: mate-panel: pkg-has-shlibs-control-file-but-no-actual-shared-libs'
DEB_DH_MAKESHLIBS_ARGS_mate-panel += --no-act

DEB_MAKE_INSTALL_TARGET = install DESTDIR=$(DEB_DESTDIR) MATECONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1

binary-install/mate-panel::
	mkdir -p debian/mate-panel/usr/share/mateconf/schemas
	mateconf-merge-schema "debian/mate-panel/usr/share/mateconf/schemas/mate-panel.schemas" --domain mate-panel debian/tmp/etc/mateconf/schemas/*.schemas
	rm -rf debian/tmp/etc/mateconf/schemas/*.schemas

get-orig-source:
	uscan --noconf --force-download --rename --download-current-version --destdir=..
