#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

DH_VERBOSE=1
export DH_OPTIONS=-v

DEB_BUILD_MAINT_OPTIONS := hardening=+all
include /usr/share/dpkg/buildflags.mk
ADAFLAGS += -gnatafno -gnatVa -gnatwa

%:
	dh $@

override_dh_auto_build:
	make MAKE_ARGS="-XUTIL_TIME_64=no" GPRFLAGS="-R -m -q"

override_dh_auto_test::

override_dh_auto_install:
	$(MAKE) DESTDIR=$(CURDIR)/debian/tmp prefix=/usr install
	dh_installdirs usr/bin
	dh_install debian/tmp/usr/bin/akt /usr/bin
	dh_installman debian/tmp/usr/share/man/man1/akt.1
	dh_strip
	files=`cd $(CURDIR)/debian/tmp/usr/share/akt && find . -type f`; \
        for i in $$files; do \
	  dir=`dirname $$i`; \
	  dh_install debian/tmp/usr/share/akt/$$i usr/share/akt/$$dir ; \
        done
	files=`cd $(CURDIR)/debian/tmp/usr/share/locale && find . -type f`; \
        for i in $$files; do \
	  dir=`dirname $$i`; \
	  dh_installdirs usr/share/locale/$$dir; \
	  dh_install debian/tmp/usr/share/locale/$$i usr/share/locale/$$dir ; \
        done
	rm -rf debian/tmp

.PHONY: override_dh_installdocs-indep

override_dh_installdocs-indep:
	make doc
	dh_installdocs -i
