#!/usr/bin/make -f

build: build-stamp
build-stamp:
	dh_testdir
	./configure --with-mandir=/usr/share/man --with-sysconfdir=/etc --with-docdir=/usr/share/doc/apvlv --with-djvu
	make
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	[ ! -f Makefile ] || $(MAKE) distclean
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	# Binary
	install -m 0755 src/apvlv debian/apvlv/usr/bin/
	# Icons
	install -m 0644 icons/* debian/apvlv/usr/share/pixmaps/apvlv/
	install -m 0644 debian/apvlv.xpm debian/apvlv/usr/share/pixmaps/apvlv/
	# Desktop
	install -m 0644 debian/desktop debian/apvlv/usr/share/applications/apvlv.desktop
	# Config
	install -m 0644 apvlvrc.example debian/apvlv/etc/apvlvrc

# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs NEWS
	dh_installdocs
	dh_installexamples
	dh_installmenu
	dh_installmime
	dh_installman
	dh_strip
	dh_compress -XStartup.pdf
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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