#!/usr/bin/make -f

# DH_VERBOSE := 1
export LC_ALL=C.UTF-8

AMPL_FILE:=$(shell find ./ -name amplsolver.a)
REN_AMPL_FILE:=$(addsuffix libamplsolver.a,$(dir $(AMPL_FILE)))

include /usr/share/dpkg/default.mk

export DEB_BUILD_MAINT_OPTIONS=hardening=+all

# --no-parallel corrects #1091063, but it may be possible to specify the
# missing header dependency in proper make targets, but no parallelism
# as a workaround is good enough for this not-too-large package.
%:
	dh $@ --no-parallel

override_dh_install:
	mv $(AMPL_FILE) $(REN_AMPL_FILE)
	dh_install
	d-shlibmove --commit \
		    --multiarch \
		    --devunversioned \
                    sys.*/*.so

get-orig-source:
	. debian/get-orig-source
