#!/bin/sh

set -e

case "$1" in
	configure)
		mkdir -p /var/log/glusterfs
		chown root:root /var/log/glusterfs
		chmod 0755 /var/log/glusterfs
		getent group gluster >/dev/null 2>&1 || addgroup --system gluster
		adduser --system --no-create-home --home /var/lib/glusterd --quiet gluster --ingroup gluster || true
	;;

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

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


# Automatically added by dh_python3
if command -v py3compile >/dev/null 2>&1; then
	py3compile -p glusterfs-common:amd64 /usr/lib/x86_64-linux-gnu/glusterfs/python/syncdaemon
fi
if command -v pypy3compile >/dev/null 2>&1; then
	pypy3compile -p glusterfs-common:amd64 /usr/lib/x86_64-linux-gnu/glusterfs/python/syncdaemon || true
fi

# End automatically added section

# Automatically added by dh_python3
if command -v py3compile >/dev/null 2>&1; then
	py3compile -p glusterfs-common:amd64 /usr/lib/x86_64-linux-gnu/glusterfs/glusterfind
fi
if command -v pypy3compile >/dev/null 2>&1; then
	pypy3compile -p glusterfs-common:amd64 /usr/lib/x86_64-linux-gnu/glusterfs/glusterfind || true
fi

# End automatically added section

# Automatically added by dh_python3
if command -v py3compile >/dev/null 2>&1; then
	py3compile -p glusterfs-common:amd64 
fi
if command -v pypy3compile >/dev/null 2>&1; then
	pypy3compile -p glusterfs-common:amd64  || true
fi

# End automatically added section


exit 0
