#!/usr/bin/bash # This SlackBuild like script is designed for Vector Linux packages by exeterdad. # This script assumes it will be launched within "/NAME/VERSION/src" dir. With all sources in "src" # Your Vector Linux .tlz package, slack-desc, and slack-required will be found in "VERSION" dir. # The extraction and build will be in a temp dir created in "NAME" dir, and then removed on exit. # Comment out last line to keep this dir intact. # This is not a source build. It's a repack of the official Mozilla build. NAME="thunderbird-lightning" # Don't change this, everything will go wrong. VERSION=0.7 # Lightning version number with decimals. THUNDERBIRDVERSION=2.0.0.9 # Set Thunderbird version you need as dependancy. BUILD=1vl58 # Build/vl/58..59..60 etc. VL_PACKAGER=exeterdad # Fill in your name so we will know who made the package. #<----------------------------- Shouldn't need editing past this point --------------------------------> # Architechture and appropriate configure triplet: [ -z "$ARCH" ] && ARCH=$(uname -m) case "$ARCH" in (i?86) ARCH=i586 CFLAGS="-O2 -march=i586 -mtune=i686" CONFIGURE_TRIPLET=i486-slackware-linux ;; (x86_64) CFLAGS="-O2 -fPIC" CONFIGURE_TRIPLET=x86_64-pc-linux ;; esac # CFLAGS: export CFLAGS export CXXFLAGS=$CFLAGS distro=`echo $BUILD | cut -d l -f 2` if [ ${distro} = "58" ]; then distro=5.8 fi if [ ${distro} = "59" ]; then distro=5.9 fi if [ ${distro} = "60" ]; then distro=6.0 fi CWD=`pwd` cd ../ RELEASEDIR=`pwd` cd $CWD mkdir $RELEASEDIR/tmp TMP=$RELEASEDIR/tmp PKG=$TMP/package-$NAME 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 rm -rf $PKG mkdir -p $PKG echo "Here we go!" if [ ! -e $CWD/lightning-${VERSION}.linux-i686.xpi ]; then SOURCE="releases.mozilla.org/pub/mozilla.org/calendar/lightning/releases/${VERSION}" wget ftp://$SOURCE/lightning-${VERSION}.linux-i686.xpi fi mkdir -p $PKG/usr/lib/thunderbird/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103} cd $PKG/usr/lib/thunderbird/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103} echo "Extracting files to package directory..." unzip $CWD/lightning-${VERSION}.linux-i686.xpi || exit 1 echo "Setting permissions..." chown -R root:root . mkdir -p $PKG/install # This creates the white space in front of "handy-ruler" in slack-desc below. LENGTH=`expr length "$NAME"` SPACES=0 SHIM="" until [ "$SPACES" = "$LENGTH" ]; do SHIM="$SHIM " let SPACES=$SPACES+1 done cat > $RELEASEDIR/slack-desc << EOF # 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 ':'. $SHIM|-----handy-ruler------------------------------------------------------| $NAME: $NAME (Calendar extension for Mozilla Thunderbird) $NAME: $NAME: Lightning brings the Sunbird calendar to the popular email client, $NAME: Mozilla Thunderbird. Since it's an extension, Lightning is tightly $NAME: Thunderbird, allowing it to easily perform email-related calendaring $NAME: tasks. $NAME: $NAME: $NAME: License: MPL 1.1/GPL 2.0/LGPL 2.1 $NAME: Author: Mozilla Foundation $NAME: Website: http://www.mozilla.org/projects/calender/lightning/ #---------------------------------------- BUILDDATE: `date` PACKAGER: $VL_PACKAGER HOST: `uname -srm` DISTRO: `cat /etc/vector-version` CFLAGS: $CFLAGS CONFIGURE: N/A EOF cat $RELEASEDIR/slack-desc > $PKG/install/slack-desc cd $PKG echo " " echo "Stripping...." echo " " 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 echo "Finding dependancies..." cat > $PKG/install/slack-required << EOF thunderbird >= ${THUNDERBIRDVERSION} EOF echo "Creating package $NAME-$VERSION-$ARCH-$BUILD.tlz" makepkg -l y -c n $RELEASEDIR/$NAME-$VERSION-$ARCH-$BUILD.tlz #rm -rf $TMP echo "Done"