#!/usr/bin/make -f

export BUP_PYTHON_CONFIG := python3-config
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND := -Wno-error

%:
	dh $@ --with python3

override_dh_auto_configure:
	./configure

override_dh_auto_build-indep:
	$(MAKE) Documentation/all

override_dh_auto_install:
	$(CURDIR)/debian/gen_checkout_info.sh > $(CURDIR)/lib/bup/checkout_info.py
	$(MAKE) PREFIX="/usr" DESTDIR="$(CURDIR)/debian/tmp" install

override_dh_installman:
	dh_installman

	install -m0755 -d debian/bup-doc/usr/share/man/man5
	mv \
		"$(CURDIR)/debian/bup-doc/usr/share/man/man1/bup-config.5" \
		"$(CURDIR)/debian/bup-doc/usr/share/man/man5/bup-config.5"
