packaging: add postinst for debian

This commit is contained in:
Kevin Yue 2022-05-26 21:44:31 +08:00
parent 048aa4799f
commit 0619e91bf5
2 changed files with 11 additions and 5 deletions

11
debian/postinst vendored Normal file
View File

@ -0,0 +1,11 @@
#!/bin/sh
set -e
# Update the the dbus user to logname
dbus_conf = /usr/share/dbus-1/system.d/com.yuezk.qt.GPService.conf
if [ -f $dbus_conf ]; then
sed -i "/LOGNAME/,+1s/user=\".*\"/user=\"$(logname)\"/" $dbus_conf
fi
#DEBHELPER#

5
debian/rules vendored
View File

@ -7,12 +7,7 @@ export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
export DEBIAN_PACKAGE=1 export DEBIAN_PACKAGE=1
dbus_conf = /usr/share/dbus-1/system.d/com.yuezk.qt.GPService.conf
%: %:
dh $@ dh $@
override_dh_installsystemd: override_dh_installsystemd:
# Update the the dbus user to logname
if [ -f $(dbus_conf) ] ; then sed -i "/LOGNAME/,+1s/user=\".*\"/user=\"`logname`\"/" $(dbus_conf) ; fi
dh_installsystemd gpservice.service dh_installsystemd gpservice.service