#!/usr/bin/make -f

PKG=friendly-recovery
DEBVER=$(shell dpkg-parsechangelog |sed -n -e '/^Version:/s/^Version: //p')
DEB_BUILD_PROG:=debuild --preserve-envvar PATH --preserve-envvar CCACHE_DIR -us -uc $(DEB_BUILD_PROG_OPTS)

  
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/simple-patchsys.mk

# FIXME: move this into its own makefile
install/friendly-recovery::
	mkdir -p debian/friendly-recovery
	#cp -ar etc/ debian/friendly-recovery
	cp -ar usr/ debian/friendly-recovery

arch-build:
	rm -rf debian/arch-build
	mkdir -p debian/arch-build/$(PKG)-$(DEBVER)
	tar -c --exclude=arch-build --no-recursion -f - `bzr inventory` | (cd debian/arch-build/$(PKG)-$(DEBVER);tar xf -)
	(cd debian/arch-build/$(PKG)-$(DEBVER) && $(DEB_BUILD_PROG))

