#!/usr/bin/make -f

TYPELIBDIR=$(shell pkg-config gobject-introspection-1.0 --variable libdir | sed -e 's/.//')

CONFIGURE_EXTRA_FLAGS = --libexecdir=/usr/lib/nemo \
                        --disable-update-mimedb \
			--enable-gtk-doc \
			--enable-selinux=no \
			--enable-compile-warnings=yes \
			--enable-silent-rules

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


%:
	dh $@ --parallel --with autoreconf,gir

override_dh_autoreconf:
	NOCONFIGURE=yes dh_autoreconf --as-needed -- ./autogen.sh

override_dh_auto_configure:
	dh_auto_configure -- $(CONFIGURE_EXTRA_FLAGS)

override_dh_auto_test:

override_dh_strip:
	dh_strip --dbg-package=nemo-dbg

override_dh_install:
	sed 's@TYPELIBDIR@${TYPELIBDIR}@' debian/gir1.2-nemo-3.0.install.in > debian/gir1.2-nemo-3.0.install
	dh_install --list-missing

override_dh_makeshlibs:
	dh_makeshlibs -Xusr/lib/nemo/extensions-3.0/

override_dh_installmime:
	dh_installmime -pnemo-data

