#Packager: George Vlahavas # # Make sure you have created the locale xpi tarball before running this. # The script should be in the mozilla-firefox-l10n source dir. pkgname=mozilla-firefox pkgver=128.1.0esr #_majorver=`echo $pkgver | sed "s/\(.*\)\.\(.*\)esr/\1esr/"` _majorver=`echo $pkgver | sed "s/\(.*\)\.\(.*\)\.\(.*\)esr/\1esr/"` #_majorver=$pkgver pkgrel=1gv source=("http://download-installer.cdn.mozilla.net/pub/firefox/releases/$pkgver/linux-$arch/en-US/firefox-$pkgver.tar.bz2" "firefox-xpi-${_majorver}.tar.xz" "LOCALES_mainpkg" "mozilla-firefox.desktop" "policies.json" "salix.js" "firefox.cfg" ) docs=("readme.txt" "install" "copying" "changelog" "authors" "news" "todo") options=('nosrcpack') doinst() { # update the mime desktop database if [ -x /usr/bin/update-desktop-database ]; then /usr/bin/update-desktop-database -q fi # update the mime database if [ -x /usr/bin/update-mime-database ]; then /usr/bin/update-mime-database usr/share/mime > /dev/null 2>&1 fi # glib schemas if [ -x /usr/bin/glib-compile-schemas ]; then /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas > /dev/null 2>&1 fi } slackdesc=\ ( #|-----handy-ruler------------------------------------------------------| "mozilla-firefox (safe and easy web browser from Mozilla)" "Firefox delivers safe, easy web browsing. A familiar user interface," "enhanced security features including protection from online identity" "theft, and integrated search let you get the most out of the web." ) build() { MOZ_ALLOW_DOWNGRADE=${MOZ_ALLOW_DOWNGRADE:-YES} cd $startdir/src/firefox mkdir -p $startdir/pkg/usr/lib${LIBDIRSUFFIX}/firefox cp -R ./* $startdir/pkg/usr/lib${LIBDIRSUFFIX}/firefox/ mkdir -p $startdir/pkg/usr/bin mkdir -p $startdir/pkg/usr/share/applications cp $startdir/src/mozilla-firefox.desktop $startdir/pkg/usr/share/applications/ mkdir -p $startdir/pkg/usr/share/icons/hicolor/{16x16,32x32,48x48,128x128}/apps cp $startdir/src/firefox/browser/chrome/icons/default/default16.png $startdir/pkg/usr/share/icons/hicolor/16x16/apps/firefox.png cp $startdir/src/firefox/browser/chrome/icons/default/default32.png $startdir/pkg/usr/share/icons/hicolor/32x32/apps/firefox.png cp $startdir/src/firefox/browser/chrome/icons/default/default48.png $startdir/pkg/usr/share/icons/hicolor/48x48/apps/firefox.png cp $startdir/src/firefox/browser/chrome/icons/default/default128.png $startdir/pkg/usr/share/icons/hicolor/128x128/apps/firefox.png # configuration mkdir $startdir/pkg/usr/lib${LIBDIRSUFFIX}/firefox/distribution cp $startdir/src/policies.json $startdir/pkg/usr/lib${LIBDIRSUFFIX}/firefox/distribution/ cp $startdir/src/salix.js $startdir/pkg/usr/lib${LIBDIRSUFFIX}/firefox/defaults/pref/ cp $startdir/src/firefox.cfg $startdir/pkg/usr/lib${LIBDIRSUFFIX}/firefox/ # locales mkdir -p $startdir/pkg/usr/lib${LIBDIRSUFFIX}/firefox/browser/extensions for LOC in `cat $startdir/src/LOCALES_mainpkg`; do cp $startdir/src/firefox-xpi-${_majorver}/$LOC.xpi \ $startdir/pkg/usr/lib${LIBDIRSUFFIX}/firefox/browser/extensions/langpack-${LOC}\@firefox.mozilla.org.xpi done # If MOZ_ALLOW_DOWNGRADE=YES, replace the /usr/bin/firefox symlink with a # shell script that sets the MOZ_ALLOW_DOWNGRADE=1 environment variable so # that a detected browser downgrade does not reset the user profile: if [ "$MOZ_ALLOW_DOWNGRADE" = "YES" ]; then rm -f $startdir/pkg/usr/bin/firefox cat << EOF > $startdir/pkg/usr/bin/firefox #!/bin/sh # # Shell script to start Mozilla Firefox. # # Don't reset the user profile on a detected browser downgrade: export MOZ_ALLOW_DOWNGRADE=1 # Start Firefox: exec /usr/lib${LIBDIRSUFFIX}/firefox/firefox "\$@" EOF chown root:root $startdir/pkg/usr/bin/firefox chmod 755 $startdir/pkg/usr/bin/firefox fi # Fix duplicate binary, https://bugzilla.mozilla.org/show_bug.cgi?id=658850 ( cd $startdir/pkg/usr/lib$LIBDIRSUFFIX/firefox if cmp firefox firefox-bin ; then ln -sf firefox-bin firefox fi ) mkdir -p $startdir/pkg/usr/lib${LIBDIRSUFFIX}/mozilla/plugins ( cd $startdir/pkg/usr/lib${LIBDIRSUFFIX}/firefox/browser ln -s ../../mozilla/plugins plugins ) }