Rev 1331 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1330 | dev | 1 | #!/bin/sh |
2 | |||
3 | # define dirs |
||
4 | build_dir="$project_dir/build" |
||
5 | |||
6 | if [ ! -d "$build_dir" ] ; then |
||
7 | echo "Build dir '$build_dir' not found" >> /dev/stderr |
||
8 | exit 1 |
||
9 | fi |
||
10 | |||
11 | # read meta data |
||
12 | [ -f "$common_dir/meta.xml" ] && $(xsltproc "$common_dir/meta.xsl" "$common_dir/meta.xml") |
||
13 | [ -f "$common_dir/meta_local.xml" ] && $(xsltproc "$common_dir/meta.xsl" "$common_dir/meta_local.xml") |
||
14 | [ -f "$project_dir/meta.xml" ] && $(xsltproc "$common_dir/meta.xsl" "$project_dir/meta.xml") |
||
15 | [ -f "$project_dir/meta_local.xml" ] && $(xsltproc "$common_dir/meta.xsl" "$project_dir/meta_local.xml") |
||
16 | $(xsltproc "$common_dir/id.xsl" "$project_dir/src/install.rdf") |
||
17 | |||
18 | if [ -z "$META_xpiName" ] ; then |
||
19 | echo "xpiName not defined in meta.xml" >> /dev/stderr |
||
20 | exit 2 |
||
21 | fi |
||
22 | if [ -z "$META_webDir" ] ; then |
||
23 | echo "webDir not defined in meta.xml" >> /dev/stderr |
||
24 | exit 2 |
||
25 | fi |
||
26 | if [ -z "$META_keyDir" ] ; then |
||
27 | echo "keyDir not defined in meta.xml" >> /dev/stderr |
||
28 | exit 2 |
||
29 | fi |
||
30 | if [ -z "$META_spockExec" ] ; then |
||
31 | echo "spock not defined in meta.xml" >> /dev/stderr |
||
32 | exit 2 |
||
33 | fi |
||
34 | if [ -z "$META_id" ] ; then |
||
35 | echo "id of the exception is unknown" >> /dev/stderr |
||
36 | exit 2 |
||
37 | fi |
||
38 | |||
39 | # convert paths to abs |
||
40 | [ -z "${META_keyDir%%/*}" ] || META_keyDir="$project_dir/$META_keyDir" |
||
41 | [ -z "${META_spockExec%%/*}" ] || META_spockExec="$project_dir/$META_spockExec" |
||
42 | |||
43 | # cleanup |
||
44 | rm -f "$build_dir"/* |
||
45 | |||
46 | (cd "$project_dir/src"; find . -not -path '*/.svn*' | zip -q -@ "$build_dir/$META_xpiName" ) |
||
47 | |||
48 | xsltproc --stringparam dir "$project_dir" "$common_dir/update.xsl" "$project_dir/src/install.rdf" \ |
||
49 | > "$build_dir/update.rdf_unsigned" |
||
50 | |||
51 | "$META_spockExec" "$build_dir/update.rdf_unsigned" -i "urn:mozilla:extension:$META_id" \ |
||
52 | -d "$META_keyDir" -f "$build_dir/$META_xpiName" \ |
||
53 | > "$build_dir/update.rdf" \ |
||
54 | && rm "$build_dir/update.rdf_unsigned" |
||
55 | |||
56 | case "$META_deployMethod" in |
||
57 | scp) |
||
58 | echo scp "$build_dir/*" "$META_webDir" |
||
59 | ;; |
||
60 | \*) |
||
61 | [ -z "${META_webDir%%/*}" ] || META_webDir="$project_dir/$META_webDir" |
||
62 | echo cp "$build_dir/*" "$META_webDir" |
||
63 | ;; |
||
64 | esac |
||
65 |