change name and version(s) for 2.0a1 release; create theme for delivering theme relea...
[themes.git] / maketheme
CommitLineData
738054be
RK
1#!/bin/sh
2
3RUN_DIR=$(pwd)
4cd $(dirname "$0")
5SCRIPT_DIR=$(pwd)
6
7if [ -n "$1" ]; then
8 case "$1" in
9 EarlyBlue)
10 THEME_NAME=$1
11 ;;
12 LCARStrek)
13 THEME_NAME=$1
14 ;;
15 *)
16 echo "unknown theme $option"
17 ;;
18 esac
19else
20 echo "You must specify a theme name."
21fi
22
23# define variables
24THEME_DIR=$SCRIPT_DIR/$THEME_NAME/
25WORK_DIR=$SCRIPT_DIR/$THEME_NAME.tmp/
26XPI_FILE=$SCRIPT_DIR/$THEME_NAME.xpi
27
28echo ensuring a clean work directory...
29if [ -e $WORK_DIR ] ; then
30 rm -rf $WORK_DIR/*
31fi
32mkdir -p $WORK_DIR/chrome
33
34echo copying basic files....
35cp $THEME_DIR/install.rdf $THEME_DIR/icon.png $THEME_DIR/preview.png $WORK_DIR/
36
37echo packing internal jar file...
38cd $THEME_DIR
39SUBDIRS=
40for filename in *; do
41 if [ -d "$filename" ]; then
42 SUBDIRS="$SUBDIRS $filename"
43 fi
44done
45zip -rX0Dq $WORK_DIR/chrome/$THEME_NAME.jar $SUBDIRS
46cd $WORK_DIR
47
48echo adjusting manifest...
49sed -e "s/skin \w* $THEME_NAME /\0jar:chrome\/$THEME_NAME.jar\!\//" $THEME_DIR/chrome.manifest > chrome.manifest
50
51echo creating new xpi file...
52if [ -e $XPI_FILE ] ; then
53 rm $XPI_FILE
54fi
55zip -rX9Dq $XPI_FILE *
56
57echo cleaning work directory...
58rm -rf $WORK_DIR/*