#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export DEB_BUILD_HARDENING=1

%:
	dh $@ --with autoreconf


post_patch:
	[ -f settings-backend/mateconf.c ] || \
		mv settings-backend/gconf.c settings-backend/mateconf.c

pre_unpatch:
	[ -f settings-backend/gconf.c ] || \
		mv settings-backend/mateconf.c settings-backend/gconf.c

override_dh_autoreconf: post_patch
	dh_autoreconf

override_dh_auto_configure:
	dh_auto_configure -- --prefix=/usr --disable-static

override_dh_auto_clean:
	if [ -f settings-backend/gconf.c -a -d debian/tmp ]; then debian/rules post_patch; fi
	dh_auto_clean

override_dh_clean: pre_unpatch
	dh_clean

override_dh_auto_install:
	dh_auto_install --destdir=debian/tmp

# This forces the rename right before dpkg-source --after-build 
#override_dh_builddeb: pre_unpatch
override_dh_builddeb: pre_unpatch
	dh_builddeb
	
