forked from zotero/zotero
-
Notifications
You must be signed in to change notification settings - Fork 0
/
domino-build-script
executable file
·92 lines (78 loc) · 2.52 KB
/
domino-build-script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
!/bin/sh
# Build impero-multi XPI
# TODO: some xslt to get version number from install.rdf and use for version number in file name
APP_NAME=impero
APP_VERSION=3.0b3
SUFFIX=.xpi
INSTALLER_NAME=$APP_NAME$APP_VERSION$SUFFIX
set -e
for i in build build/styles build/translators; do
if [ ! -d $i ]; then
mkdir $i
fi
done
cp translators/deleted.txt .
for i in chrome components defaults scripts; do
find $i -path "*/\.git" -prune -o -name "*~" -prune -o -print | zip $INSTALLER_NAME -@
done
for i in chrome.manifest COPYING README deleted.txt install.rdf update.rdf repotime.txt engines.json *.sql; do
echo $i | zip $INSTALLER_NAME -@
done
# Update styles
cp styles/* build/styles
#for i in $(ls styles); do
# if [ ! -f build/styles-0.8/$i ]; then
# BASENAME=$(basename $i .csl)
# echo Fetching CSL style ${BASENAME} from zotero.org
# wget http://www.zotero.org/styles/${BASENAME}?install=1 -q -O build/styles-0.8/${BASENAME}.csl
# fi
#done
# Convert styles
#CONVERT="false"
#for i in $(ls build/styles-0.8); do
# BASENAME=$(basename $i)
# if [ ! -f build/styles/${BASENAME} ]; then
# echo Missing CSL 1.0 file for ${BASENAME}, reprocessing all files ...
# CONVERT="true"
# fi
#done
#if [ "${CONVERT}" == "true" ]; then
# ../csl-utils/update-styles.sh --csl-input=../zotero-multi/build/styles-0.8 --csl-output=../zotero-multi/build/styles
#fi
# Zip styles
cd build/styles
zip styles *.csl
cd ../..
mv build/styles/styles.zip .
# Initialize translators.index
if [ -f translators.index ]; then
rm translators.index
fi
touch translators.index
# Copy translator files into build directory, logging each as copied
COUNT=0
for i in translators/*.js; do
FILENAME=$(echo ${COUNT}.js)
KEY=$(grep -m 1 translatorID "$i"| sed -e "s/.*translatorID\" *: *\"\([^\"]\+\)\".*/\\1/")
NAME=$(grep -m 1 label "$i"| sed -e "s/.*label\" *: *\"\([^\"]\+\)\".*/\\1/")
DATE=$(grep -m 1 lastUpdated "$i"| sed -e "s/.*lastUpdated\" *: *\"\([^\"]\+\)\".*/\\1/")
echo ${FILENAME},${KEY},${NAME},${DATE} >> translators.index
cp "$i" build/translators/${FILENAME}
echo -n "${FILENAME} "
echo $((COUNT++)) > /dev/null
done
# Zip translators
cd build/translators
zip translators *.js
cd ../..
mv build/translators/translators.zip .
# Add styles, translators and translators.index to XPI
echo styles.zip | zip $INSTALLER_NAME -@
echo translators.index | zip $INSTALLER_NAME -@
echo translators.zip | zip $INSTALLER_NAME -@
rm translators.index
rm styles.zip
rm translators.zip
rm -fR build
# sha1sum $INSTALLER_NAME > file_hash
# logic here to insert file_hash into install.rdf file with xslt