#!/usr/bin/make -f
include /usr/share/dpkg/architecture.mk

override_dh_auto_configure:
	dh_auto_configure -- \
		--cache-file=config.cache \
		--includedir=/usr/include/ossp \
		--libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
		--with-perl \
		--with-perl-compat \
		--without-dce \
		--with-cxx \
		--with-libname=libossp-uuid \
		$(shell dpkg-buildflags --export=cmdline)

override_dh_auto_build:
	dh_auto_build   -- MFLAGS='NOECHO= NOOP=@ \
		CC="$(CC)" \
		OPTIMIZE="$(shell dpkg-buildflags --get CPPFLAGS; dpkg-buildflags --get CFLAGS)" \
		OTHERLDFLAGS="$(shell dpkg-buildflags --get LDFLAGS)"'

override_dh_installchangelogs:
	dh_installchangelogs debian/changelog.upstream

override_dh_installdocs:
	dh_installdocs README
	cp debian/NEWS.upstream debian/libossp-uuid16/usr/share/doc/libossp-uuid16/NEWS

override_dh_auto_install:
	chrpath -d perl/blib/arch/auto/OSSP/uuid/uuid.so
	dh_auto_install -- MFLAGS='NOECHO= NOOP=@ INSTALLDIRS=vendor'

%:
	dh $@
