--- mozilla-thunderbird.SlackBuild	2006-09-14 20:33:24.000000000 -0400
+++ mozilla-thunderbird.SlackBuild.s390x	2007-01-28 11:22:37.000000000 -0500
@@ -3,16 +3,6 @@
 TMP=${TMP:-/tmp}
 PKG=$TMP/package-mozilla-thunderbird
 
-# This is not a source build script.  Rather, it builds a Slackware
-# package from the official binary tarball available from mozilla.org.
-# Using the official binaries seems like the most direct way to satify
-# the Mozilla project's concerns about quality control (and thus to
-# provide the most quality-certified package possible), and therefore
-# be able to use the official trademarks and logos.
-#
-# Thanks to the folks at the Mozilla Foundation for permission to
-# distribute this, and for all the great work!  :-)
-
 VERSION=1.5.0.7
 ARCH=${ARCH:-i686}
 BUILD=1
@@ -21,39 +11,60 @@
   mkdir -p $TMP
 fi
 rm -rf $PKG
-mkdir -p $PKG/usr/lib
-( cd $PKG/usr/lib
-  tar xzf $CWD/thunderbird-$VERSION.tar.gz
-  chown -R root:root .
+mkdir -p $PKG/usr/lib64
+
+cd $TMP
+rm -rf mozilla
+echo Unpacking the tarball...
+tar -jxf $CWD/thunderbird-$VERSION-source.tar.bz2
+cd mozilla
+cat $CWD/../mozilla-firefox/pangoxft.symbol.fix.diff | patch -p1 --backup --suffix=.orig || exit 1
+sleep 4
+
+rm -rf obj-s390x-ibm-linux
+cp -p $CWD/mozconfig ./.mozconfig
+
+chown -R root:root .
+gmake -f client.mk build
+
+rm -rf ~/.mozilla/thunderbird
+if [ -z $DISPLAY ]; then
+  echo Your DISPLAY variable is not set.  Invoking the thunderbird binary will fail.
+  exit 1;
+else echo The newly built thunderbird binary will now be called
+     echo Make sure you have your X server running on your desktop.
+     echo Hit the enter key when you are ready to proceed.
+     read ready
+fi
+
+( cd $TMP/mozilla/obj-$ARCH-ibm-linux/dist/bin
+  ./thunderbird
+)
+
+gmake -C $TMP/mozilla/obj-$ARCH-ibm-linux/mail/installer
+
+( cd $PKG/usr/lib64
+  tar -zxf $TMP/mozilla/obj-$ARCH-ibm-linux/dist/thunderbird-$VERSION.en-US.linux-$ARCH.tar.gz
   mv thunderbird thunderbird-$VERSION
   ln -sf thunderbird-$VERSION thunderbird
   cd thunderbird-$VERSION
-  zcat $CWD/mozilla-thunderbird-simple.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1
-  if [ ! $? = 0 ]; then
-    exit 1
-  fi
   zcat $CWD/mozilla-thunderbird-firefox.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1
-  if [ ! $? = 0 ]; then
-    exit 1
-  fi
   rm -f defaults/pref/all-thunderbird.js.orig
 )
 if [ ! $? = 0 ]; then
   exit 1
 fi
+
 mkdir -p $PKG/usr/bin
 ( cd $PKG/usr/bin
-  ln -sf /usr/lib/thunderbird-$VERSION/thunderbird .
+  ln -sf /usr/lib64/thunderbird-$VERSION/thunderbird .
+  #chown -R root:bin .
 )
-mkdir -p $PKG/usr/share/applications
-cat $CWD/mozilla-thunderbird.desktop > $PKG/usr/share/applications/mozilla-thunderbird.desktop
-mkdir -p $PKG/usr/share/pixmaps
-cat $CWD/thunderbird.png > $PKG/usr/share/pixmaps/thunderbird.png
 
 # These files/directories are usually created if Thunderbird is run as root, which on many
 # systems might (and possibly should) be never.  Therefore, if we don't see them we'll
 # put stubs in place to prevent startup errors.
-( cd $PKG/usr/lib/thunderbird-$VERSION
+( cd $PKG/usr/lib64/thunderbird-$VERSION
   if [ -d chrome ]; then
     if [ ! -r chrome/app-chrome.manifest ]; then
       echo > chrome/app-chrome.manifest
@@ -64,9 +75,13 @@
   fi
 )
 
+mkdir -p $PKG/usr/lib64/mozilla/plugins
+mkdir -p $PKG/usr/share/applications
+cp -p $CWD/mozilla-thunderbird.desktop $PKG/usr/share/applications/
+mkdir -p $PKG/usr/share/pixmaps
+cp -p $CWD/thunderbird.png $PKG/usr/share/pixmaps/
 mkdir $PKG/install
-cat $CWD/slack-desc > $PKG/install/slack-desc
-
+cp -p $CWD/slack-desc $PKG/install/slack-desc
 cd $PKG
 makepkg -l y -c n $TMP/mozilla-thunderbird-$VERSION-$ARCH-$BUILD.tgz
 
