#!/usr/bin/make -f

%:
	dh $@ --with apache2

override_dh_auto_build:
	php build.php

override_dh_auto_clean:
	rm -f phpliteadmin.php

# Ignore errors when modifying the Apache configuration during installation
# process. For the case if mod_php is disabled.
override_dh_apache2:
	dh_apache2 --error-handler=true

DESTDIR = debian/phpliteadmin
# Set modes and group of files to allow a web-server to write databases, and to
# hide a password in the config from prying eyes.
execute_after_dh_fixperms:
	chgrp www-data $(DESTDIR)/etc/phpliteadmin.config.php
	chmod 640 $(DESTDIR)/etc/phpliteadmin.config.php
	chgrp www-data $(DESTDIR)/var/lib/phpliteadmin/
	chmod 2775 $(DESTDIR)/var/lib/phpliteadmin/
