--- qt.SlackBuild	2007-08-09 14:32:50.000000000 -0400
+++ qt.SlackBuild.s390x	2009-06-30 12:49:38.000000000 -0400
@@ -36,7 +36,7 @@
   SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
 elif [ "$ARCH" = "i486" ]; then
   SLKCFLAGS="-O2 -march=i486 -mtune=i686"
-elif [ "$ARCH" = "s390" ]; then
+elif [ "$ARCH" = "s390x" ]; then
   SLKCFLAGS="-O2"
 elif [ "$ARCH" = "x86_64" ]; then
   SLKCFLAGS="-O2"
@@ -54,6 +54,9 @@
 tar xjvf $CWD/qt-x11-free-$VERSION.tar.bz2 || exit 1
 mv qt-x11-free-$VERSION qt
 cd qt
+# This is needed because QT gets confused between where to install things, versus where
+# it is building them as it goes along
+ln -sf lib lib64
 
 if [ $ARCH = "i486" ]; then
   zcat $CWD/qt.x86.cflags.diff.gz | patch -p1 || exit 1
@@ -108,16 +111,27 @@
  -plugin-style-platinum \
  -plugin-style-sgi \
  -plugin-style-windows \
- -enable-opengl
+ -enable-opengl \
+ -platform linux-g++-64 \
+ -libdir /usr/lib/qt-${VERSION}/lib64
 
 # We're using '-i' to work around a bug where the build tries to strip html files.
 # Build the important stuff:
-make -j4 -i symlinks sub-src sub-tools || exit 1
+make -j3 -i symlinks sub-src sub-tools || exit 1
 make install INSTALL_ROOT=$PKG || exit 1
 
 # The infamous qt -> qt-${VERSION} link that lets us cheat on the QTDIR ;-)
 ( cd $PKG/usr/lib ; ln -sf qt-${VERSION} qt)
 
+( cd $PKG/usr/lib/qt/
+  rm lib64 ; mv lib lib64
+)
+
+( cd $PKG/usr/lib/qt/
+  # Fix the qmake.conf file
+  cat $CWD/qmake.conf.diff | patch -p0 --verbose
+)
+
 # Add man pages:
 mkdir -p $PKG/usr/man
 cp -a doc/man/* $PKG/usr/man
@@ -163,7 +177,7 @@
 ( cd $PKG/usr/doc/${PKGNAM}-$VERSION ; ln -sf /usr/lib/qt-3.3.8/doc/html . )
 
 mkdir -p $PKG/install
-zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
 cat $CWD/slack-desc > $PKG/install/slack-desc
 
 cd $PKG
