#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk
export PYBUILD_NAME=offlineimap3

# Tests require a valid IMAP account in order to run (see test/README).
# Disable them for now.
export PYBUILD_DISABLE=test

export PYBUILD_DESTDIR=debian/offlineimap3

# Scripts should be installed to the same (private) directory.
# We cannot use --install-scripts in PYBUILD_INSTALL_ARGS since
# module name and script name are the same.
export PYBUILD_AFTER_INSTALL=\
	mv {destdir}/usr/bin/offlineimap {destdir}/usr/share/offlineimap3/run

%:
	dh $@ --with python3 --buildsystem=pybuild

execute_after_dh_auto_build:
	make -C docs man

# Python applications should have their module private
# These modules should be installed in /usr/share/<module-name>
override_dh_auto_install:
	dh_auto_install -- --install-dir /usr/share/offlineimap3/
