#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS=hardening=+all
DPKG_EXPORT_BUILDFLAGS=1
include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/pkg-info.mk

export CMAKE_BUILD_TYPE=release

%:
	dh $@

override_dh_auto_clean:
	dh_clean
	rm -f cmake.h commit.h test/basetest/*.pyc test/simpletap/*.pyc
	rm -rf obj-*

override_dh_auto_configure:
	find . -type f -exec sed -i '1s|^#!/usr/bin/env python|#!/usr/bin/python|' {} \;
	dh_auto_configure -- -DTASK_RCDIR=share/taskwarrior

override_dh_auto_install:
	# Needed by #710321
	dh_auto_install
	mkdir -p debian/taskwarrior/usr/share/bash-completion/completions
	cp scripts/bash/task.sh debian/taskwarrior/usr/share/bash-completion/completions/task
	rm -rf debian/taskwarrior/usr/share/doc/task
	rm -f debian/taskwarrior/usr/share/taskwarrior/refresh

.PHONY: get-orig-source
get-orig-source:
	sh ./debian/get-orig-source.sh $(DEB_VERSION_UPSTREAM)

# vim:ts=4 sw=4 noet
