# arg 1:  the new package version
#pre_install() {
#}

# arg 1:  the new package version
post_install() {
	# do something here
	cp /usr/share/ahd2026/files/ahd2026.service /etc/systemd/system/ahd2026.service
	cp /usr/share/ahd2026/files/ahd2026.desktop /usr/share/applications/
	cp /usr/share/ahd2026/files/ahd2026-link.desktop /usr/share/applications/
	systemctl daemon-reload
	systemctl enable ahd2026
	systemctl start ahd2026
	update-desktop-database
}

# arg 1:  the new package version
# arg 2:  the old package version
pre_upgrade() {
    systemctl stop ahd2026 || true
}

# arg 1:  the new package version
# arg 2:  the old package version
post_upgrade() {
	cp /usr/share/ahd2026/files/ahd2026.service /etc/systemd/system/ahd2026.service
	cp /usr/share/ahd2026/files/ahd2026.desktop /usr/share/applications/
	cp /usr/share/ahd2026/files/ahd2026-link.desktop /usr/share/applications/
	systemctl daemon-reload
	systemctl enable ahd2026
	systemctl start ahd2026
	update-desktop-database
}

# arg 1:  the old package version
pre_remove() {
	systemctl stop ahd2026 || true
	systemctl disable ahd2026 || true
	rm /etc/systemd/system/ahd2026.service || true
}

# arg 1:  the old package version
post_remove() {
	rm /usr/share/applications/ahd2026.desktop || true
	rm /usr/share/applications/ahd2026-link.desktop || true
	update-desktop-database
}
