#!/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



SHELL=bash
CHANGELOG=CHANGES

package=jsboard-theme-diary-ko
installdir=debian/tmp/usr/share/jsboard/theme
docdir=debian/tmp/usr/share/doc/${package}/

INSTALL=install
INSTALL_FILE=$(INSTALL) -p -o root -g root -m 644
INSTALL_PROGRAM=$(INSTALL) -p -o root -g root -m 755
INSTALL_SCRIPT=$(INSTALL) -p -o root -g root -m 755
INSTALL_DIR=$(INSTALL) -d -o root -g root -m 755

build: 
	# nothing to do

checkdir:
	@test -f debian/rules || { echo "Error: not source tree"; exit 1; }

checkroot: checkdir
	@test 0 = `id -u` || { echo "Error: not super-user"; exit 1; }

clean: checkroot
	rm -rf debian/tmp
	rm -f debian/files debian/substvars

binary-arch: build 
	# nothing to do
	
# Build architecture-independent files here.
binary-indep: build clean
	$(INSTALL_DIR) `cat debian/dirs | sed 's/^/debian\/tmp\//g'`

	cp -a KO-diary ${installdir}

	$(INSTALL_FILE) debian/changelog ${docdir}changelog.Debian
	$(INSTALL_FILE) debian/copyright ${docdir}
	gzip -9 ${docdir}changelog.Debian

	$(INSTALL_DIR) debian/tmp/DEBIAN
	dpkg-gencontrol -isp
	cd debian/tmp > /dev/null ; find * -type f ! -regex '^DEBIAN/.*' -print0 | xargs -r0 md5sum > DEBIAN/md5sums ; cd $(BDIR) > /dev/null
	dpkg --build debian/tmp ..

binary: binary-indep binary-arch

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