#!/usr/bin/make -f
#
# debian/rules file for docbook-xsl-stylesheets-ko
# Maintainer: Yooseong Yang <yooseong@debian.org>

# export DH_VERBOSE=1
export DH_COMPAT=3

# General Stuff
xmldir		:= usr/share/xml

# DTD 
dtd-group	:= docbook

# Stylesheet Stuff
style-type	:= xsl
style-src	:= ko
style-version	:= 0.2

package		:= $(dtd-group)-$(style-type)-stylesheets-ko
prefix		:= debian/$(package)
#docdir		:= $(prefix)/usr/share/doc/$(package)
bindir		:= $(prefix)/usr/bin

styledir	:= $(prefix)/$(xmldir)/$(dtd-group)/stylesheet/$(style-type)/$(style-src)
cssdir		:= $(styledir)/css

# tool abstraction
INSTALL_FILE	:= install -o root -g root -m 644 -p
INSTALL_SCRIPT	:= install -o root -g root -m 755 -p
INSTALL_PROGRAM	:= install -o root -g root -m 755 -p --strip
MAKE_DIR	:= install -d -o root -g root -m 755
COMPRESS	:= gzip -9f

build: build-stamp
build-stamp:
	dh_testdir
	touch build-stamp
clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	dh_clean

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

# New Layout
	$(MAKE_DIR) 				$(cssdir)			\
		$(styledir)/common 		$(styledir)/extensions 		\
		$(styledir)/fo 			$(styledir)/html		\
#		$(styledir)/htmlhelp/doc 	$(styledir)/images/callouts 	\
#		$(styledir)/javahelp		$(styledir)/lib 		\
#		$(styledir)/template 		$(styledir)/xhtml
# 	xsl files
	$(INSTALL_FILE)  VERSION 		$(styledir)/
	$(INSTALL_FILE)  common/*.*  		$(styledir)/common/
	$(INSTALL_FILE)  fo/*.*  		$(styledir)/fo/
	$(INSTALL_FILE)  html/*.*  		$(styledir)/html/

#       ChangeLogs for xsl files into docdir, rename for autocompression
#	$(INSTALL_FILE) $(styledir)/common/changelog                $(docdir)/common/changelog
	dh_installchangelogs 

#	dh_testversion 2
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_compress -i 
	dh_fixperms -i
	dh_installdeb -i
# 	chunking needs perl 
	dh_perl
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build 
# We have nothing to do by default.

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