When installing toolbox from debian packages, the toolbox and
toolbox_ipc groups are not created, and the permissions and
ownership of /var/lib/toolbox are incorrect.
This commit adds postinst and postrm scripts that create and remove
the toolbox and toolbox_ipc groups during installation/removal, and
set the permissions on /var/lib/toolbox appropriately.
install:
mkdir -p $(DESTDIR)/$(PREFIX)/share/toolbox
mkdir -p $(DESTDIR)/$(PREFIX)/bin
+ mkdir -p $(DESTDIR)/var/lib/toolbox/ipc
cp toolbox.sh $(DESTDIR)/$(PREFIX)/share/toolbox/.
cp -r include $(DESTDIR)/$(PREFIX)/share/toolbox/.
chown -R root.root $(DESTDIR)/$(PREFIX)/share/toolbox
Source: toolbox
Priority: optional
Maintainer: Matthias Kruk <m@m10k.eu>
-Build-Depends: debhelper (>= 9), make, coreutils, findutils, grep, sed
+Build-Depends: debhelper (>= 9), adduser (>= 3.11), make, coreutils, findutils, grep, sed
Standards-Version: 3.9.8
Section: shells
Homepage: https://m10k.eu/toolbox.html
--- /dev/null
+#!/bin/sh
+
+main() {
+ # If a group exists, there is a chance that the user
+ # has customized directory ownership and permissions,
+ # so we don't change it.
+
+ if addgroup toolbox; then
+ chown root.toolbox /var/lib/toolbox
+ chmod 770 /var/lib/toolbox
+ fi
+
+ if addgroup toolbox_ipc; then
+ chown root.toolbox_ipc /var/lib/toolbox/ipc
+ chmod 770 /var/lib/toolbox/ipc
+ fi
+
+ return 0
+}
+
+{
+ main "$@"
+ exit "$?"
+}
--- /dev/null
+#!/bin/sh
+
+main() {
+ delgroup toolbox
+ delgroup toolbox_ipc
+
+ return 0
+}
+
+{
+ main "$@"
+ exit "$?"
+}