#!/usr/bin/make -f
# -*- makefile -*-
# 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

clean:
	dh_testdir
	dh_testroot
	rm -f atool.1
	dh_clean 

build: build-stamp

build-stamp: config.status
	dh_testdir
	$(MAKE)
	touch $@

config.status:
	dh_testdir
	./configure $(CROSS) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --sysconfdir=/etc

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	perl debian/replace_autoconf_vars atool.1.in atool.1
	cp $(CURDIR)/extra/bash-completion-atool* $(CURDIR)/debian/atool/etc/bash_completion.d/atool
	chmod -x $(CURDIR)/debian/atool/etc/bash_completion.d/atool
	dh_install

binary-arch:

binary-indep: install
	dh_testdir
	dh_testroot
	dh_installchangelogs NEWS
	dh_installdocs
	dh_installexamples
	dh_installman
	dh_link usr/bin/atool usr/bin/acat \
		usr/bin/atool usr/bin/adiff \
		usr/bin/atool usr/bin/als \
		usr/bin/atool usr/bin/apack \
		usr/bin/atool usr/bin/arepack \
		usr/bin/atool usr/bin/aunpack \
		usr/share/man/man1/atool.1 /usr/share/man/man1/acat.1 \
		usr/share/man/man1/atool.1 /usr/share/man/man1/adiff.1 \
		usr/share/man/man1/atool.1 /usr/share/man/man1/als.1 \
		usr/share/man/man1/atool.1 /usr/share/man/man1/apack.1 \
		usr/share/man/man1/atool.1 /usr/share/man/man1/arepack.1 \
		usr/share/man/man1/atool.1 /usr/share/man/man1/aunpack.1
	dh_compress
	dh_fixperms
	dh_lintian
	dh_perl
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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