#!/usr/bin/make -f

# Comment out this line for debugging
export DH_VERBOSE:=1

-include /usr/share/dpkg/buildtools.mk

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
LIBDIR:=/usr/lib/$(DEB_HOST_MULTIARCH)
INSTDIR:=debian/tmp/$(LIBDIR)
VERSION:=2.0.0

# To enable all, uncomment following line
DEB_BUILD_MAINT_OPTIONS:= hardening=+all
DEB_CFLAGS_MAINT_APPEND:= -Wall -pedantic -fPIC
export DEB_BUILD_MAINT_OPTIONS
export DEB_CFLAGS_MAINT_APPEND

# The magic rule for debhelper
%:
	dh $@ 



override_dh_auto_clean:
	dh_auto_clean
	rm -f gctp.pc

override_dh_auto_install:
	sed -e 's%@LIBDIR@%$(LIBDIR)%' < gctp.pc.in | \
		sed -e 's/@VERSION@/$(VERSION)/' > gctp.pc
	dh_auto_install -- 'CC=$(CC)'
	rm $(INSTDIR)/libgctp.la $(INSTDIR)/libgctp.so
	mv $(INSTDIR)/libgctp.a $(INSTDIR)/libgctp2.a
	mv $(INSTDIR)/libgctp-2.0.0.so $(INSTDIR)/libgctp-2.so.2.0.0

