make pending visible when enabling is pending
[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."
39d844b6 21 exit 1
738054be
RK
22fi
23
24# define variables
25THEME_DIR=$SCRIPT_DIR/$THEME_NAME/
26WORK_DIR=$SCRIPT_DIR/$THEME_NAME.tmp/
27XPI_FILE=$SCRIPT_DIR/$THEME_NAME.xpi
28
29echo ensuring a clean work directory...
30if [ -e $WORK_DIR ] ; then
31 rm -rf $WORK_DIR/*
32fi
33mkdir -p $WORK_DIR/chrome
34
35echo copying basic files....
36cp $THEME_DIR/install.rdf $THEME_DIR/icon.png $THEME_DIR/preview.png $WORK_DIR/
37
38echo packing internal jar file...
39cd $THEME_DIR
40SUBDIRS=
41for filename in *; do
42 if [ -d "$filename" ]; then
43 SUBDIRS="$SUBDIRS $filename"
44 fi
45done
46zip -rX0Dq $WORK_DIR/chrome/$THEME_NAME.jar $SUBDIRS
47cd $WORK_DIR
48
49echo adjusting manifest...
50sed -e "s/skin \w* $THEME_NAME /\0jar:chrome\/$THEME_NAME.jar\!\//" $THEME_DIR/chrome.manifest > chrome.manifest
51
52echo creating new xpi file...
53if [ -e $XPI_FILE ] ; then
54 rm $XPI_FILE
55fi
56zip -rX9Dq $XPI_FILE *
57
58echo cleaning work directory...
99d068f3 59rm -rf $WORK_DIR