#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

DHFLAGS=--parallel

%:
	dh $@ --with python2 $(DHFLAGS)

override_dh_auto_configure:
	NOCONFIGURE=1 ./autogen.sh
	dh_auto_configure $(DHFLAGS) -- \
	                             --disable-silent-rules

override_dh_makeshlibs:
	# Don't generate a shlibs file for the plugin
	dh_makeshlibs -X/usr/lib/caja/

override_dh_install:
	# Drop useless files
	rm -f debian/caja-dropbox/usr/lib/*/caja/extensions-*/libcaja-dropbox.a
	rm -f debian/caja-dropbox/usr/lib/*/caja/extensions-*/libcaja-dropbox.la
	dh_install --fail-missing

override_dh_auto_clean:
	dh_auto_clean
	rm -f INSTALL
	rm -f aclocal.m4
	rm -f config.guess
	rm -f config.h.in
	rm -f config.sub
	rm -f configure
	rm -f depcomp
	rm -f install-sh
	rm -f ltmain.sh
	rm -f missing
	rm -f omf.make
	rm -f xmldocs.make
	for x in `find . -name Makefile.in`; do \
          rm -f $$x; \
        done

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