#!/usr/bin/make -f
# -*- makefile -*-
#
# build this package with:
# chmod -x include/class.site_installer.php && debuild -ICVS -Isemantic.cache -I.cvsignore
#
# 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

# This is the debhelper compatability version to use.
export DH_COMPAT=4

# This has to be exported to make some magic below work.
export DH_OPTIONS

PACKAGENAME=typo3-site-installer
PACKAGEVERSION=$(shell head --lines=1 debian/changelog | cut -d '(' -f 2 | cut -d ')' -f 1)
T3INSTALLERDIR=usr/share/$(PACKAGENAME)


build: build-stamp

build-stamp:
	dh_testdir
#	docbook-to-man debian/typo3.sgml > typo3.1
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp	
# 	Add here commands to clean up after the build process.
	dh_clean 

install: build
	dh_testdir
	dh_testroot
	dh_clean -k 
	dh_installdirs $(T3INSTALLERDIR) usr/sbin

#	 Add here commands to install the package into debian/typo3.

#	 Make scripts executable
#	cd debian/$(BACKENDPACKAGE)/$(T3EXTDIR) ; chmod a+x $(T3EXTEXE)



# Build architecture-independent files here.
binary-indep: build install
	dh_testdir
	dh_testroot


#	 Install some documentation	
	dh_installchangelogs ChangeLog
	dh_installdocs TODO doc/README
	dh_installexamples


	dh_install typo3-site-installer usr/sbin
	dh_install include/class.site_installer.php $(T3INSTALLERDIR)
#	dh_installmenu
#	dh_installdebconf	
#	dh_installlogrotate
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
#	dh_installinit
#	dh_installcron
#	dh_installinfo
	dh_installman doc/typo3-site-installer.1
	dh_link
	dh_strip
	dh_compress	
	dh_fixperms
#	dh_perl
#	dh_python
#	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb


# Build architecture-dependent files here.
binary-arch: build install

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