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

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# For DEB_VERSION
include /usr/share/dpkg/pkg-info.mk

# Get version numbers for SONAME from changelog
LVER =    $(shell echo $(DEB_VERSION) | sed -e 's/\([0-9]*\)\..*/\1/')
LSUBVER = $(shell echo $(DEB_VERSION) | sed -e 's/.*\.\([0-9]*\).*/\1/')
export LVER
export LSUBVER

# Python versions supported by this package
PYVERS = $(shell pyversions -r -v)
export PYVERS

# Extend build flags
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND += -Wall -Wno-unused

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)


%:
	dh $@ --with python2

override_dh_auto_build:
	make lib
	make standalone
	for py in $(PYVERS); do \
		PYVER=$$py make python; \
	done

override_dh_auto_install:
	dh_auto_install -- libdir=/usr/lib/$(DEB_HOST_MULTIARCH)/
