Mercurial > trustbridge
annotate packaging/create-dist-package.sh.in @ 1126:a07030035349
(issue96) Add progressbar during download if window is visible.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Wed, 17 Sep 2014 12:14:07 +0200 |
parents | a162f4cbba75 |
children | a974b61a5cce |
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 |
831
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
7 if [ ! -x `which wine` ]; then |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
8 echo "ERROR: Could not find wine." |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
9 exit 1 |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
10 fi |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
11 |
885
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
853
diff
changeset
|
12 if [ ! -f @CMAKE_SOURCE_DIR@/build-windows/Makefile ]; then |
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
853
diff
changeset
|
13 echo "Could not find a windows build in: @CMAKE_SOURCE_DIR@/build-windows " |
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
853
diff
changeset
|
14 exit 1 |
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
853
diff
changeset
|
15 fi |
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
853
diff
changeset
|
16 |
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
853
diff
changeset
|
17 if [ ! -f @CMAKE_SOURCE_DIR@/build-i386/Makefile ]; then |
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
853
diff
changeset
|
18 echo "Could not find a i386 build in: @CMAKE_SOURCE_DIR@/build-i386 " |
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
853
diff
changeset
|
19 exit 1 |
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
853
diff
changeset
|
20 fi |
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
853
diff
changeset
|
21 |
760
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
22 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
|
23 TMPDIR=$TMPD/TrustBridge-@PROJECT_VERSION@ |
885
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
853
diff
changeset
|
24 cd @CMAKE_SOURCE_DIR@/build-windows |
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
853
diff
changeset
|
25 echo "Updating windows build" |
887
accda55ae053
Use make -j`nproc` everywhere instead of fixed number
Andre Heinecke <andre.heinecke@intevation.de>
parents:
885
diff
changeset
|
26 make -j`nproc` |
885
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
853
diff
changeset
|
27 cd @CMAKE_SOURCE_DIR@/build-i386 |
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
853
diff
changeset
|
28 echo "Building x86 package" |
887
accda55ae053
Use make -j`nproc` everywhere instead of fixed number
Andre Heinecke <andre.heinecke@intevation.de>
parents:
885
diff
changeset
|
29 make -j`nproc` |
972
8be2f510adbf
(issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
963
diff
changeset
|
30 /bin/bash packaging/linux-createpackage.sh i386 |
760
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
31 cd @CMAKE_BINARY_DIR@ |
885
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
853
diff
changeset
|
32 echo "Building amd64 package" |
972
8be2f510adbf
(issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
963
diff
changeset
|
33 /bin/bash packaging/linux-createpackage.sh x86_64 |
760
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
34 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
|
35 mkdir -p $TMPDIR/windows |
885
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
853
diff
changeset
|
36 mv @CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.sh \ |
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
853
diff
changeset
|
37 $TMPDIR/linux/TrustBridge-@PROJECT_VERSION@-amd64.sh |
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
853
diff
changeset
|
38 mv @CMAKE_SOURCE_DIR@/build-i386/TrustBridge-@PROJECT_VERSION@.sh \ |
1cc85fd3daa5
(issue70) Handle i386 and amd64 packages
Andre Heinecke <andre.heinecke@intevation.de>
parents:
853
diff
changeset
|
39 $TMPDIR/linux/TrustBridge-@PROJECT_VERSION@-i386.sh |
760
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
40 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
|
41 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
|
42 cp @CMAKE_SOURCE_DIR@/build-windows/cinst/mozilla.exe $TMPDIR/windows |
1121
a162f4cbba75
(issue54) Handle plugin dir in create-dist-package and on installer creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1010
diff
changeset
|
43 cp -r @CMAKE_SOURCE_DIR@/packaging/resources $TMPDIR/resources |
a162f4cbba75
(issue54) Handle plugin dir in create-dist-package and on installer creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1010
diff
changeset
|
44 cp @CMAKE_SOURCE_DIR@/build-windows/packaging/DesktopShellRun.dll $TMPDIR/resources |
974
cbd32175c56c
Add recursive copy for html documentation for windows
Andre Heinecke <andre.heinecke@intevation.de>
parents:
972
diff
changeset
|
45 cp -r @CMAKE_BINARY_DIR@/manuals/help-manual/html $TMPDIR/windows/doc |
963
62b832d0b839
(issue89) Package help for windows
Andre Heinecke <andre.heinecke@intevation.de>
parents:
887
diff
changeset
|
46 |
760
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
47 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
|
48 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
|
49 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
|
50 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
|
51 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
|
52 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
|
53 echo "productname=TrustBridge" >> $TMPDIR/meta.ini |
852
637948e9e32d
(issue61) Change temporary link into wald from https to http
Andre Heinecke <andre.heinecke@intevation.de>
parents:
834
diff
changeset
|
54 echo "info_url=http://wald.intevation.org/projects/trustbridge/" >> $TMPDIR/meta.ini |
820
eef8e0ca82b9
Fix distpackage script
Andre Heinecke <andre.heinecke@intevation.de>
parents:
794
diff
changeset
|
55 echo "productname_short=TrustBridge" >> $TMPDIR/meta.ini |
eef8e0ca82b9
Fix distpackage script
Andre Heinecke <andre.heinecke@intevation.de>
parents:
794
diff
changeset
|
56 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
|
57 echo "size=$EST_SIZE" >> $TMPDIR/meta.ini |
831
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
58 |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
59 # Create a temporary NSIS file for the uninstaller cration |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
60 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
|
61 -Dcompany="Bundesamt f�r Sicherheit in der Informationstechnik" \ |
1121
a162f4cbba75
(issue54) Handle plugin dir in create-dist-package and on installer creation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1010
diff
changeset
|
62 -Dplugin_dir="$TMPDIR/resources" \ |
831
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
63 -Dversion_number=@PROJECT_VERSION@ \ |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
64 -Dsetupname="$TMPDIR/TrustBridge-@PROJECT_VERSION@-uni.exe" \ |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
65 -Dproductname="TrustBridge" \ |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
66 -Dpath_sep="/" \ |
852
637948e9e32d
(issue61) Change temporary link into wald from https to http
Andre Heinecke <andre.heinecke@intevation.de>
parents:
834
diff
changeset
|
67 -Dinfo_url="http://wald.intevation.org/projects/trustbridge/" \ |
831
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
68 -Dsize=$EST_SIZE \ |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
69 -DWRITE_UNINSTALLER \ |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
70 -Dproductname_short="TrustBridge" @CMAKE_SOURCE_DIR@/packaging/trustbridge.nsi |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
71 wine $TMPDIR/TrustBridge-@PROJECT_VERSION@-uni.exe /S || true |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
72 mv ~/.wine/drive_c/tmp-uninstaller/Uninstall.exe $TMPDIR/windows |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
73 rmdir ~/.wine/drive_c/tmp-uninstaller |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
74 rm $TMPDIR/TrustBridge-@PROJECT_VERSION@-uni.exe |
747a48996c1f
(Issue13) Precompile uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents:
820
diff
changeset
|
75 |
760
438d7c88104f
Add create-dist-package script to create a package suitable for trustbridge-admin
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
76 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
|
77 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
|
78 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
|
79 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
|
80 echo "Package is: @CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.zip" |