4
# this script is used to create a language-specifi XPI for Enigmail
6
# if you want to debug this script, set DEBUG to something >0
10
echo "Usage: $0 xx-YY version"
11
echo " where: xx-YY is the language and country code representing the"
12
echo " translated language"
13
echo " version is the Enigmail version, e.g. 0.84.1"
23
LANGDIR=${ENIGLANG}/chrome/locale/${ENIGLANG}/enigmail
24
HELPDIR=${LANGDIR}/help
26
rm -rf ${LANGDIR} >/dev/null 2>&1
30
LANGHASH=`echo "${ENIGLANG}" | md5sum | awk '{ print substr($0,1,2)}'`
34
cat > ${ENIGLANG}/install.js <<EOT
35
// Install script for Enigmail ${ENIGLANG} language pack
38
const APP_VERSION="${ENIGVERSION}";
40
err = initInstall("Enigmail ${ENIGLANG} Language pack", // name for install UI
41
"/enigmail-${ENIGLANG}", // registered name
42
APP_VERSION+".0"); // package version
44
logComment("initInstall: " + err);
46
var srDest = 15; // Disk space required for installation (KB)
48
var fProgram = getFolder("Program");
49
logComment("fProgram: " + fProgram);
51
if (!verifyDiskSpace(fProgram, srDest)) {
52
cancelInstall(INSUFFICIENT_DISK_SPACE);
56
var fChrome = getFolder("Chrome");
58
// addDirectory: blank, archive_dir, install_dir, install_subdir
59
addDirectory("", "chrome", fChrome, "");
62
if (err == ACCESS_DENIED) {
63
alert("Unable to write to components directory "+fChrome+".\n You will need to restart the browser with administrator/root privileges to install this software. After installing as root (or administrator), you will need to restart the browser one more time, as a privileged user, to register the installed software.\n After the second restart, you can go back to running the browser without privileges!");
65
cancelInstall(ACCESS_DENIED);
67
} else if (err != SUCCESS) {
73
registerChrome( LOCALE | DELAYED_CHROME, getFolder("Chrome","enigmail-${ENIGLANG}.jar"), "locale/${ENIGLANG}/enigmail/");
86
// this function verifies disk space in kilobytes
87
function verifyDiskSpace(dirPath, spaceRequired) {
90
// Get the available disk space on the given path
91
spaceAvailable = fileGetDiskSpaceAvailable(dirPath);
93
// Convert the available disk space into kilobytes
94
spaceAvailable = parseInt(spaceAvailable / 1024);
96
// do the verification
97
if(spaceAvailable < spaceRequired) {
98
logComment("Insufficient disk space: " + dirPath);
99
logComment(" required : " + spaceRequired + " K");
100
logComment(" available: " + spaceAvailable + " K");
108
cat > ${ENIGLANG}/chrome.manifest <<EOT
109
locale enigmail ${ENIGLANG} jar:chrome/enigmail-${ENIGLANG}.jar!/locale/${ENIGLANG}/enigmail/
112
# create install.rdf for Thunderbird 0.7 and newer
113
cat > ${ENIGLANG}/install.rdf <<EOT
114
<?xml version="1.0"?>
116
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
117
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
119
<Description about="urn:mozilla:install-manifest">
120
<em:id>enigmail-${ENIGLANG}@enigmail.mozdev.org</em:id>
121
<em:version>${ENIGVERSION}</em:version>
123
<!-- Target Application (Thunderbird) this extension can install into,
124
with minimum and maximum supported versions. -->
125
<em:targetApplication>
127
<em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
128
<em:minVersion>1.0</em:minVersion>
129
<em:maxVersion>2.0.0.*</em:maxVersion>
133
<em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
134
<em:minVersion>2.0a1</em:minVersion>
135
<em:maxVersion>2.0.*</em:maxVersion>
137
</em:targetApplication>
139
<!-- Front End MetaData -->
140
<em:name>Enigmail ${ENIGLANG}</em:name>
141
<em:description>Enigmail ${ENIGLANG} language package</em:description>
143
<!-- Author of the package, replace with your name if you like -->
144
<em:creator>Enigmail Team</em:creator>
146
<em:homepageURL>http://enigmail.mozdev.org/langpack.html</em:homepageURL>
148
<!-- Front End Integration Hooks (used by Extension Manager)-->
149
<em:optionsURL>chrome://enigmail/content/pref-enigmail.xul</em:optionsURL>
150
<em:aboutURL>chrome://enigmail/content/enigmailAbout.xul</em:aboutURL>
151
<em:iconURL>chrome://enigmail/skin/enigmail-about.png</em:iconURL>
157
cat >${LANGDIR}/contents.rdf <<EOT
158
<?xml version="1.0"?>
159
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
160
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
162
<!-- list all the packages being supplied by this jar -->
163
<RDF:Seq about="urn:mozilla:locale:root">
164
<RDF:li resource="urn:mozilla:locale:${ENIGLANG}"/>
167
<!-- locale information -->
168
<RDF:Description about="urn:mozilla:locale:${ENIGLANG}" chrome:name="${ENIGLANG}">
171
<RDF:Seq about="urn:mozilla:locale:${ENIGLANG}:packages">
172
<RDF:li resource="urn:mozilla:locale:${ENIGLANG}:enigmail"/>
181
for f in enigmail.dtd enigmail.properties am-enigprefs.properties upgrade_080.html ; do
190
for f in compose.html messenger.html rulesEditor.html editRcptRule.html initError.html ; do
191
cp ${f} ${cwd}/${HELPDIR}
194
cd ${cwd}/${ENIGLANG}/chrome
195
zip -r -D enigmail-${ENIGLANG}.jar locale
197
zip ../enigmail-${ENIGLANG}-${ENIGVERSION}.xpi install.js install.rdf chrome.manifest chrome/enigmail-${ENIGLANG}.jar
200
test $DEBUG -eq 0 && rm -rf ${ENIGLANG}