#!/usr/bin/make -f

FILENAME = $(DEB_SOURCE_PACKAGE)_$(DEB_UPSTREAM_VERSION).orig.tar.gz
URL = http://ftp.gnu.org/pub/gnu/commoncpp/ucommon-$(DEB_UPSTREAM_VERSION).tar.gz

# Ensure at build time that the library has no dependencies on undefined
# symbols, and speed up loading.
LDFLAGS += -Wl,-z,defs -Wl,-O1

DEB_DH_INSTALL_ARGS := --sourcedir=debian/tmp
DEB_DH_STRIP_ARGS := --dbg-package=libucommon3-dbg
DEB_INSTALL_DOCS_ALL :=
DEB_INSTALL_CHANGELOG_ALL := ChangeLog
DEBIAN_DIR := $(shell echo ${MAKEFILE_LIST} | awk '{print $$1}' | xargs dirname )
UPSTREAM_VERSION ?=$(shell uscan --dehs | sed -n 's/.*<upstream-version>\(.*\)<\/upstream-version>.*/\1/p')

%:
	dh $@

.PHONY: override_dh_strip override_dh_auto_build override_dh_auto_install

override_dh_strip:
	dh_strip $(DEB_DH_STRIP_ARGS)

override_dh_auto_build:
	dh_auto_build
	$(MAKE) doxy 

override_dh_auto_install:
	dh_auto_install
	mkdir -p debian/tmp/usr/share/doc/libucommon-dev
	cp doc/html/* debian/tmp/usr/share/doc/libucommon-dev

