~chrisccoulson/thunderbird-eds-extension/support-xpidl

« back to all changes in this revision

Viewing changes to build.sh

  • Committer: Chris Coulson
  • Date: 2011-10-14 14:30:01 UTC
  • Revision ID: chris.coulson@canonical.com-20111014143001-eqphx1puabsu41z1
Fix up indentation in build.sh

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
 
45
45
if [ -z $1 ]; then
46
46
    . ./config_build.sh
47
 
    else
48
 
        . $1
49
 
        fi
 
47
else
 
48
    . $1
 
49
fi
50
50
 
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."
54
 
                exit;
55
 
                fi
 
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."
 
54
    exit;
 
55
fi
56
56
 
57
57
#uncomment to debug
58
58
#set -x
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
73
 
    done
 
73
done
74
74
 
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
78
78
 
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 \~`"
84
 
        echo $FILES >> files
85
 
          cp --verbose --parents $FILES $TMP_DIR
86
 
          done
 
83
    FILES="`find $DIR \( -path '*CVS*' -o -path '*.svn*' \) -prune -o -type f -print | grep -v \~`"
 
84
    echo $FILES >> files
 
85
    cp --verbose --parents $FILES $TMP_DIR
 
86
done
87
87
 
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
93
 
              fi
94
 
              done
 
91
    if [ -f $ROOT_FILE ]; then
 
92
        echo $ROOT_FILE >> files
 
93
    fi
 
94
done
95
95
 
96
96
$BEFORE_PACK
97
97
 
98
 
              cd $TMP_DIR
99
 
 
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/
105
 
                          #
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
109
 
 
110
 
                                  # (it simply adds jar:chrome/whatever.jar!/ at appropriate positions of chrome.manifest)
111
 
                                  fi
 
98
cd $TMP_DIR
 
99
 
 
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/
 
105
    #
 
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
 
109
 
 
110
# (it simply adds jar:chrome/whatever.jar!/ at appropriate positions of chrome.manifest)
 
111
fi
112
112
 
113
113
# generate the XPI file
114
114
echo "Generating $APP_NAME.xpi..."
119
119
echo "Cleanup..."
120
120
if [ $CLEAN_UP = 0 ]; then
121
121
    # save the jar file
122
 
      mv $TMP_DIR/chrome/$APP_NAME.jar .
123
 
      else
124
 
          rm ./files
125
 
          fi
 
122
    mv $TMP_DIR/chrome/$APP_NAME.jar .
 
123
else
 
124
    rm ./files
 
125
fi
126
126
 
127
127
# remove the working files
128
128
rm -rf $TMP_DIR