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

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export GTK=3
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic


COMMIT=6224470489eb5ba92987e01396269f8b7cd78ada
get-orig-source:
	TMPD=`mktemp -d` && \
		git clone https://bitbucket.org/portix/dwb.git \
			"$$TMPD/dwb" && \
    CDATE=`git --git-dir="$$TMPD/dwb/.git" show \
			--format=format:%ci -s $(COMMIT) | \
			awk '{ gsub(/-/,""); print $$1 }'` && \
		git --git-dir="$$TMPD/dwb/.git" archive \
			--prefix=dwb/ $(COMMIT) | \
			bzip2 > ../dwb_"$$CDATE"hg.orig.tar.bz2 && \
		rm -rf $$TMPD

override_dh_install:
	mkdir -p debian/dwb/usr/share/bash-completion/completions
	install -m 644 contrib/bash-completion \
		debian/dwb/usr/share/bash-completion/completions/dwb
	dh_install
%:
	dh $@
