Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added postrm script that can purge to the Debian packages #618

Merged
merged 3 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/debuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
gpg --keyserver $KEYSERVER --recv-key $CLOUD_KEY_ID
sudo -E gpg -v --output "$KEYFILE" --export $CLOUD_KEY_ID
sudo apt-get update
- name: update repo information
run: sudo apt-get update
- name: install devscripts
run: sudo apt-get install equivs devscripts pipx hub
- name: install dependencies
Expand Down Expand Up @@ -90,6 +92,8 @@ jobs:
env:
PBRT: /var/cache/pbuilder
steps:
- name: update repo information
run: sudo apt-get update
- name: install pbuilder
run: |
sudo apt-get install pbuilder qemu-user-static \
Expand Down
4 changes: 2 additions & 2 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ override_dh_auto_test: ;
endif

execute_after_dh_auto_build:
pandoc -o vzlogger.1 -s -t man debian/vzlogger.1.md
pandoc -o vzlogger.8 -s -t man debian/vzlogger.8.md

execute_after_dh_clean:
rm -f vzlogger.1
rm -f vzlogger.8

%:
dh $@
3 changes: 3 additions & 0 deletions debian/vzlogger.1.md → debian/vzlogger.8.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
% VZLOGGER(8) Volkszaehler project | System management commands
% Joachim Zobel <[email protected]>

# NAME

vzlogger -- A tool to read and log measurements of a wide variety of smart meters and sensors
Expand Down
2 changes: 1 addition & 1 deletion debian/vzlogger.manpages
Original file line number Diff line number Diff line change
@@ -1 +1 @@
vzlogger.1
vzlogger.8
27 changes: 16 additions & 11 deletions debian/vzlogger.postinst
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
#!/bin/sh -e

set -e

case "$1" in
configure)
if ! id vzlogger > /dev/null 2>&1 ; then
adduser --system --no-create-home --home /nonexistent \
--group --disabled-password --shell /bin/false \
vzlogger
usermod -a -G dialout vzlogger
fi

touch /var/log/vzlogger.log
chown vzlogger:adm /var/log/vzlogger.log
if ! id vzlogger > /dev/null 2>&1 ; then
adduser --quiet --system --no-create-home --home /nonexistent \
--group --disabled-password --shell /bin/false \
vzlogger
usermod -a -G dialout vzlogger
fi

touch /var/log/vzlogger.log
chown vzlogger:adm /var/log/vzlogger.log
;;

abort-upgrade|abort-remove|abort-deconfigure)
;;

*)
echo "$0 called with unknown argument \`$1'" >&2
exit 1
echo "$0 called with unknown argument \`$1'" >&2
exit 1
;;
esac

#DEBHELPER#

exit 0

27 changes: 27 additions & 0 deletions debian/vzlogger.postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh -e

set -e

case "$1" in
purge)
rm -f /var/log/vzlogger.log*
deluser --quiet --system vzlogger
delgroup --quiet --system vzlogger
;;

remove|abort-install|abort-upgrade|disappear)
;;

upgrade|failed-upgrade)
;;

*)
echo "$0 called with unknown argument \`$1'" >&2
exit 1
;;
esac

#DEBHELPER#

exit 0

Loading