#!/bin/bash -e #--------------------------------------------------------------------- # Important: Don't use an editor, or other program, that trims white # space on this text file. It contains embedded patches that include # trailing white space. #--------------------------------------------------------------------- # This is a Laclin-only script that creates a source tarball for four # XUL-compatible Mozilla programs: # AlbusLuna - Revived Classic Firefox # Ambassador - Revived Chatzilla # Basilisk - A newer-style UXP-based browser # Epyrus - A Classic Thunderbird fork (*) #--------------------------------------------------------------------- SPCDIR=`echo /src/0*/*_uxp-browsers/special` SPCEXT=$SPCDIR/extensions/install #--------------------------------------------------------------------- SPC_ALBUSLUNA=$SPCDIR/spc-albusluna SPC_AMBASSADOR=$SPCDIR/spc-ambassador SPC_BASILISK=$SPCDIR/spc-basilisk SPC_EPYRUS=$SPCDIR/spc-epyrus SPC_ICEDOVE=$SPCDIR/spc-icedove SPC_UXP=$SPCDIR/spc-uxp #--------------------------------------------------------------------- echo Checking for some required files: ls -l $SPCDIR/buildme.sh || exit 1 ls -l $SPCDIR/uxp-browsers.txt || exit 1 BASEDIR=uxp-browsers || exit 1 TARFILE=$BASEDIR.tar.bz2 || exit 1 ABOVE=`pwd` || exit 1 TOPDIR=$ABOVE/$BASEDIR || exit 1 rm -fr $BASEDIR $TARFILE $TOPDIR || exit 1 mkdir $BASEDIR || exit 1 #--------------------------------------------------------------------- cd $TOPDIR || exit 1 #--------------------------------------------------------------------- cp -a $SPCEXT xpi || exit 1 pushd xpi || exit 1 for dir in `ff -had | sort` do pushd $dir || exit 1 for x in `deext *.xpi` do UUID=`cat $x.uuid` || exit 1 rm $x.uuid || exit 1 # Note: The {} shouldn't be used for "normal" extension-file names. NN=`echo $UUID | grep -e '-.*-.*-.*-' | wc -l` if [ "@$NN" \!= "@0" ]; then mv $x.xpi "{$UUID}.xpi" || exit 1 else mv $x.xpi "$UUID.xpi" || exit 1 fi done popd || exit 1 done rm -fr *.notused || exit 1 popd || exit 1 #--------------------------------------------------------------------- cd $TOPDIR || exit 1 rm -fr palemoon-source albusluna || exit 1 tar zxf $SPC_ALBUSLUNA/upstream-albusluna.tar.gz || exit 1 tar zxf $SPC_EPYRUS/upstream-epyrus.tar.gz || exit 1 mv palemoon-source albusluna || exit 1 cd albusluna || exit 1 sed -e 's@^Vendor=.*@Vendor=laclin@' \ -e 's@^Name=.*@Name=albusluna@' \ -e 's@^RemotingName=.*@RemotingName=albusluna@' \ -i palemoon/app/application.ini || exit 1 # In the past: # cp -p $SPC_ALBUSLUNA/albusluna-appname.bmp \ # palemoon/branding/official/appname.bmp || exit 1 pushd palemoon/branding/ || exit 1 tar zxvf $SPC_ALBUSLUNA/albusluna-more-brand*.tgz || exit 1 tar zxvf $SPC_ALBUSLUNA/albusluna-wordmark.tgz || exit 1 IMG=$SPC_ALBUSLUNA/albusluna-bgabout.jpg if [ -f $IMG ]; then for x in `find . -type f -name about-background.jpg` do cp -p $IMG $x || exit 1 done fi pwd ls -l official/ popd || exit 1 cp -p $SPC_ALBUSLUNA/albusluna-aboutDialog.xul \ palemoon/base/content/aboutDialog.xul || exit 1 cp -p $SPC_ALBUSLUNA/albusluna-baseMenuOverlay.xul \ palemoon/base/content/baseMenuOverlay.xul || exit 1 cp -p $SPC_ALBUSLUNA/albusluna-bookmarks.html \ palemoon/locales/generic/profile/bookmarks.html.in \ || exit 1 mkdir -p ../rest/mozilla || exit 1 #ifdef NOTDEF # rm -fr platform || exit 1 # ln -s ../rest/mozilla platform || exit 1 #endif #--------------------------------------------------------------------- cd $TOPDIR || exit 1 rm -fr ambassador || exit 1 tar zxf $SPC_AMBASSADOR/upstream-ambassador.tar.gz || exit 1 cd ambassador || exit 1 sed -e 's@^Vendor=.*@Vendor=laclin@' \ -e 's@^Name=.*@Name=ambassador@' \ -e 's@^RemotingName=.*@RemotingName=ambassador@' \ -i ambassador/app/application.ini || exit 1 rm -fr platform || exit 1 ln -s ../rest/mozilla platform || exit 1 #--------------------------------------------------------------------- cd $TOPDIR || exit 1 rm -fr basilisk || exit 1 tar zxf $SPC_BASILISK/upstream-basilisk.tar.gz || exit 1 cd basilisk || exit 1 rm -fr platform || exit 1 sed -e 's@^Vendor=.*@Vendor=laclin@' \ -e 's@^Name=.*@Name=basilisk@' \ -e 's@^RemotingName=.*@RemotingName=basilisk@' \ -i basilisk/app/application.ini || exit 1 #--------------------------------------------------------------------- cd $TOPDIR || exit 1 rm -fr rest icedove* || exit 1 tar zxf $SPC_ICEDOVE/upstream-icedove.tar.gz || exit 1 mv icedove rest || exit 1 cd rest || exit 1 sed -e 's@^Vendor=.*@Vendor=laclin@' \ -e 's@^Name=.*@Name=icedove@' \ -e 's@^RemotingName=.*@RemotingName=icedove@' \ -i mail/app/application.ini || exit 1 rm -fr mozilla suite uxp UXP || exit 1 ln -nsf ../albusluna/platform mozilla || exit 1 #--------------------------------------------------------------------- cd $TOPDIR/ || exit 1 chmod 755 `find . -type f -name mach` treetextsub --keeptimes \ --pattern=binaryoutcast.com \ --newtext=binarymoocast.cow || true treetextsub --keeptimes \ --pattern=binaryoutcast.org \ --newtext=binarycowcast.moo || true treetextsub --keeptimes \ --pattern=palemoon.org \ --newtext=alespoon.xyz || true treetextsub \ --pattern=http://start.alespoon.xyz/ \ --newtext=chrome://albushome/content/index.html \ --keeptimes || true treetextsub \ --pattern=https://www.alespoon.xyz/firstrun.shtml \ --newtext=chrome://albushome/content/firstrun.html \ --keeptimes || true treetextsub \ --pattern=http://www.alespoon.xyz/releasenotes.shtml \ --newtext=chrome://albushome/content/release.html \ --keeptimes || true treetextsub \ --pattern=https://www.alespoon.xyz/releasenotes.shtml \ --newtext=chrome://albushome/content/release.html \ --keeptimes || true #--------------------------------------------------------------------- cd $TOPDIR/albusluna/platform/ || exit 1 echo apply platform patches to AlbusLuna UXP patch -p0 < $SPCDIR/misc/platform01.patch || exit 1 #--------------------------------------------------------------------- echo Misc. cd $TOPDIR || exit 1 cp -p $SPCDIR/buildme.sh . || exit 1 cp -p $SPCDIR/uxp-browsers.txt . || exit 1 cp -p $SPCDIR/CHANGES . || exit 1 chmod 755 buildme.sh || exit 1 cat > 00README << END || exit 1 See "uxp-browsers.txt". END cp -p 00README readme.txt || exit 1 #--------------------------------------------------------------------- cd $TOPDIR/albusluna || exit 1 cp -p $SPC_ALBUSLUNA/albusluna-icon.png \ albusluna.png || exit 1 perl $SPC_ALBUSLUNA/setup-branding-albusluna.pl || exit 1 #--------------------------------------------------------------------- cd $TOPDIR || exit 1 for x in \ albusluna/albusluna/app/profile/albusluna.js \ basilisk/basilisk/app/profile/basilisk.js do ls $x || exit 1 echo >> $x || exit 1 cat $SPCDIR/misc/user-add.js >> $x || exit 1 done #--------------------------------------------------------------------- # Set up "RemotingName" for browsers. # This code allows UXP browsers to run concurrently. Note: This code # may not be needed as these cases should have been taken care of fur- # ther up. sed -e 's/^RemotingName=.*/RemotingName=albusluna/' \ -i albusluna/albusluna/app/application.ini sed -e 's/^RemotingName=.*/RemotingName=ambassador/' \ -i ambassador/ambassador/app/application.ini #--------------------------------------------------------------------- # Set up "RemotingName" for email programs. # This code prevents UXP email programs from running concurrently. # Note: This code may not be needed as these cases should have been # taken care of further up. sed -e 's/^RemotingName=.*/RemotingName=thundergroup/' \ -i epyrus/mail/app/application.ini sed -e 's/^RemotingName=.*/RemotingName=thundergroup/' \ -i rest/mail/app/application.ini #--------------------------------------------------------------------- # Alternate "RemotingName" mode. # If you'd like to allow Thunderbird UXP forks to run concurrently, # enable this block. Warning: If you set up different Thunderbirds # to share email profiles, this may lead to data corruption. if [ 0 == 1 ]; then NN=0 for x in `find . -type f -name application.ini | grep /mail/app/` do NN=`expr $NN + 1` sed -e "s/^RemotingName=.*/RemotingName=laclin$NN/" \ -i $x || exit 1 done fi #--------------------------------------------------------------------- # Additional fixes and/or patches. cd $TOPDIR || exit 1 chmod 755 \ `find . -type f -name config.guess` \ `find . -type f -name mach` || exit 1 treetextsub \ --pattern='pref("extensions.autoDisableScopes", 15);' \ --newtext='pref("extensions.autoDisableScopes", 0);' \ --keeptimes sed -e 's/^Vendor=.*/Vendor=laclin/' \ -i `find . -type f -name application.ini` || exit 1 sed -e 's/"Binary Outcast"/"Laclin"/' \ -i `find . -type f -name brand.dtd` || exit 1 FN=RemoteSpellCheckEngineChild.h sed -e "s@illa/$FN@illa/mozSpellChecker.h@" \ -i `find . -type f -name ContentChild.cpp` || exit 1 sed -e '/#include."mozilla\/Telemetry.h"/d' \ -e '/XRE_TelemetryAccumulate/d' \ -e '/XRE_StartupTimelineRecord/d' \ -i `find . -type f -name nsMailApp.cpp` \ `find . -type f -name nsSuiteApp.cpp` || exit 1 sed -e '/chrome\/recording/d' \ -e '/components\/telemetry\.xpt/d' \ -e '/nssdbm3/d' \ -i `find . -type f -name package-manifest.in` || exit 1 #--------------------------------------------------------------------- # Wrap it up. cd $TOPDIR || exit 1 rm -fr */.git* || exit 1 settreedate . || exit 1 cd .. || exit 1 tar jcf $TARFILE $BASEDIR || exit 1 tardate $TARFILE || exit 1 rm -fr $BASEDIR || exit 1 ls -l $ABOVE/$TARFILE || exit 1 #--------------------------------------------------------------------- # End of file.