Initial release of Maemo 5 port of gnuplot
[gnuplot] / debian / gnuplot.postinst
diff --git a/debian/gnuplot.postinst b/debian/gnuplot.postinst
new file mode 100644 (file)
index 0000000..adb9bf5
--- /dev/null
@@ -0,0 +1,20 @@
+#!/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#