#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

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

# getting DEB_VERSION from helper without manually parsing the changelog file
include /usr/share/dpkg/pkg-info.mk

%:
	dh  $@

override_dh_install:
	find src -type f \( -name "*.php" \) -exec chmod 644 {} \;
	sed -e "s/DEB_VERSION/${DEB_VERSION}/" debian/version.php.in > src/version.php
	dh_install -X LICENSE
	# Rename so we can have dh_installdocs install this with a proper name.
	cp -a src/autodiscover/INSTALL src/autodiscover/README.autodiscover

override_dh_fixperms-indep:
	dh_fixperms
	chmod 755 debian/z-push-backend-kopano/usr/share/z-push/backend/kopano/listfolders.php
	chmod 755 debian/z-push-common/usr/share/z-push/z-push-admin.php
	chmod 755 debian/z-push-common/usr/share/z-push/z-push-top.php
	chmod 755 debian/z-push-state-sql/usr/share/z-push/tools/migrate-filestates-to-db.php

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	dh_clean
	debconf-updatepo

build:
