#!/usr/bin/make -f
# -*- makefile -*-

export DH_VERBOSE=1
export DH_OPTIONS=-v

configure: configure-stamp
configure-stamp:
	dh_testdir
	touch configure-stamp

build: build-stamp

build-stamp: configure-stamp 
	dh_testdir
	touch $@
clean:
	dh_testdir
	dh_testroot
	cd ..
	rm -f build-stamp configure-stamp
	dh_clean

install: build
	dh_prep
	dh_installdirs -A

	cd $(CURDIR)/debian/libreoffice-canzeley-client/usr/lib/libreoffice/share/extensions/canzeley-client && \
		unzip -o $(CURDIR)/Extension/canzeley_*.oxt
	mv $(CURDIR)/debian/libreoffice-canzeley-client/usr/lib/libreoffice/share/extensions/canzeley-client/icons $(CURDIR)/debian/libreoffice-canzeley-client/usr/share/libreoffice-canzeley-client/

	dh_lintian

# Build architecture-independent files here.
build-arch: build
build-indep: build

# Note that the following form is recommended however:
binary-indep: build install
	dh_installchangelogs -k Changelog.Source
	dh_install
	dh_installdocs
	mv $(CURDIR)/debian/libreoffice-canzeley-client/usr/share/doc/libreoffice-canzeley-client/Changelog.Source $(CURDIR)/debian/libreoffice-canzeley-client/usr/share/doc/libreoffice-canzeley-client/Changelog
	dh_link
	dh_compress -X.odt -X.sql -X.zip -X.ott -X.ots
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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