#!/usr/bin/make -f

#DEB_KDE_LINK_WITH_AS_NEEDED := yes

ifneq (,$(shell which tg))
QUILT_PATCH_DIR := debian/patches
include /usr/share/topgit/tg2quilt.mk
endif

include /usr/lib/kubuntu-desktop-i18n/debhelper/kubuntu.mk

override_dh_auto_configure:
	dh_auto_configure -Skde -- -DCMAKE_USE_RELATIVE_PATHS=ON \
	                           -DWITH_SYSTEM_GEOIP:BOOL=ON -DWITH_BUILTIN_COUNTRY_FLAGS:BOOL=OFF
%:
	dh --dbg-package=ktorrent-dbg --with kde $@

prune-tarball:
	# Remove non-free components: flags and geoip stuff
	rm -f plugins/infowidget/geoip/*.png
	rm -f plugins/infowidget/geoip/FLAGS_LICENCE
#	rm -f plugins/infowidget/geoip/geoip.dat
#	rm -f plugins/infowidget/geoip/GeoIP-LICENSE.txt
	rm -f plugins/infowidget/GeoIP.c
	rm -f plugins/infowidget/GeoIP.h
.PHONY: prune-tarball
