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

MAINPACKAGE?=$(shell dpkg-parsechangelog | sed -n 's/Source: \(.*\)/\1/p')

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

%:
	dh $@ --sourcedir=source

override_dh_auto_install:
	dh_auto_install
	install -d $(CURDIR)/debian/jaaa/usr/share/applications/
	install -d $(CURDIR)/debian/jaaa/usr/share/pixmaps/
	install -m 644 $(CURDIR)/debian/*.desktop $(CURDIR)/debian/jaaa/usr/share/applications/
	install -m 644 $(CURDIR)/debian/*.xpm $(CURDIR)/debian/jaaa/usr/share/pixmaps/

override_dh_auto_build:
	dh_auto_build
	docbook-to-man debian/${MAINPACKAGE}.sgml > debian/${MAINPACKAGE}.1

override_dh_auto_clean:
	dh_auto_clean
	rm -f debian/${MAINPACKAGE}.1
