2013-11-18 22:20:41 +01:00
|
|
|
#!/bin/sh -x
|
|
|
|
|
|
|
|
KEEP_TAR=${KEEP_TAR:-"NO"}
|
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
TAG=cyco
|
|
|
|
OUTPUT=/tmp
|
|
|
|
TMP=${TMP:-/tmp}
|
|
|
|
PKG=$TMP/pkg-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! :-)
|
|
|
|
|
|
|
|
ARCH=${ARCH:-$(uname -m)}
|
|
|
|
BUILD=1
|
|
|
|
|
|
|
|
BRANCH=${BRANCH:=latest-mozilla-central}
|
2015-04-01 12:23:08 +02:00
|
|
|
TIMESTAMP=$(date +%F | tr - .)
|
2013-11-18 22:20:41 +01:00
|
|
|
|
2014-02-16 11:48:15 +01:00
|
|
|
if [ $KEEP_TAR == "YES" ]; then
|
2013-11-18 22:20:41 +01:00
|
|
|
[ -e firefox-*.en-US.linux-x86_64.tar.bz2 ] && for f in firefox-*.en-US.linux-x86_64.tar.bz2 ; do mv $f $f.orig ; done
|
2014-02-16 11:48:15 +01:00
|
|
|
else
|
|
|
|
[ -e firefox-*.en-US.linux-x86_64.tar.bz2 ] && rm firefox-*.en-US.linux-x86_64.tar.bz2
|
2013-11-18 22:20:41 +01:00
|
|
|
fi
|
2014-02-16 11:48:15 +01:00
|
|
|
WHICH_TAR=$(lftp http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/$BRANCH/ -e "cls --date *.en-US.linux-x86_64.tar.bz2 ; quit" | awk '{print $4}' | sort | tail -n1)
|
2015-04-01 12:34:38 +02:00
|
|
|
wget -c http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/$BRANCH/$WHICH_TAR || exit -1
|
2013-11-18 22:20:41 +01:00
|
|
|
|
|
|
|
VERSION=$(ls -ut firefox-*.tar.bz2 | head -n1 | cut -d - -f 2 | sed 's|.en||')
|
|
|
|
|
|
|
|
LIBSUFFIX=$(echo "$ARCH" | grep -o "64")
|
|
|
|
|
2014-02-16 11:48:15 +01:00
|
|
|
mkdir -p $TMP
|
|
|
|
|
2013-11-18 22:20:41 +01:00
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $PKG/usr/lib$LIBSUFFIX
|
|
|
|
( cd $PKG/usr/lib$LIBSUFFIX
|
|
|
|
tar xf $CWD/firefox-$VERSION.en-US.linux-$ARCH.tar.bz2 || exit 1
|
|
|
|
mv firefox firefox-$VERSION
|
|
|
|
ln -sf firefox-$VERSION firefox
|
|
|
|
cd firefox-$VERSION
|
|
|
|
sed -i -e "s/usr\/local/usr/" firefox
|
|
|
|
rm -f defaults/pref/firefox.js.orig
|
2014-03-21 16:24:10 +01:00
|
|
|
ln -s ../mozilla/plugins
|
2013-11-18 22:20:41 +01:00
|
|
|
) || exit 1
|
2015-04-01 12:35:07 +02:00
|
|
|
if [ ! "/usr/lib$LIBSUFFIX" == "/usr/lib" ]; then
|
|
|
|
mkdir -p $PKG/usr/lib
|
|
|
|
( cd $PKG/usr/lib
|
|
|
|
ln -s ../lib$LIBSUFFIX/mozilla mozilla
|
|
|
|
)
|
|
|
|
fi
|
|
|
|
|
2013-11-18 22:20:41 +01:00
|
|
|
mkdir -p $PKG/usr/bin
|
|
|
|
( cd $PKG/usr/bin
|
|
|
|
ln -sf /usr/lib$LIBSUFFIX/firefox-$VERSION/firefox .
|
|
|
|
)
|
|
|
|
mkdir -p $PKG/usr/lib$LIBSUFFIX/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$LIBSUFFIX/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 <<EOF $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
# HOW TO EDIT THIS FILE:
|
|
|
|
# The "handy ruler" below makes it easier to edit a package description. Line
|
|
|
|
# up the first '|' above the ':' following the base package name, and the '|' on
|
|
|
|
# the right side marks the last column you can put a character in. You must make
|
|
|
|
# exactly 11 lines for the formatting to be correct. It's also customary to
|
|
|
|
# leave one space after the ':'.
|
|
|
|
|
2014-03-21 16:24:10 +01:00
|
|
|
|-----handy-ruler------------------------------------------------------|
|
2013-11-18 22:20:41 +01:00
|
|
|
mozilla-firefox: mozilla-firefox (Mozilla Firefox Web browser)
|
|
|
|
mozilla-firefox:
|
|
|
|
mozilla-firefox: This project is a redesign of the Mozilla browser component written
|
|
|
|
mozilla-firefox: using the XUL user interface language. Firefox empowers you to
|
|
|
|
mozilla-firefox: browse faster, more safely and more efficiently than with any other
|
|
|
|
mozilla-firefox: browser.
|
|
|
|
mozilla-firefox:
|
|
|
|
mozilla-firefox: Visit the Mozilla Firefox project online:
|
|
|
|
mozilla-firefox: http://www.mozilla.org/projects/firefox/
|
|
|
|
mozilla-firefox:
|
|
|
|
mozilla-firefox:
|
|
|
|
EOF
|
|
|
|
|
2015-04-01 12:23:08 +02:00
|
|
|
#VERSION=$(echo $BRANCH | sed 's|latest-mozilla-||g')_${VERSION}
|
2013-11-18 22:20:41 +01:00
|
|
|
|
|
|
|
cd $PKG
|
2015-04-01 12:23:08 +02:00
|
|
|
makepkg -l y -c n $OUTPUT/mozilla-firefox-${VERSION}_$TIMESTAMP-$ARCH-$BUILD$TAG.txz
|