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

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

include /usr/share/dpkg/pkg-info.mk

%:
	dh $@

override_dh_binary:
	dh_binary

override_dh_install:
	egrep -q "GRML_LIVE_VERSION=.*UNRELEASED" grml-live || \
			(echo "Wrong version in grml-live" && exit 2)
	# build docs
	cd docs && $(MAKE) && cd ../
	# adjust version number inside grml-live executable
	sed -i -e "s/GRML_LIVE_VERSION='\*\*\*UNRELEASED\*\*\*'/GRML_LIVE_VERSION='$(DEB_VERSION)'/" grml-live
	find . -name grml-live.8
	dh_install

override_dh_fixperms:
	dh_fixperms
	# make sure they are executable:
	chmod 755 debian/grml-live/etc/grml/fai/config/hooks/*
