Index: debian/changelog
===================================================================
--- debian/changelog	(revision 1bdb08d6797a05598a531d32ecddf79d7a0b45ec)
+++ debian/changelog	(revision 90530ec16c0a1e64a0cffaca1b1445c8aa579719)
@@ -1,2 +1,7 @@
+gnuboat (0.4.9) jessie; urgency=low
+
+  * Fixed gnuboat-puppet postinst script
+
+ -- EngSaS - Maintainer <info@engsas.de>  Tue, 08 Aug 2017 14:45:00 +0200
 gnuboat (0.4.8) jessie; urgency=low
 
Index: debian/control
===================================================================
--- debian/control	(revision 1bdb08d6797a05598a531d32ecddf79d7a0b45ec)
+++ debian/control	(revision 90530ec16c0a1e64a0cffaca1b1445c8aa579719)
@@ -3,5 +3,6 @@
 Priority: optional
 Maintainer: EngSaS - Maintainer <info@engsas.de>
-Build-Depends: debhelper (>= 9), lsb-release, dh-python, dh-systemd (>= 1.5), po-debconf, python-all, python3-all, python-all-dbg, python3-all-dbg, python-setuptools, python3-setuptools, python-rrdtool, python-pynmea2, python3-pynmea2, phing, php-pear
+# Removed po-debconf, as puppet could not be run from postinst script (see gnuboat-puppet.postinst for details)
+Build-Depends: debhelper (>= 9), lsb-release, dh-python, dh-systemd (>= 1.5), python-all, python3-all, python-all-dbg, python3-all-dbg, python-setuptools, python3-setuptools, python-rrdtool, python-pynmea2, python3-pynmea2, phing, php-pear
 Standards-Version: 3.9.6
 Homepage: https://trac.falaba.de/gnuboat
Index: debian/gnuboat-jessie.postinst
===================================================================
--- debian/gnuboat-jessie.postinst	(revision 1bdb08d6797a05598a531d32ecddf79d7a0b45ec)
+++ debian/gnuboat-jessie.postinst	(revision 90530ec16c0a1e64a0cffaca1b1445c8aa579719)
@@ -1,3 +1,3 @@
-#!/bin/bash
+#!/bin/sh
 
 set -e
Index: debian/gnuboat-puppet.config
===================================================================
--- debian/gnuboat-puppet.config	(revision 1bdb08d6797a05598a531d32ecddf79d7a0b45ec)
+++ debian/gnuboat-puppet.config	(revision 90530ec16c0a1e64a0cffaca1b1445c8aa579719)
@@ -4,7 +4,7 @@
 
 # Debconf library
-. /usr/share/debconf/confmodule
+#. /usr/share/debconf/confmodule
 
-db_input medium gnuboat-puppet/runpuppetagent || true
-db_go
+#db_input medium gnuboat-puppet/runpuppetagent || true
+#db_go
 
Index: debian/gnuboat-puppet.postinst
===================================================================
--- debian/gnuboat-puppet.postinst	(revision 1bdb08d6797a05598a531d32ecddf79d7a0b45ec)
+++ debian/gnuboat-puppet.postinst	(revision 90530ec16c0a1e64a0cffaca1b1445c8aa579719)
@@ -1,21 +1,22 @@
-
-#!/bin/bash
+#!/bin/sh
 
 set -e
 
 # Run puppet, if wanted by the user (in upgrade case)
-if [ "$1" = configure" ]; then
-	if [ ! -z "$2"]; then
+# Not possible, as this apt instance locks the database
+# and therefore the puppet apt instance is hanging
+#if [ "$1" = configure ]; then
+#	if [ ! -z $2 ]; then
 		# it's an upgrade
 		# Source debconf library.
-		. /usr/share/debconf/confmodule
-
-		db_get gnuboat-puppet/runpuppetagent
-		if [ "$RET" = "true" ]; then
-			puppet apply --test --config /etc/puppet/gnuboat_puppet.conf --environment gnuboat /etc/puppet/environments/gnuboat/manifests/ || true
-		fi
-		
-	fi
-fi
+#		. /usr/share/debconf/confmodule
+#
+#		db_get gnuboat-puppet/runpuppetagent
+#		if [ "$RET" = "true" ]; then
+#			puppet apply --test --config /etc/puppet/gnuboat_puppet.conf --environment gnuboat /etc/puppet/environments/gnuboat/manifests/ || true
+#		fi
+#	fi
+#fi
+echo 'To apply the GNUBoat config to your system run "puppet apply --test --config /etc/puppet/gnuboat_puppet.conf --environment gnuboat /etc/puppet/environments/gnuboat/manifests/"'
 
 #DEBHELPER#
Index: debian/python3-gnuboat.postinst
===================================================================
--- debian/python3-gnuboat.postinst	(revision 1bdb08d6797a05598a531d32ecddf79d7a0b45ec)
+++ debian/python3-gnuboat.postinst	(revision 90530ec16c0a1e64a0cffaca1b1445c8aa579719)
@@ -1,1 +1,12 @@
-python2-gnuboat.postinst
+#!/bin/sh
+set -e
+
+mkdir -p /var/spool/gnuboat
+mkdir -p /var/lib/gnuboat
+mkdir -p /var/log/gnuboat
+chown www-data:www-data /var/spool/gnuboat /var/lib/gnuboat /var/log/gnuboat
+
+
+#DEBHELPER#
+
+exit 0
Index: debian/python3-gnuboat.prerm
===================================================================
--- debian/python3-gnuboat.prerm	(revision 1bdb08d6797a05598a531d32ecddf79d7a0b45ec)
+++ debian/python3-gnuboat.prerm	(revision 90530ec16c0a1e64a0cffaca1b1445c8aa579719)
@@ -1,1 +1,26 @@
-python2-gnuboat.prerm
+#!/bin/sh
+set -e
+
+DIR_DATA="/var/lib/gnuboat/"
+DIR_LOG="/var/log/gnuboat/"
+DIR_SPOOL="/var/spool/gnuboat"
+
+rm -R "${DIR_SPOLL}"
+
+if [ "$(ls -A ${DIR_DATA})" ]; then
+	# do not remove the data directory
+	echo "Your data directory (${DIR_DATA}) is not empty. Leaving the data directory untouched!"
+else
+	rm -R "${DIR_DATA}"
+fi
+
+if [ "$(ls -A ${DIR_LOG})" ]; then
+        # do not remove the data directory
+        echo "Your log directory (${DIR_LOG}) is not empty. Leaving the log directory untouched!"
+else
+        rm -R "${DIR_LOG}"
+fi
+
+#DEBHELPER#
+
+exit 0
