Mercurial > trustbridge > trustbridge
annotate packaging/create-dist-package.sh.in @ 831:747a48996c1f
(Issue13) Precompile uninstaller
Create-dist-packge now creates a temporary installer that only
writes the uninstaller. Then it excutes this installer (using wine)
to create the uninstaller. That uninstaller is then packaged
normaly and packaged instead of the written uninstaller.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Thu, 24 Jul 2014 15:59:00 +0200 |
parents | eef8e0ca82b9 |
children | 8081ed84589d |
rev | line source |
---|---|
760
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
1 #!/bin/bash |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
2 # Helper script to package the files expected by the -admin application |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
3 # Windows build is expected to live in CMAKE_SOURCE_DIR/build-windows |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
4 set -x |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
5 set -e |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
6 |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
7 if [ ! -d "$WINDOWS_NSSDIR" ]; then |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
8 echo "ERROR: Please set WINDOWS_NSSDIR to the location of your nss binaries" |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
9 exit 1 |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
10 fi |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
11 |
831
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
12 if [ ! -x `which wine` ]; then |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
13 echo "ERROR: Could not find wine." |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
14 exit 1 |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
15 fi |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
16 |
760
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
17 TMPD=$(mktemp -d) |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
18 TMPDIR=$TMPD/TrustBridge-@PROJECT_VERSION@ |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
19 cd @CMAKE_BINARY_DIR@ |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
20 /bin/bash packaging/linux-createpackage.sh |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
21 mkdir -p $TMPDIR/linux |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
22 mkdir -p $TMPDIR/windows |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
23 cp @CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.sh $TMPDIR/linux |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
24 cp @CMAKE_SOURCE_DIR@/build-windows/ui/trustbridge.exe $TMPDIR/windows |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
25 cp @CMAKE_SOURCE_DIR@/build-windows/cinst/cinst.exe $TMPDIR/windows |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
26 cp @CMAKE_SOURCE_DIR@/build-windows/cinst/mozilla.exe $TMPDIR/windows |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
27 cp @CMAKE_SOURCE_DIR@/packaging/filelist.nsh $TMPDIR |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
28 cp @CMAKE_SOURCE_DIR@/packaging/trustbridge.nsi $TMPDIR |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
29 cp -r @CMAKE_SOURCE_DIR@/packaging/resources $TMPDIR/resources |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
30 LC_ALL="de_DE.latin-1" echo "company=Bundesamt f�r Sicherheit in der Informationstechnik" > $TMPDIR/meta.ini |
794
fdc15f0cfdd8
(issue61) NSIS Write uninstall information and make URL configurable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
760
diff
changeset
|
31 EST_SIZE=$(du -s $TMPDIR/windows | cut -f 1) |
760
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
32 echo "version_number=@PROJECT_VERSION@" >> $TMPDIR/meta.ini |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
33 echo "setupname=%1TrustBridge-@PROJECT_VERSION@.exe" >> $TMPDIR/meta.ini |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
34 echo "productname=TrustBridge" >> $TMPDIR/meta.ini |
820
eef8e0ca82b9
Fix distpackage script
Andre Heinecke <andre.heinecke@intevation.de>
parents:
794
diff
changeset
|
35 echo "info_url=https://wald.intevation.org/projects/trustbridge/" >> $TMPDIR/meta.ini |
eef8e0ca82b9
Fix distpackage script
Andre Heinecke <andre.heinecke@intevation.de>
parents:
794
diff
changeset
|
36 echo "productname_short=TrustBridge" >> $TMPDIR/meta.ini |
eef8e0ca82b9
Fix distpackage script
Andre Heinecke <andre.heinecke@intevation.de>
parents:
794
diff
changeset
|
37 echo "description=TrustBridge" >> $TMPDIR/meta.ini |
794
fdc15f0cfdd8
(issue61) NSIS Write uninstall information and make URL configurable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
760
diff
changeset
|
38 echo "size=$EST_SIZE" >> $TMPDIR/meta.ini |
760
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
39 cp $WINDOWS_NSSDIR/*.dll $TMPDIR/windows |
831
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
40 |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
41 # Create a temporary NSIS file for the uninstaller cration |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
42 LC_ALL="de_DE.latin-1" makensis -Dfiles_dir=$TMPDIR/windows \ |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
43 -Dcompany="Bundesamt f�r Sicherheit in der Informationstechnik" \ |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
44 -Dversion_number=@PROJECT_VERSION@ \ |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
45 -Dsetupname="$TMPDIR/TrustBridge-@PROJECT_VERSION@-uni.exe" \ |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
46 -Dproductname="TrustBridge" \ |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
47 -Dpath_sep="/" \ |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
48 -Dinfo_url="https://wald.intevation.org/projects/trustbridge/" \ |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
49 -Dsize=$EST_SIZE \ |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
50 -DWRITE_UNINSTALLER \ |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
51 -Dproductname_short="TrustBridge" @CMAKE_SOURCE_DIR@/packaging/trustbridge.nsi |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
52 wine $TMPDIR/TrustBridge-@PROJECT_VERSION@-uni.exe /S || true |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
53 mv ~/.wine/drive_c/tmp-uninstaller/Uninstall.exe $TMPDIR/windows |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
54 rmdir ~/.wine/drive_c/tmp-uninstaller |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
55 rm $TMPDIR/TrustBridge-@PROJECT_VERSION@-uni.exe |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
56 |
760
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
57 cd $TMPD |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
58 zip -r TrustBridge-@PROJECT_VERSION@.zip TrustBridge-@PROJECT_VERSION@ |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
59 mv TrustBridge-@PROJECT_VERSION@.zip @CMAKE_BINARY_DIR@ |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
60 rm -r $TMPD |
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
61 echo "Package is: @CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.zip" |