Subversion Repositories general

Rev

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