--- gkrellm.SlackBuild	2006-08-20 18:06:53.000000000 -0400
+++ gkrellm.SlackBuild.s390x	2006-08-20 14:18:50.000000000 -0400
@@ -1,7 +1,7 @@
 #!/bin/sh
-CWD=`pwd`
 TMP=${TMP:-/tmp}
-PKG=$TMP/package-gkrellm
+CWD=`pwd`
+PKG=/tmp/package-gkrellm
 
 VERSION=2.2.9
 PKGVER=2.2.9
@@ -10,7 +10,7 @@
 
 rm -rf $PKG
 mkdir -p $PKG
-cd $TMP
+cd /tmp
 rm -rf gkrellm-$VERSION
 tar xjvf $CWD/gkrellm-$VERSION.tar.bz2
 cd gkrellm-$VERSION
@@ -18,6 +18,10 @@
 # shadow effect by default (this seems better with Pango font
 # rendering):
 zcat $CWD/gkrellm.theme.defaults.diff.gz | patch -p1 --verbose || exit 1
+# Fix not being able to find 64-bit libraries
+cat $CWD/gkrellm-2.1.24-libdir.patch | patch -p1 --verbose || exit 1
+cat $CWD/plugin.path.diff | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find . -perm 777 -exec chmod 755 {} \;
 find . -perm 664 -exec chmod 644 {} \;
@@ -26,7 +30,8 @@
   INCLUDEDIR=/usr/include \
   MANDIR=/usr/man/man1 \
   LOCALEDIR=/usr/share/locale \
-  PKGCONFIGDIR=/usr/lib/pkgconfig
+  PKGCONFIGDIR=/usr/lib/pkgconfig \
+  SYSTEM_PLUGINS_DIR=/usr/lib64/gkrellm/plugins
 
 # We will need this installed to build plugins, so...
 make install
@@ -37,8 +42,9 @@
   INCLUDEDIR=$PKG/usr/include \
   MANDIR=$PKG/usr/man/man1 \
   LOCALEDIR=$PKG/usr/share/locale \
-  PKGCONFIGDIR=$PKG/usr/lib/pkgconfig
-mkdir -p $PKG/usr/lib/gkrellm2/plugins
+  PKGCONFIGDIR=$PKG/usr/lib/pkgconfig \
+  SYSTEM_PLUGINS_DIR=/usr/lib64/gkrellm/plugins
+mkdir -p $PKG/usr/lib64/gkrellm2/plugins
 mkdir -p $PKG/usr/doc/gkrellm-$VERSION
 cp -a \
   COPYRIGHT CREDITS INSTALL README Themes.html \
@@ -56,7 +62,7 @@
 cd gkrellm-countdown
 chown -R root:root .
 make
-cp gkrellm-countdown.so $PKG/usr/lib/gkrellm2/plugins
+cp gkrellm-countdown.so $PKG/usr/lib64/gkrellm2/plugins
 mkdir -p $PKG/usr/doc/gkrellm-countdown-$COUNTDOWN
 cp -a \
   COPYING ChangeLog README \
