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

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

ifndef UPVER
UPVER := $(shell dpkg-parsechangelog | grep ^Version | cut -d\  -f2 | cut -d- -f1 | cut -d+ -f1)
endif
DEBVER := $(UPVER)+ds1

%:
	dh $@ \
		--with autoreconf \
		--with pkgkde_symbolshelper

override_dh_auto_build:
	dh_auto_build
	rm -vrf doc/man/man3/_*

override_dh_auto_clean:
	dh_auto_clean
	rm -rf doc/rtf/

override_dh_strip:
	dh_strip --dbg-package=libpgf6-dbg

get-orig-source:
	uscan \
		--verbose \
		--force-download \
		--download-version $(UPVER) \
		--destdir . \
		--rename \
		--repack
	tar xf libpgf_$(UPVER).orig.tar.gz
	rm -vrf libpgf/doc/*.pdf
	rm -vrf libpgf/*.tar.bz2
	tar cf libpgf_$(DEBVER).orig.tar libpgf/
	bzip2 libpgf_$(DEBVER).orig.tar
	rm -rf libpgf/ libpgf_$(UPVER).orig.tar.gz
