--- /dev/null
+#!/bin/sh
+
+set -e
+
+# hack around bug #156463 in dpkg: on the upgrade from old packages
+# versions we want to replace /usr/share/doc/gnuplot with a symlink to
+# the gnuplot-nox-docs (as gnuplot depends on gnuplot-nox, the docs
+# exist). However, on upgrade the directory survives overwriting...
+
+DIR=/usr/share/doc/gnuplot
+
+# not a link but a directory?
+if [ ! -L $DIR -a -d $DIR ] ; then
+ # should be empty because previous package was removed
+ rmdir $DIR
+ # create the same symlink as this package already provides...
+ ln -s gnuplot-nox $DIR
+fi
+
+#DEBHELPER#