#!/usr/bin/make -f

#export DEB_KDE_LINK_WITH_AS_NEEDED := yes
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

override_dh_auto_configure:
	dh_auto_configure -Skde -- -DKDE4_BUILD_TESTS=false

override_dh_bugfiles:
	dh_bugfiles -A

override_dh_install:
	dh_install
	# Copy English errmsg.sys from mysql-server-core package
	if [ -d debian/amarok-common ]; then \
	    cp -a /usr/share/mysql/english/errmsg.sys debian/amarok-common/usr/share/kde4/apps/amarok/mysqle/; \
	fi

override_dh_strip:
	dh_strip --no-automatic-dbgsym

override_dh_auto_install:
	dh_auto_install
	# Remove development stuff
	find debian/tmp -name '*.so' -type l -delete
	rm -rf debian/tmp/usr/share/dbus-1/interfaces/
	# Remove extra COPYING files
	find debian/tmp -name COPYING -type f -delete
	# At the end, remove empty directories
	find debian/tmp -type d -empty -delete

override_dh_missing:
	dh_missing --fail-missing

%:
	dh $@ --with kde

.PHONY: override_dh_auto_test
