#!/usr/bin/make -f

include /usr/share/dpkg/default.mk

%:
	dh $@

get-orig-source:
ifeq (,$(wildcard vendor/*))
	bzr branch lp:~rocket-scientists/aal+/aosp-vendor-4.4.2 vendor
else
	find vendor -name '.bzr' | xargs -L1 bzr pull -d
endif
	tar --exclude-vcs --transform='s,^,$(DEB_SOURCE)-$(DEB_VERSION_UPSTREAM)/,S' -caf ../$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM).orig.tar.xz vendor

copyright:
	cp debian/copyright.header debian/copyright
	find . -name NOTICE | xargs -L1 ./debian/notice.sh >> debian/copyright

override_dh_builddeb:
	dh_builddeb -- -Zxz

override_dh_install:
	dh_install
	find debian -name '.bzr' | xargs rm -rf
