#!/usr/bin/make -f
# This has to be exported to make some magic below work.
export DH_OPTIONS

%:
	dh $@ --with autoreconf

override_dh_autoreconf:
	NOCONFIGURE=1 dh_autoreconf ./autogen.sh

override_dh_install:
	rm -f debian/tmp/usr/share/gtkpod/data/COPYING
	rm -f debian/tmp/usr/share/gtkpod/doc/icon-licence.txt
	dh_install

VERSION = $(shell dpkg-parsechangelog | grep "^Version:" | sed -r "s/Version: (.*)-.*/\1/")

get-orig-source:
	cd debian && git clone --depth 1 -b gtk-3.0 git://gtkpod.git.sourceforge.net/gitroot/gtkpod/gtkpod
	cd debian/gtkpod && git archive --format=tar --prefix=gtkpod-$(VERSION)/ HEAD | \
		gzip -9c > ../../../gtkpod_$(VERSION).orig.tar.gz
	rm -rf debian/gtkpod
