46
46
. ./config_build.sh
51
if [ -z $APP_NAME ]; then
52
echo "You need to create build config file first!"
53
echo "Read comments at the beginning of this script for more info."
51
if [ -z $APP_NAME ]; then
52
echo "You need to create build config file first!"
53
echo "Read comments at the beginning of this script for more info."
57
57
#uncomment to debug
70
70
echo "Generating $JAR_FILE..."
71
71
for CHROME_SUBDIR in $CHROME_PROVIDERS; do
72
72
find $CHROME_SUBDIR \( -path '*CVS*' -o -path '*.svn*' \) -prune -o -type f -print | grep -v \~ >> files
75
zip -0 -r $JAR_FILE -@ < files
75
zip -0 -r $JAR_FILE -@ < files
76
76
# The following statement should be used instead if you don't wish to use the JAR file
77
77
#cp --verbose --parents `cat files` $TMP_DIR/chrome
80
80
echo "Copying various files to $TMP_DIR folder..."
81
81
for DIR in $ROOT_DIRS; do
82
82
mkdir $TMP_DIR/$DIR
83
FILES="`find $DIR \( -path '*CVS*' -o -path '*.svn*' \) -prune -o -type f -print | grep -v \~`"
85
cp --verbose --parents $FILES $TMP_DIR
83
FILES="`find $DIR \( -path '*CVS*' -o -path '*.svn*' \) -prune -o -type f -print | grep -v \~`"
85
cp --verbose --parents $FILES $TMP_DIR
88
88
# Copy other files to the root of future XPI.
89
89
for ROOT_FILE in $ROOT_FILES install.rdf chrome.manifest; do
90
90
cp --verbose $ROOT_FILE $TMP_DIR
91
if [ -f $ROOT_FILE ]; then
92
echo $ROOT_FILE >> files
91
if [ -f $ROOT_FILE ]; then
92
echo $ROOT_FILE >> files
100
if [ -f "chrome.manifest" ]; then
101
echo "Preprocessing chrome.manifest..."
102
# You think this is scary?
103
#s/^(content\s+\S*\s+)(\S*\/)(.*)$/\1jar:chrome\/$APP_NAME\.jar!\/\2\3/
104
#s/^(skin|locale)(\s+\S*\s+\S*\s+)(.*\/)$/\1\2jar:chrome\/$APP_NAME\.jar!\/\3/
106
# Then try this! (Same, but with characters escaped for bash :)
107
sed -i -r s/^\(content\\s+\\S*\\s+\)\(\\S*\\/\)\(.*\)$/\\1jar:chrome\\/$APP_NAME\\.jar!\\/\\2\\3/ chrome.manifest
108
sed -i -r s/^\(skin\|locale\)\(\\s+\\S*\\s+\\S*\\s+\)\(.*\\/\)$/\\1\\2jar:chrome\\/$APP_NAME\\.jar!\\/\\3/ chrome.manifest
110
# (it simply adds jar:chrome/whatever.jar!/ at appropriate positions of chrome.manifest)
100
if [ -f "chrome.manifest" ]; then
101
echo "Preprocessing chrome.manifest..."
102
# You think this is scary?
103
#s/^(content\s+\S*\s+)(\S*\/)(.*)$/\1jar:chrome\/$APP_NAME\.jar!\/\2\3/
104
#s/^(skin|locale)(\s+\S*\s+\S*\s+)(.*\/)$/\1\2jar:chrome\/$APP_NAME\.jar!\/\3/
106
# Then try this! (Same, but with characters escaped for bash :)
107
sed -i -r s/^\(content\\s+\\S*\\s+\)\(\\S*\\/\)\(.*\)$/\\1jar:chrome\\/$APP_NAME\\.jar!\\/\\2\\3/ chrome.manifest
108
sed -i -r s/^\(skin\|locale\)\(\\s+\\S*\\s+\\S*\\s+\)\(.*\\/\)$/\\1\\2jar:chrome\\/$APP_NAME\\.jar!\\/\\3/ chrome.manifest
110
# (it simply adds jar:chrome/whatever.jar!/ at appropriate positions of chrome.manifest)
113
113
# generate the XPI file
114
114
echo "Generating $APP_NAME.xpi..."