#!/bin/bash ##SlackBuild style build script CWD=`pwd` NAME=firefox VERSION=2.0.0.6 ARCH=i586 BUILD=6vl58 VL_PACKAGER=easuter if [ "$TMP" = "" ]; then TMP=/tmp fi if [ $UID != 0 ]; then echo "You need to be root to run this script." exit fi if [ ! -x /usr/bin/requiredbuilder ]; then echo "Requiredbuilder not installed, or not executable." exit fi if [ ! -d $TMP/finished-packages ]; then mkdir -p $TMP/finished-packages fi PKG=$TMP/package-$NAME rm -rf $PKG rm -rf $TMP/mozilla mkdir -p $PKG/usr mkdir $PKG/install if [ "$ARCH" = "i386" ]; then export CFLAGS="-O2 -march=i386 -mcpu=i686" elif [ "$ARCH" = "i486" ]; then export CFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "i586" ]; then export CFLAGS="-O2 -march=i586 -mtune=i686" elif [ "$ARCH" = "s390" ]; then export CFLAGS="-O2" elif [ "$ARCH" = "x86_64" ]; then export CFLAGS="-O2" fi CXXFLAGS="$CFLAGS" cd $TMP rm -rf $NAME-$VERSION tar xvf $CWD/$NAME-$VERSION-source.tar.bz2 cd mozilla chown -R root:root . ./configure --prefix=/usr \ --sysconfdir=/etc \ --with-included-gettext \ --with-x \ --with-pthreads \ --with-system-jpeg \ --with-system-zlib \ --with-system-png \ --enable-default-toolkit=gtk2 \ --enable-application=browser \ --enable-official-branding \ --enable-xft \ --enable-svg \ --with-java-include-path=/usr/include \ --with-java-bin-path=/usr/bin \ --enable-ldap \ --enable-crypto \ --disable-activex \ --disable-activex-scripting \ --enable-pango \ --enable-strip \ --enable-strip-libs \ --disable-tests \ --disable-debug \ --disable-installer make if ( ! make ); then echo "make failed" exit fi cp $CWD/slack-desc . cat >> slack-desc << EOF #---------------------------------------- BUILDDATE: `date` PACKAGER: $VL_PACKAGER HOST: `uname -srm` DISTRO: `cat /etc/vector-version` CFLAGS: $CFLAGS CONFIGURE: `awk "/\.\/configure\ /" config.log` EOF #Create a "lean" set of files for the package, just like the precompiled #distribution provides (kudos to exeterdad for this one): make -C xpinstall/packager STRIP=/bin/true mkdir -p $PKG/usr/bin mkdir -p $PKG/usr/share/applications mkdir $PKG/usr/share/pixmaps mkdir -p $PKG/usr/lib/$NAME-$VERSION mkdir $PKG/install cp -r dist/$NAME/* $PKG/usr/lib/$NAME-$VERSION/ cat $CWD/mozilla-firefox.desktop > \ $PKG/usr/share/applications/mozilla-firefox.desktop cat $CWD/firefox.png > $PKG/usr/share/pixmaps/firefox.png ( cd $PKG/usr/lib ln -sf $NAME-$VERSION $NAME ) echo "ln -sf /usr/lib/$NAME-$VERSION/$NAME /usr/bin/$NAME" > \ $PKG/install/doinst.sh #Add some customizations to firefox (OS identification and a backspace #button tweak cat >> $PKG/usr/lib/$NAME-$VERSION/defaults/pref/vector_custom_all.js << EOF //Customizations for VectorLinux pref("general.useragent.extra.vendorComment", "(VectorLinux package $VERSION-$BUILD)"); EOF sed -i '/backspace_action/s/1/0/g' \ $PKG/usr/lib/$NAME-$VERSION/defaults/pref/firefox.js ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) mkdir -p $PKG/usr/doc/$NAME-$VERSION cp -a \ LEGAL LICENSE README.txt \ $PKG/usr/doc/$NAME-$VERSION cp slack-desc $PKG/install cd $PKG requiredbuilder -v -y . makepkg -p -l y -c n $NAME-$VERSION-$ARCH-$BUILD.tlz cp $NAME-$VERSION-$ARCH-$BUILD.tlz $TMP/finished-packages echo "$NAME-$VERSION package is in $TMP/finished-packages" rm -rf $TMP/mozilla rm -rf $PKG