#!/bin/sh -e
## 10-gtablix.dpatch by Steffen Joeris <steffen.joeris@skolelinux.de>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Here we make gtablix debianlike :=)

if [ $# -lt 1 ]; then
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1
fi

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"

case "$1" in
      -patch) patch $patch_opts -p1 < $0;;
      -unpatch) patch $patch_opts -p1 -R < $0;;
      *)
      echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
      exit 1;;
esac

exit 0

@DPATCH@
--- gtablix.orig	2005-11-18 13:15:24.000000000 +0100
+++ gtablix-0.0.9-10/gtablix	2005-11-18 13:15:55.000000000 +0100
@@ -27,12 +27,12 @@
 my $version = "0.0.9-11";
 my $debug = 0;
 
-use lib "/usr/lib";
+use lib "/usr/share";
 use lib "./modules";
 
 my $libdir = $0;
 	$libdir =~ s/\/gtablix//;
-if ($libdir eq '/usr/bin') { $libdir = '/usr/lib'; }
+if ($libdir eq '/usr/bin') { $libdir = '/usr/share'; }
 
 # -----------------------------------
 
@@ -81,7 +81,7 @@
 my $docdir;
 my $picdir;
 my $tempdir = tempdir()."-gtablix";
-if ($libdir eq '/usr/lib') {
+if ($libdir eq '/usr/share') {
 	$picdir = '/usr/share/gtablix';
 	$docdir = '/usr/share/doc/gtablix';
 } else {
