-
Notifications
You must be signed in to change notification settings - Fork 3
/
speller-funcs.sh
executable file
·58 lines (53 loc) · 2.08 KB
/
speller-funcs.sh
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
#!/bin/bash
function pkg_msi {
pushd /misc/spellers
export AUTOPKG_WINX=$2
./make_msi.pl $1
mkdir -pv ~apertium/public_html/spellers/${AUTOPKG_BUILDTYPE}/
rm -fv ~apertium/public_html/spellers/${AUTOPKG_BUILDTYPE}/$1*-$2*
cp -av build/$1/*.msi ~apertium/public_html/spellers/${AUTOPKG_BUILDTYPE}/
popd
pushd ~apertium/public_html/spellers/${AUTOPKG_BUILDTYPE}/
ln -sfv $1*-$2.msi $1-latest-$2.msi
popd
}
function pkg_xpi {
pushd /misc/spellers
./make_xpi.pl $1
mkdir -pv ~apertium/public_html/spellers/${AUTOPKG_BUILDTYPE}/
rm -fv ~apertium/public_html/spellers/${AUTOPKG_BUILDTYPE}/$1*.xpi
cp -av build/mozilla/$1*.xpi ~apertium/public_html/spellers/${AUTOPKG_BUILDTYPE}/
popd
pushd ~apertium/public_html/spellers/${AUTOPKG_BUILDTYPE}/
ln -sfv $1*.xpi $1-latest.xpi
popd
}
function combine_msi {
mkdir -pv /opt/autopkg/tmp/speller.$$
pushd /opt/autopkg/tmp/speller.$$
rm -f *.msi *.o
rm -fv ~apertium/public_html/spellers/${AUTOPKG_BUILDTYPE}/$1*.exe
cp -av ~apertium/public_html/spellers/${AUTOPKG_BUILDTYPE}/$1-[0-9]*-win32* 32.msi
cp -av ~apertium/public_html/spellers/${AUTOPKG_BUILDTYPE}/$1-[0-9]*-win64* 64.msi
/opt/mxe/usr/bin/i686-w64-mingw32.static-ld -r -b binary -o 32.o 32.msi
/opt/mxe/usr/bin/i686-w64-mingw32.static-ld -r -b binary -o 64.o 64.msi
EXE=`basename ~apertium/public_html/spellers/${AUTOPKG_BUILDTYPE}/$1-[0-9]*-win32* -win32.msi`
/opt/mxe/usr/bin/i686-w64-mingw32.static-g++ -static -O3 -std=c++14 /misc/spellers/windows/setup.cpp 32.o 64.o -o $1.exe
osslsigncode -pkcs12 '/root/.keys/2018-12-10 TDC Code Signing.p12' -readpass '/root/.keys/2018-12-10 TDC Code Signing.key' -t http://timestamp.verisign.com/scripts/timstamp.dll -in $1.exe -out "$EXE.exe"
mv -v "$EXE.exe" ~apertium/public_html/spellers/${AUTOPKG_BUILDTYPE}/
popd
rm -rf /opt/autopkg/tmp/speller.$$
pushd ~apertium/public_html/spellers/${AUTOPKG_BUILDTYPE}/
ln -sfv $1*.exe $1-latest.exe
popd
}
function pkg_spellers {
pushd /misc/spellers
svn up
popd
pkg_msi $1 win32
pkg_msi $1 win64
combine_msi $1
pkg_xpi $1
chown -R apertium:apertium ~apertium/public_html/spellers/${AUTOPKG_BUILDTYPE}
}