#!/bin/sh # # Makefile for bazil # By Jacob Emcken # # !! USE AT OWN RISK, I WILL TAKE NO RESPONSIBILITY !! # # Created 15 Jun 2003 # Updated 26 Jul 2003 Added usage and used variables for name and dirs # Updated 29 Jul 2003 Removed CVS dirs and added new xpi and bz2ball to downloads CVS tree automaticaly # #I took this part with 'the usage' of the script from another place E_BADARGS=65 echo echo "MakeXPI 0.3" echo "by Jacob Emcken, 29 Jul 2003" echo "----------------------------" echo if [ ! -n "$1" ] then echo "Usage: `basename $0` [version]" echo exit $E_BADARGS fi PROJECT_PATH=/mnt/storage1/development/mozilla/bazil # This is where the files for the xpi is relative to the PROJECT_PATH TARGET_PATH=$PROJECT_PATH/filemanager # This is where the xpi package is placed when it is created # This dir must have a xpi dir # and a bz2 dir DESTINATION_PATH=$PROJECT_PATH/downloads # This is the name of the project # and will be used as part of the xpi package filename XPI_NAME=filemanager # Entering project cd $TARGET_PATH # Removes all emacs backupfiles *~ # i.e. contents.rdf edited by emacs will create a contents.rdf~ # I use Emacs for developing all sorts of things... thats why I added this! # Perhapes nano, vi ect. makes similar backupfiles?! echo -n "Removing all Emacs junkfiles... " find -name '*~' | xargs -i rm {} echo "done" # Zips the directory structure into a zip file # Don't try to zip zip-, gif- or jpg files # Compress with max compression # Ommit install.js because it is only for the xpi # Ommit CVS dirs and their contents echo -n "Making jar file... " zip -qrn .zip:.gif:.jpg -9 $XPI_NAME.jar * -x \*CVS* install.js echo "done" # Making xpifile with the install.js echo -n "Making xpi file... " zip -qrn .jar -9 $XPI_NAME-$1.xpi . -i $XPI_NAME.jar install.js mv $XPI_NAME-$1.xpi $DESTINATION_PATH/xpi rm $XPI_NAME.jar echo "done" #Creating bz2balls without CVS dirs and install.js echo -n "Creating bz2balls... " tar -cjf $XPI_NAME-$1.tar.bz2 --exclude=CVS --exclude=install.js * mv $XPI_NAME-$1.tar.bz2 $DESTINATION_PATH/bz2 echo "done" cd $PROJECT_PATH echo echo "Adding new release to CVS... " #cvs -d :pserver:bazil@mozdev.org:/cvs add downloads/xpi/$XPI_NAME-$1.xpi downloads/bz2/$XPI_NAME-$1.tar.bz2 echo