--- mozilla-firefox.SlackBuild	2008-12-18 13:42:39.000000000 -0500
+++ mozilla-firefox.SlackBuild.s390x	2009-06-30 16:33:18.000000000 -0400
@@ -3,16 +3,6 @@
 TMP=${TMP:-/tmp}
 PKG=$TMP/package-mozilla-firefox
 
-# 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=2.0.0.20
 ARCH=${ARCH:-i686}
 BUILD=1
@@ -21,16 +11,42 @@
   mkdir -p $TMP
 fi
 rm -rf $PKG
-mkdir -p $PKG/usr/lib
-( cd $PKG/usr/lib
-  tar xzf $CWD/firefox-$VERSION.tar.gz || exit 1
+mkdir -p $PKG/usr/lib64
+
+cd $TMP
+rm -rf mozilla
+echo Unpacking the tarball...
+tar -jxf $CWD/firefox-$VERSION-source.tar.bz2 || exit 1
+cd mozilla
+#cat $CWD/firefox-0.7.3-freetype-compile.patch | patch -p0
+#cat $CWD/pangoxft.symbol.fix.diff | patch -p1 --backup --suffix=.orig || exit 1
+
+echo rm -rf obj-s390x-ibm-linux
+cp -p $CWD/mozconfig ./.mozconfig
+
+chown -R root:root .
+gmake -f client.mk build
+
+rm -rf ~/.mozilla/firefox
+if [ -z $DISPLAY ]; then
+  echo Your DISPLAY variable is not set.  Invoking the firefox binary will fail.
+  exit 1;
+else echo The newly built firefox 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
+
+pushd $TMP/mozilla/obj-$ARCH-ibm-linux/dist/bin
+echo ./firefox
+
+gmake -C $TMP/mozilla/obj-$ARCH-ibm-linux/browser/installer
+
+( cd $PKG/usr/lib64
+  tar -zxf $TMP/mozilla/obj-$ARCH-ibm-linux/dist/firefox-$VERSION.en-US.linux-$ARCH.tar.gz
   mv firefox firefox-$VERSION
   ln -sf firefox-$VERSION firefox
   cd firefox-$VERSION
-  zcat $CWD/mozilla-firefox-simple.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1
-  if [ ! $? = 0 ]; then
-    exit 1
-  fi
   zcat $CWD/mozilla-firefox-thunderbird.diff.gz | patch -p1 --verbose --suffix=.orig || exit 1
   if [ ! $? = 0 ]; then
     exit 1
@@ -44,33 +60,20 @@
 if [ ! $? = 0 ]; then
   exit 1
 fi
+
 mkdir -p $PKG/usr/bin
 ( cd $PKG/usr/bin
-  ln -sf /usr/lib/firefox-$VERSION/firefox .
+  ln -sf /usr/lib64/firefox-$VERSION/firefox .
 )
-mkdir -p $PKG/usr/lib/mozilla/plugins
+mkdir -p $PKG/usr/lib64/mozilla/plugins
 mkdir -p $PKG/usr/share/applications
-cat $CWD/mozilla-firefox.desktop > $PKG/usr/share/applications/mozilla-firefox.desktop
+cp -p $CWD/mozilla-firefox.desktop $PKG/usr/share/applications/
 mkdir -p $PKG/usr/share/pixmaps
-cat $CWD/firefox.png > $PKG/usr/share/pixmaps/firefox.png
-
-# These files/directories are usually created if Firefox 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/firefox-$VERSION
-  if [ -d extensions/talkback\@mozilla.org ]; then
-    if [ ! -r extensions/talkback\@mozilla.org/chrome.manifest ]; then
-      echo > extensions/talkback\@mozilla.org/chrome.manifest
-    fi
-  fi
-  if [ ! -d updates ]; then
-    mkdir -p updates/0
-  fi
-)
-
+cp -p $CWD/firefox.png $PKG/usr/share/pixmaps/
+chmod 644 $PKG/usr/share/pixmaps/firefox.png
+mkdir -p $PKG/usr/lib64/firefox-$VERSION/updates/0/
 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-firefox-$VERSION-$ARCH-$BUILD.tgz
 
