#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDTOOLS=1
-include /usr/share/dpkg/buildtools.mk

# version are the first two decimals
SOVERSION := 0.7.0
MAJOR     := $(shell echo ${SOVERSION} | cut -d. -f1)
MINOR     := $(shell echo ${SOVERSION} | cut -d. -f2)
PATCH     := $(shell echo ${SOVERSION} | cut -d. -f3)

LIBFILE=usr/lib/$(DEB_HOST_MULTIARCH)/libomemo
SOFILE=${LIBFILE}.so
AFILE=${LIBFILE}.a

%:
	dh $@

# Makefile is not generated, so we need to explicitly set PREFIX variable
override_dh_auto_install:
	PREFIX=/usr dh_auto_install

override_dh_auto_build:
	PREFIX=/usr dh_auto_build

override_dh_link:
	dh_link -plibomemo0 ${SOFILE}.${SOVERSION} ${SOFILE}.${MAJOR}.${MINOR}
	dh_link -plibomemo0 ${SOFILE}.${SOVERSION} ${SOFILE}.${MAJOR}
	dh_link -plibomemo-dev ${SOFILE}.${MAJOR} ${SOFILE}
