#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk

# Add here any variable or target overrides you need.
DEB_FIXPERMS_EXCLUDE := serverstats

common-binary-post-install-indep::
	find debian/serverstats/usr/share/serverstats/ -type d -exec chmod 0755 {} \;
	find debian/serverstats/usr/share/serverstats/ -type f -exec chmod 0644 {} \;
	find debian/serverstats/usr/share/serverstats/sources/external/ -type f -name \*.pl -exec chmod 0755 {} \;
	find debian/serverstats/usr/share/serverstats/sources/ -type f -name \*.sh -exec chmod 0755 {} \;
	chmod 0755 debian/serverstats/usr/share/serverstats/update.php
	chown nobody:nogroup debian/serverstats/var/lib/serverstats/cache
	chown nobody:nogroup debian/serverstats/var/lib/serverstats/rrd
	chown www-data:www-data debian/serverstats/var/lib/serverstats/graph
	cp config.sample/* debian/serverstats/etc/serverstats/
