#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

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

clean:
	dh_testdir
	dh_testroot
	debconf-updatepo
	dh_clean 

build:
	@echo "Nothing to build for target $@. PHP Code is interpreted."

build-indep:
	@echo "Nothing to build for target $@. PHP Code is interpreted."

build-arch:
	@echo "Nothing to build for target $@. PHP Code is interpreted."

install: 
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	find . -type f -not \( \
		-path '*/debian/*' -or \
		-path '*/templates/*' -or \
		-path '*/doc/*' -or \
		-path '*/lang' -or \
		-path '*/tools/po/*' -or \
		-name 'Makefile' -or \
		-name 'INSTALL' -or \
		-name 'LICENSE' -or \
		-name '.cvsignore' -or \
		-name 'COPYING' -or \
		-name 'build-stamp' \
	\) -exec install -D --mode=644 {} debian/phpldapadmin/usr/share/phpldapadmin/{} \;
	find ./templates -type f -a -not -name .cvsignore -exec install -D --mode=644 {} \
        debian/phpldapadmin/etc/phpldapadmin/{} \;
	for po in debian/phpldapadmin/usr/share/phpldapadmin/locale/*/LC_MESSAGES/*.po; do \
	    (cd `dirname $$po`; msgfmt messages.po); \
	done
	rm -f debian/phpldapadmin/usr/share/phpldapadmin/.gitignore || true

# Build architecture-independent files here.
binary-dep: build install

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs
	dh_install
	dh_compress
	dh_fixperms
	dh_install debian/conf/apache.conf /etc/phpldapadmin/
	dh_install debian/additional-templates/* etc/phpldapadmin/templates/creation/
	dh_link /etc/phpldapadmin/templates /usr/share/phpldapadmin/templates
	dh_link /usr/share/doc/phpldapadmin /usr/share/phpldapadmin/doc
	dh_installdebconf -pphpldapadmin
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-arch:

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary install configure
