+%pre common
+if [ -n "`/usr/bin/getgid distcc`" ]; then
+ if [ "`/usr/bin/getgid distcc`" != "137" ]; then
+ echo "Error: group distcc doesn't have gid=137. Correct this before installing distccd." 1>&2
+ exit 1
+ fi
+else
+ /usr/sbin/groupadd -g 137 distcc 1>&2
+fi
+if [ -n "`/bin/id -u distcc 2>/dev/null`" ]; then
+ if [ "`/bin/id -u distcc`" != "137" ]; then
+ echo "Error: user distcc doesn't have uid=137. Correct this before installing distccd server." 1>&2
+ exit 1
+ fi
+else
+ /usr/sbin/useradd -u 137 -d /tmp -s /bin/false -c "distcc user" \
+ -g distcc distcc 1>&2
+fi
+
+%postun common
+if [ "$1" = "0" ]; then
+ %userremove distcc
+ %groupremove distcc
+fi
+