#!/usr/bin/make -f

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

DEB_DH_INSTALL_ARGS = -X.bzr
DEB_DH_BUILDDEB_ARGS := -- -Z bzip2

DEB_SRCDIR = edubuntu

DEB_MAKE_BUILD_TARGET = deb

$(patsubst %,binary-install/%,$(DEB_PACKAGES)) :: binary-install/%:
	dh_scrollkeeper -p$(cdbs_curpkg) $(DEB_DH_SCROLLKEEPER_ARGS)

	set -x; for doc in about-edubuntu; do \
	     for lang in `ls edubuntu/$$doc/`; do \
	            if [ -e edubuntu/$$doc/$$lang/$$doc.xml ]; then \
	                     mkdir -p debian/edubuntu-docs/usr/share/gnome/help/$$doc/$$lang/; \
	                     cp edubuntu/$$doc/$$lang/*xml debian/edubuntu-docs/usr/share/gnome/help/$$doc/$$lang/; \
	            fi; \
	            if [ -e edubuntu/$$doc/$$lang/*.omf ]; then \
	                     mkdir -p debian/edubuntu-docs/usr/share/omf/$$doc; \
	                     cp edubuntu/$$doc/$$lang/*omf debian/edubuntu-docs/usr/share/omf/$$doc/; \
	            fi; \
	     done; \
	done;

#	set -x; for doc in handbook; do \
#	     for lang in `ls edubuntu/$$doc/`; do \
#	            if [ -e edubuntu/$$doc/$$lang/$$doc.xml ]; then \
#	                     mkdir -p debian/edubuntu-docs/usr/share/gnome/help/edubuntu-$$doc/$$lang/; \
#	                     cp edubuntu/$$doc/$$lang/*xml debian/edubuntu-docs/usr/share/gnome/help/edubuntu-$$doc/$$lang/; \
#	            fi; \
#	            if [ -e edubuntu/$$doc/$$lang/*.omf ]; then \
#	                     mkdir -p debian/edubuntu-docs/usr/share/omf/$$doc; \
#	                     cp edubuntu/$$doc/$$lang/*omf debian/edubuntu-docs/usr/share/omf/$$doc/; \
#	            fi; \
#	     done; \
#	done;

	dh_scrollkeeper 
