mirror of
https://github.com/cottongin/cardputerzero-sync.git
synced 2026-11-20 14:44:47 -06:00
feat(packaging): add systemd user unit, APPLaunch entry, and arm64 deb builder
This commit is contained in:
10
packaging/debian/control
Normal file
10
packaging/debian/control
Normal file
@@ -0,0 +1,10 @@
|
||||
Package: cp0-sync
|
||||
Version: 1.0.0-m5stack1
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Architecture: arm64
|
||||
Maintainer: CardputerZero Sync <noreply@local>
|
||||
Depends: python3 (>= 3.9), libsqlite3-0, libfreetype6
|
||||
Description: Automatic one-way photo sync daemon and LVGL companion UI for CardputerZero
|
||||
Background systemd user daemon (cp0-syncd) and 320x170 companion UI
|
||||
(cp0-sync-ui) for syncing photos over Tailscale to a Mac receiver.
|
||||
18
packaging/debian/postinst
Executable file
18
packaging/debian/postinst
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ "$1" = "configure" ]; then
|
||||
if command -v systemctl >/dev/null 2>&1; then
|
||||
systemctl --global enable cp0-syncd.service || true
|
||||
|
||||
if command -v loginctl >/dev/null 2>&1; then
|
||||
for user_entry in $(loginctl list-users --no-legend 2>/dev/null | awk '{print $2}'); do
|
||||
[ -n "$user_entry" ] || continue
|
||||
systemctl --machine="${user_entry}@.host" --user daemon-reload >/dev/null 2>&1 || true
|
||||
systemctl --machine="${user_entry}@.host" --user restart cp0-syncd.service >/dev/null 2>&1 || true
|
||||
done
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
19
packaging/debian/prerm
Executable file
19
packaging/debian/prerm
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
remove|deconfigure)
|
||||
if command -v systemctl >/dev/null 2>&1; then
|
||||
if command -v loginctl >/dev/null 2>&1; then
|
||||
for user_entry in $(loginctl list-users --no-legend 2>/dev/null | awk '{print $2}'); do
|
||||
[ -n "$user_entry" ] || continue
|
||||
systemctl --machine="${user_entry}@.host" --user stop cp0-syncd.service >/dev/null 2>&1 || true
|
||||
done
|
||||
fi
|
||||
systemctl --global disable cp0-syncd.service >/dev/null 2>&1 || true
|
||||
fi
|
||||
rm -rf /usr/lib/cp0-sync/cp0_syncd/__pycache__
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user