#!/bin/sh # Copyright 2008, 2009, 2010, 2011 Patrick J. Volkerding, Sebeka, Minnesota, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # This is not a source build script. Rather, it builds a Slackware # package from the official binary tarball available from mozilla.org. # Thanks to the folks at the Mozilla Foundation for permission to # distribute this, and for all the great work! :-) CWD=`pwd` TMP=${TMP:-/tmp} PKG=$TMP/package-mozilla-firefox VERSION=$(ls firefox-*.tar.bz2 | cut -d - -f 2 | rev | cut -f 3- -d . | rev) ARCH=${ARCH:-i686} BUILD=1 if [ ! -d $TMP ]; then mkdir -p $TMP fi rm -rf $PKG mkdir -p $PKG/usr/lib ( cd $PKG/usr/lib tar xf $CWD/firefox-$VERSION.tar.bz2 || exit 1 mv firefox firefox-$VERSION ln -sf firefox-$VERSION firefox cd firefox-$VERSION sed -i -e "s/usr\/local/usr/" firefox #zcat $CWD/mozilla-firefox-mimeTypes-fix.diff.gz | patch -p1 --verbose --suffix=.orig || exit 1 zcat $CWD/firefox.moz_plugin_path.diff.gz | patch -p1 --verbose --suffix=.orig || exit 1 rm -f defaults/pref/firefox.js.orig cd $PKG/usr/lib/firefox-$VERSION # There's really no reason to save this .orig: #mv defaults/profile/mimeTypes.rdf defaults/profile/mimeTypes.rdf.orig || exit 1 zcat $CWD/mimeTypes.rdf > defaults/profile/mimeTypes.rdf || exit 1 ) || exit 1 mkdir -p $PKG/usr/bin ( cd $PKG/usr/bin ln -sf /usr/lib/firefox-$VERSION/firefox . ) mkdir -p $PKG/usr/lib/mozilla/plugins mkdir -p $PKG/usr/share/applications cat $CWD/mozilla-firefox.desktop > $PKG/usr/share/applications/mozilla-firefox.desktop 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 ) mkdir $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG makepkg -l y -c n $TMP/mozilla-firefox-$VERSION-$ARCH-$BUILD.txz