#!/usr/bin/make -f

%:
	dh $@ --parallel

override_dh_auto_configure:
	./bootstrap
	dh_auto_configure -- --prefix=/usr

override_dh_auto_install:
	destdir=$(CURDIR)/debian/xca dh_auto_install

override_dh_auto_build:
	dh_auto_build -- all

override_dh_auto_clean:
	$(MAKE) clean
	$(MAKE) distclean

SOURCEPKG=$(shell dpkg-parsechangelog | sed  -n 's/^Source: \(.*\)/\1/p')
UPSTREAM=$(shell dpkg-parsechangelog |  sed -n 's/^Version: \(.*\)-[^-]*/\1/p')
ORIG=${SOURCEPKG}_${UPSTREAM}.orig.tar.gz

get-orig-source:
	git archive --format=tar upstream/${UPSTREAM} --prefix=${SOURCEPKG}_${UPSTREAM}/ | gzip -9 > ../${ORIG}
