#!/usr/bin/make -f
# SPDX-License-Identifier: LGPL-2.0-or-later
# SPDX-FileCopyrightText: 2023 Jonathan Riddell <jr@jriddell.org>

%:
	dh $@ --with kf6 --buildsystem kf6

	#!/usr/bin/make -f

override_dh_auto_configure:
	dh_auto_configure -- -DBUILD_MAN_PAGES=ON \
	-DSESSION_COMMAND="/etc/plasmalogin/Xsession" \
	-DWAYLAND_SESSION_COMMAND="/etc/plasmalogin/wayland-session" \
	-DDBUS_CONFIG_FILENAME="plasmalogin_org.freedesktop.DisplayManager.conf" \
	-DINSTALL_PAM_CONFIGURATION=OFF \
	-DBUILD_TESTING=OFF

override_dh_installsystemd:
	dh_installsystemd -pplasmalogin --no-start -r plasmalogin.service

override_dh_installinit:
	dh_installinit --noscripts

override_dh_install:
	# not installed, as the Debian version is used instead
	rm -f $(CURDIR)/debian/tmp/lib/systemd/system/plasmalogin.service $(CURDIR)/debian/tmp/usr/lib/systemd/system/plasmalogin.service
	# cp debian specific files
	dh_install

override_dh_fixperms-arch:
	# ensure installed scripts are marked as executable
	chmod +x $(CURDIR)/debian/plasmalogin/etc/plasmalogin/Xsession
	chmod +x $(CURDIR)/debian/plasmalogin/etc/plasmalogin/wayland-session
	dh_fixperms

override_dh_installpam:
	dh_installpam --name=plasmalogin
	dh_installpam --name=plasmalogin-autologin
	dh_installpam --name=plasmalogin-greeter

override_dh_auto_test:
	#do not run tests
	true
