#!/bin/bash ########################################################## #VBuild - Package build script for use on VectorLinux 5.8# ########################################################## #Eugene Suter # #You are free to modify this scrip under the terms of the# #GNU General Public License. # ########################################################## TMP=/tmp CWD=`pwd` NAME=xulrunner VERSION=1.8.0.4 ARCH=i586 RELEASE=4vl58 SYSCONF=/etc PREFIX=/usr BUILD_DIR=${TMP}/${NAME}-package REBUILD_DIR=${BUILD_DIR}/rebuild TARBALL_NAME=${NAME}-${VERSION}.tar.* #Chose between tgz, tlz org tbz package formats here. PKG_FORMAT=.tlz PKG_DEST=${TMP}/finished-packages PKG_NAME=${NAME}-${VERSION}-${ARCH}-${RELEASE}${PKG_FORMAT} CLEANUP=Y VL_PACKAGER=easuter #Check if user has super user privilages: if [ ${UID} != 0 ]; then echoc "You need to be root to run this script." red exit fi #Make sure Stabelini's requiredbuilder is installed #in order to build a dependency list: if [ ! -x /usr/bin/requiredbuilder ]; then echoc "Requiredbuilder is not installed!" red echoc "XULRunner will not be built, sorry." exit fi #Make sure the packages have their own directory: if [ ! -d ${PKG_DEST} ]; then mkdir -p ${PKG_DEST} fi #Clean out the build space first and then make the #necessary directories, extract the sources and enter the #package source tree: rm -rf ${BUILD_DIR} mkdir -p ${BUILD_DIR} mkdir -p ${REBUILD_DIR} cd ${BUILD_DIR} cp ${CWD}/${TARBALL_NAME} ./ tar xvf ${BUILD_DIR}/${TARBALL_NAME} cd ${NAME}-${VERSION} if [ $ARCH = "i586" ]; then export CFLAGS="-O2 -mtune=i686 -march=i586" fi if [ $ARCH = "i486" ]; then export CFLAGS="-O2 -mtune=i686 -march=i486" fi if [ $ARCH = "i386" ]; then export CFLAGS="-O2 -mtune=i686 -march=i386" fi export CXXFLAGS="$CFLAGS" #Give root ownership of the files: chown -R root.root ./ #Here goes one of the longest configures in history: ./configure --prefix=${PREFIX} \ --sysconfdir=${SYSCONF} \ --mandir=${PREFIX}/man \ --with-included-gettext \ --enable-static=no \ --enable-application=xulrunner \ --enable-svg \ --enable-svg-renderer=cairo \ --enable-canvas \ --enable-default-toolkit=gtk2 \ --enable-system=cairo \ --enable-xft \ --enable-extensions=default,cookie,permissions \ --enable-strip \ --enable-xprint \ --enable-crypto \ --disable-short-wchar \ --disable-debug \ --disable-installer \ --disable-tests \ --disable-pendantic \ --disable-mailnews \ --disable-short-wchar \ --enable-optimize=-O2 \ --with-system-zlib \ --with-system-jpeg \ --with-system-png \ --with-system-mng \ --with-system-bz2 \ --enable-nspr-autoconf \ --without-system-nspr \ --with-x \ --x-includes=${PREFIX}/X11R6/include \ --x-libraries=${PREFIX}/X11R6/lib \ --disable-javaxpcom cp ${CWD}/slack-desc ./ #Write build information to the end of "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 #Build the sources and exit if it fails. make if ( ! make ); then echoc "Make failed!" red exit fi #XULRunner doesn't play nicely with checkinstall, so it has to be #packaged the "trditional" way: make DESTDIR=${REBUILD_DIR} install mkdir ${REBUILD_DIR}/install cp ./slack-desc ${REBUILD_DIR}/install cd ${REBUILD_DIR} #Build a dependency list: requiredbuilder -v -y ./ #Add an extra line that makes XULRunner register during the #installation: cat >> install/doinst.sh << EOF xulrunner --register-global EOF #Make the package: makepkg -l y -p -c n xulrunner-1.8.0.4-i586-4vl58.tlz cp ${PKG_NAME} ${PKG_DEST} #Do some spring-cleaning (or not): if [ $CLEANUP = "Y" ]; then rm -rf $BUILD_DIR fi #EOF