#!/usr/bin/make -f

include /usr/share/dpkg/default.mk

%:
	dh $@ --buildsystem=cmake --with sphinxdoc

execute_after_dh_auto_build:
	( cd bin/dynamic/; \
	  VERSION_UPSTREAM=$$(echo ${DEB_VERSION_UPSTREAM} | sed 's/\+.*//'); \
	  MAJOR=$$(echo ${DEB_VERSION_UPSTREAM} | sed 's/\..*//'); \
          patchelf --set-soname libxeddsa.so.$${MAJOR} libxeddsa.so.$${VERSION_UPSTREAM} )
	cd docs && $(MAKE) html

override_dh_dwz: # override dwz as it breaks on shlibs edited by patchelf
