Add gp-suspend.service

This commit is contained in:
Kevin Yue
2024-03-27 09:19:08 -04:00
parent 187ca778f2
commit cdd4079036
10 changed files with 148 additions and 9 deletions

View File

@@ -1,3 +1,7 @@
INCLUDE_SYSTEMD ?= $(shell [ -d /run/systemd/system ] && echo 1 || echo 0)
# Enable the systemd service after installation
ENABLE_SERVICE ?= 1
install:
@echo "===> Installing..."
@@ -14,9 +18,26 @@ install:
install -Dm644 artifacts/usr/share/icons/hicolor/256x256@2/apps/gpgui.png $(DESTDIR)/usr/share/icons/hicolor/256x256@2/apps/gpgui.png
install -Dm644 artifacts/usr/share/polkit-1/actions/com.yuezk.gpgui.policy $(DESTDIR)/usr/share/polkit-1/actions/com.yuezk.gpgui.policy
# Install the service
if [ $(INCLUDE_SYSTEMD) -eq 1 ]; then \
install -Dm644 artifacts/etc/systemd/system/gpgui.service $(DESTDIR)/usr/lib/systemd/system/gpgui.service; \
if [ $(ENABLE_SERVICE) -eq 1 ]; then \
systemctl --system daemon-reload; \
systemctl enable gpgui.service; \
fi; \
fi
uninstall:
@echo "===> Uninstalling from $(DESTDIR)..."
# Disable the systemd service
if [ -d /run/systemd/system ]; then \
systemctl disable gp-suspend.service >/dev/null || true; \
fi
rm -f $(DESTDIR)/lib/systemd/system/gp-suspend.service
rm -f $(DESTDIR)/usr/lib/systemd/system/gp-suspend.service
rm -f $(DESTDIR)/usr/bin/gpclient
rm -f $(DESTDIR)/usr/bin/gpservice
rm -f $(DESTDIR)/usr/bin/gpauth