#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --parallel --with autoreconf

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

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

override_dh_auto_build:
	dh_auto_build -- all

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}
