#!/usr/bin/make -f
#
# Univention Common Python and Shell Library
#  rules file for the debian package
#
# SPDX-FileCopyrightText: 2002-2025 Univention GmbH
# SPDX-License-Identifier: AGPL-3.0-only

#export DH_VERBOSE=1
export PYBUILD_NAME=univention-management-console
export PYBUILD_INSTALL_ARGS_python3=--install-scripts=/usr/sbin/
export PYBUILD_DISABLE_PYTHON2_SCRIPTS=1

override_dh_auto_build:
	./dev/dh-umc-module-build --core
	dh_auto_build

override_dh_auto_install:
	./dev/dh-umc-module-install --core
	dh_auto_install

override_dh_python3:
	dh_python3
	install -m0755 -d debian/univention-management-console-server/usr/sbin/
	$(RM) -r debian/python3-${PYBUILD_NAME}/usr/lib/python3/dist-packages/univention/__init__.py debian/python3-${PYBUILD_NAME}/usr/share/locale/ debian/python3-${PYBUILD_NAME}/usr/share/univention-management-console/
	mv debian/python3-${PYBUILD_NAME}/usr/sbin/ debian/${PYBUILD_NAME}-server/usr/

override_dh_install:
	dh_install -Xde.po

override_dh_installsystemd:
	dh_installsystemd --restart-after-upgrade

%:
	dh $@ --with python3,univention-l10n,ucr --buildsystem=pybuild
