#!/usr/bin/make -f
# 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

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



build: DH_OPTIONS=
build: build-stamp
build-stamp: 
	dh_testdir
	
	touch build-stamp

clean: 
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp
	rm -rf build
	rm -rf debian/zope-cmftransforms/
	find . -name "*.pyc" | xargs rm -f
	rm -f changelog.gz
	dh_clean

install: DH_OPTIONS=
install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	
	find . -type f -not \( \
			-path './debian/*' -or \
			-path './build/*' -or \
			-path './docs/*' -or \
			-path '*/CVS/*' -or \
			-name 'build-stamp' -or \
			-iname 'authors*' -or \
			-iname 'license.txt' -or \
			-name 'ChangeLog*' -or \
			-name 'README*' -or \
			-name 'INSTALL*' -or \
			-name 'TODO*' -or \
			-name 'COPYING*' -or \
			-name 'MANIFEST*' -or \
			-name 'DEPENDS' -or \
			-name 'RECOMMENDS' -or \
			-name 'SUGGESTS' -or \
			-name '.cvsignore' \
			-or -path './tests/*' \
        		\) -exec install -D --mode=644 {} debian/zope-cmftransforms/usr/lib/zope/lib/python/Products/PortalTransforms/{} \;
	
	
	
	
	# install tests
	(cd tests && find . -type f -not \( -path '*/CVS/*' -or -name '*.pyc' \) -exec install -D --mode=644 {} ../debian/zope-cmftransforms-test/usr/share/doc/zope-cmftransforms/test/{} \;)


# Build architecture-independent files here.
binary-indep: DH_OPTIONS=-i
binary-indep: build install
	dh_testdir
	dh_testroot
	dh_install
	
	
	
	# install text documentation
	cp -r docs/dev_manual.rst docs/user_manual.rst debian/zope-cmftransforms/usr/share/doc/zope-cmftransforms/ 
	
	# install html documentation
	#cp -r docs/dev_manual.html docs/user_manual.html debian/zope-cmftransforms/usr/share/doc/zope-cmftransforms/html/
	
	gzip -9 -c ChangeLog > changelog.gz
	dh_installdocs -A README TODO changelog.gz 
	dh_installchangelogs
	
	dh_link
	dh_compress -X.py
	dh_fixperms
	dh_installdeb
	dh_gencontrol 
	dh_md5sums
	dh_builddeb

# Build architecture-dependent files here.
binary-arch: DH_OPTIONS=-a
binary-arch: build install
	dh_testdir 
	dh_testroot 
	dh_install
	
	
	
	# install text documentation
	cp -r docs/dev_manual.rst docs/user_manual.rst debian/zope-cmftransforms/usr/share/doc/zope-cmftransforms/ 
	
	# install html documentation
	cp -r docs/dev_manual.html docs/user_manual.html debian/zope-cmftransforms/usr/share/doc/zope-cmftransforms/html/
	
	gzip -9 -c ChangeLog > changelog.gz
	dh_installdocs -A README TODO changelog.gz 
	dh_installchangelogs
	
	dh_strip
	dh_link
	dh_compress -X.py 
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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

