#!/usr/bin/make -f
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

include /usr/share/dpkg/architecture.mk
export DEB_HOST_MULTIARCH

ifneq ($(DEB_HOST_MULTIARCH),$(DEB_BUILD_MULTIARCH))
  CC = $(DEB_HOST_GNU_TYPE)-gcc
  export DEB_HOST_GNU_TYPE
else
  CC = cc
  unexport DEB_HOST_GNU_TYPE
endif

%:
	dh $@

pkg_run = jbigkit-bin

override_dh_auto_build:
	make CC="$(CC)"

override_dh_installman:
	dh_installman -p$(pkg_run) debian/jbgtopbm85.1 debian/pbmtojbg85.1

debian/jbgtopbm85.1:
	help2man -n "reads a bi-level image entity (BIE) as input file" \
		--no-discard-stderr --output=debian/jbgtopbm85.1 --no-info jbgtopbm85

debian/pbmtojbg85.1:
	help2man -n "creates bi-level image entity (BIE) as output file" \
		--no-discard-stderr --output=debian/pbmtojbg85.1 --no-info pbmtojbg85

get-orig-source:
	uscan --verbose --force-download --rename
