#!/usr/bin/make -f

export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
export PREFIX=/usr

%:
	dh $@

override_dh_update_autotools_config:
	./autogen.sh
	./configure

override_dh_install:
	dh_install
	# rename default configfile
	mv $(CURDIR)/debian/rsnapshot/etc/rsnapshot.conf.default \
	   $(CURDIR)/debian/rsnapshot/etc/rsnapshot.conf
	# html doc, see debian/doc-base
	cp $(CURDIR)/docs/HOWTOs/rsnapshot-HOWTO.en.html \
	   $(CURDIR)/debian/rsnapshot/usr/share/doc/rsnapshot/html/

override_dh_installexamples:
	# Remove unnecessary extra license file, (Policy Manual section 12.5)
	dh_installexamples -X utils/rsnapshotdb/LICENSE.txt

override_dh_fixperms:
	dh_fixperms
	# Fix permissions of the default rsnapshot_root directory
	chmod 0700 $(CURDIR)/debian/rsnapshot/var/cache/rsnapshot

override_dh_compress:
	# Do not compress example perl utilities
	dh_compress --exclude=.pl

override_dh_auto_test:
	# Tests require a special environment
