#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

CMAKE_FLAGS += -DCMAKE_SKIP_RPATH=ON \
               -DCMAKE_BUILD_TYPE:STRING=Release \
               -DCMAKE_INSTALL_PREFIX:STRING=/usr \
               -DSYSCONFDIR:STRING=/etc \
               -DDEBIAN_LAYOUT=ON

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

override_dh_auto_configure:
	dh_auto_configure -- $(CMAKE_FLAGS)

override_dh_auto_build:
	dh_auto_build
	dh_auto_build -- sphinx_guide_html

override_dh_install:
	dh_install -prozofs-doc --sourcedir=$(CURDIR)/obj-$(DEB_BUILD_MULTIARCH) doc/users_guide_sphinx/html  /usr/share/doc/rozofs-doc
	dh_install
	# Manually avoid conflict with inn2 (#846571) until
	# https://github.com/rozofs/rozofs/issues/142 is fixed
	mv debian/rozofs-storaged/usr/share/man/man5/storage.conf.5 debian/rozofs-storaged/usr/share/man/man5/rozofs-storage.conf.5
