Mercurial > mxe-octave
annotate mk-dist @ 3403:f79780bcc843
installer: check destination path later in install (Bug #41069)
* makeinst-script.sh: use version in install key, check current version installed seperately from installing to existing octave path. Use version for shortcut folder.
author | John Donoghue <john.donoghue@ieee.org> |
---|---|
date | Sun, 05 Jan 2014 13:53:15 -0500 |
parents | bf96d7158829 |
children |
rev | line source |
---|---|
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
1 #! /bin/bash |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
2 |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
3 set -e |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
4 |
3316
f11beaa3e1f0
mk-dist: Don't set -j option to 9 by default. Use --jobs or settings.mk file to override.
Rik <rik@octave.org>
parents:
3274
diff
changeset
|
5 ## Override with --jobs option or set JOBS variable in settings.mk |
f11beaa3e1f0
mk-dist: Don't set -j option to 9 by default. Use --jobs or settings.mk file to override.
Rik <rik@octave.org>
parents:
3274
diff
changeset
|
6 jobs=0 |
2945 | 7 |
2957 | 8 OCTAVE_TARGET=octave |
3387
0779856e1186
Add desktop shortcut and octave-versionxxxxx-installer.exe naming.
John Donoghue <john.donoghue@ieee.org>
parents:
3374
diff
changeset
|
9 TOPDIR=$(pwd) |
0779856e1186
Add desktop shortcut and octave-versionxxxxx-installer.exe naming.
John Donoghue <john.donoghue@ieee.org>
parents:
3374
diff
changeset
|
10 PATH=$TOPDIR/usr/bin:$PATH |
0779856e1186
Add desktop shortcut and octave-versionxxxxx-installer.exe naming.
John Donoghue <john.donoghue@ieee.org>
parents:
3374
diff
changeset
|
11 TARGET=i686-pc-mingw32 |
0779856e1186
Add desktop shortcut and octave-versionxxxxx-installer.exe naming.
John Donoghue <john.donoghue@ieee.org>
parents:
3374
diff
changeset
|
12 PREFIX=/usr/$TARGET |
0779856e1186
Add desktop shortcut and octave-versionxxxxx-installer.exe naming.
John Donoghue <john.donoghue@ieee.org>
parents:
3374
diff
changeset
|
13 STRIP=$TARGET-strip |
0779856e1186
Add desktop shortcut and octave-versionxxxxx-installer.exe naming.
John Donoghue <john.donoghue@ieee.org>
parents:
3374
diff
changeset
|
14 DATE=$(date +%Y-%m-%d-%H-%M) |
3397
bf96d7158829
mk-dist: use short folder name for zip file
John Donoghue <john.donoghue@ieee.org>
parents:
3388
diff
changeset
|
15 OCTAVE_DIST_NAME=octave-$DATE |
3387
0779856e1186
Add desktop shortcut and octave-versionxxxxx-installer.exe naming.
John Donoghue <john.donoghue@ieee.org>
parents:
3374
diff
changeset
|
16 INSTALLER_PKG= |
0779856e1186
Add desktop shortcut and octave-versionxxxxx-installer.exe naming.
John Donoghue <john.donoghue@ieee.org>
parents:
3374
diff
changeset
|
17 |
2987
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
18 strip=yes |
2992
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
19 installer=no |
2945 | 20 while [ $# -gt 0 ]; do |
21 case "$1" in | |
22 --jobs) | |
23 shift | |
24 if [ $# -gt 0 ]; then | |
25 jobs=$1 | |
26 shift | |
27 else | |
28 echo "mk-dist: expecting argument for --jobs option" 1>&2 | |
29 exit 1 | |
30 fi | |
31 ;; | |
2957 | 32 --stable) |
3387
0779856e1186
Add desktop shortcut and octave-versionxxxxx-installer.exe naming.
John Donoghue <john.donoghue@ieee.org>
parents:
3374
diff
changeset
|
33 # for stable, use octave-version as the folder |
2957 | 34 OCTAVE_TARGET=stable-octave |
35 shift | |
36 ;; | |
2987
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
37 --no-strip) |
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
38 strip=no |
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
39 shift |
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
40 ;; |
2992
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
41 --installer) |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
42 installer=yes |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
43 echo "making installer" |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
44 shift |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
45 ;; |
2945 | 46 *) |
47 echo "mk-dist: unrecognized option: $1" 1>&2 | |
48 exit 1 | |
49 ;; | |
50 esac | |
51 done | |
52 | |
2992
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
53 if [ $installer = "yes" ]; then |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
54 echo "Adding installer to build dependancies" |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
55 INSTALLER_PKG="nsis" |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
56 fi |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
57 |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
58 echo "deleting previous dist directory..." |
2962
486c081fd0b5
mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents:
2958
diff
changeset
|
59 rm -rf $TOPDIR/dist |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
60 |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
61 echo "building octave and dependencies..." |
3316
f11beaa3e1f0
mk-dist: Don't set -j option to 9 by default. Use --jobs or settings.mk file to override.
Rik <rik@octave.org>
parents:
3274
diff
changeset
|
62 if [ $jobs -gt 0 ]; then |
3374
7b62537d0f8a
Add transfig package
John Donoghue <john.donoghue@ieee.org>
parents:
3373
diff
changeset
|
63 make $OCTAVE_TARGET $INSTALLER_PKG msys-base native-gcc native-binutils octave-forge-packages npp units transfig JOBS=$jobs |
3316
f11beaa3e1f0
mk-dist: Don't set -j option to 9 by default. Use --jobs or settings.mk file to override.
Rik <rik@octave.org>
parents:
3274
diff
changeset
|
64 else |
3374
7b62537d0f8a
Add transfig package
John Donoghue <john.donoghue@ieee.org>
parents:
3373
diff
changeset
|
65 make $OCTAVE_TARGET $INSTALLER_PKG msys-base native-gcc native-binutils octave-forge-packages npp units transfig |
3316
f11beaa3e1f0
mk-dist: Don't set -j option to 9 by default. Use --jobs or settings.mk file to override.
Rik <rik@octave.org>
parents:
3274
diff
changeset
|
66 fi |
2945 | 67 |
3388
58b5ed5a0247
mk-dist: delay getting OCTAVE_VERSION until after make is run
John Donoghue <john.donoghue@ieee.org>
parents:
3387
diff
changeset
|
68 OCTAVE_VERSION=`head -1 $TOPDIR/octave/octave-version` |
58b5ed5a0247
mk-dist: delay getting OCTAVE_VERSION until after make is run
John Donoghue <john.donoghue@ieee.org>
parents:
3387
diff
changeset
|
69 |
58b5ed5a0247
mk-dist: delay getting OCTAVE_VERSION until after make is run
John Donoghue <john.donoghue@ieee.org>
parents:
3387
diff
changeset
|
70 if [ "$OCTAVE_TARGET" = "stable-octave" ]; then |
58b5ed5a0247
mk-dist: delay getting OCTAVE_VERSION until after make is run
John Donoghue <john.donoghue@ieee.org>
parents:
3387
diff
changeset
|
71 # if building stable version, use the octave version number aspart of |
58b5ed5a0247
mk-dist: delay getting OCTAVE_VERSION until after make is run
John Donoghue <john.donoghue@ieee.org>
parents:
3387
diff
changeset
|
72 # the dist name |
3397
bf96d7158829
mk-dist: use short folder name for zip file
John Donoghue <john.donoghue@ieee.org>
parents:
3388
diff
changeset
|
73 OCTAVE_DIST_NAME=octave-$OCTAVE_VERSION |
3388
58b5ed5a0247
mk-dist: delay getting OCTAVE_VERSION until after make is run
John Donoghue <john.donoghue@ieee.org>
parents:
3387
diff
changeset
|
74 fi |
58b5ed5a0247
mk-dist: delay getting OCTAVE_VERSION until after make is run
John Donoghue <john.donoghue@ieee.org>
parents:
3387
diff
changeset
|
75 # make dist folder |
3397
bf96d7158829
mk-dist: use short folder name for zip file
John Donoghue <john.donoghue@ieee.org>
parents:
3388
diff
changeset
|
76 OCTAVE_DIST_DIR=$TOPDIR/dist/$OCTAVE_DIST_NAME |
3388
58b5ed5a0247
mk-dist: delay getting OCTAVE_VERSION until after make is run
John Donoghue <john.donoghue@ieee.org>
parents:
3387
diff
changeset
|
77 mkdir -p $OCTAVE_DIST_DIR |
58b5ed5a0247
mk-dist: delay getting OCTAVE_VERSION until after make is run
John Donoghue <john.donoghue@ieee.org>
parents:
3387
diff
changeset
|
78 |
2956 | 79 echo "generating lists of files to exclude..." |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
80 |
2956 | 81 echo " native files..." |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
82 cat > $TOPDIR/excluded-native-files << EOF |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
83 ./$TARGET |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
84 ./bin/$TARGET-*.exe |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
85 EOF |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
86 |
2956 | 87 echo " gcc cross compiler files..." |
3012
100e618349f7
Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents:
3010
diff
changeset
|
88 cd $TOPDIR/cross-tools/$TOPDIR/$PREFIX |
2956 | 89 find . -type f -o -type l | sed "s,./,," > $TOPDIR/excluded-gcc-files |
90 | |
91 echo "copying files..." | |
92 | |
93 echo " octave and dependencies..." | |
3012
100e618349f7
Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents:
3010
diff
changeset
|
94 cd $TOPDIR/$PREFIX |
2962
486c081fd0b5
mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents:
2958
diff
changeset
|
95 tar -c -h -X $TOPDIR/excluded-gcc-files -f - . | ( cd $OCTAVE_DIST_DIR ; tar xpf - ) |
486c081fd0b5
mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents:
2958
diff
changeset
|
96 cp $TOPDIR/build_packages.m $OCTAVE_DIST_DIR/src |
2957 | 97 |
2965 | 98 echo " octaverc file..." |
99 cp $TOPDIR/octaverc $OCTAVE_DIST_DIR/share/octave/site/m/startup/octaverc | |
100 | |
2956 | 101 echo " native tools..." |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
102 cd $TOPDIR/native-tools/usr |
2962
486c081fd0b5
mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents:
2958
diff
changeset
|
103 tar -c -h -X $TOPDIR/excluded-native-files -f - . | ( cd $OCTAVE_DIST_DIR ; tar xpf - ) |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
104 |
2956 | 105 echo " libgcc_s_dw2-1.dll to bin directory" |
2962
486c081fd0b5
mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents:
2958
diff
changeset
|
106 cd $OCTAVE_DIST_DIR |
2956 | 107 cp lib/gcc/i686-pc-mingw32/libgcc_s_dw2-1.dll bin |
108 | |
109 echo " msys base files..." | |
110 cd $TOPDIR/msys-base | |
2962
486c081fd0b5
mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents:
2958
diff
changeset
|
111 tar -c -h -f - . | ( cd $OCTAVE_DIST_DIR ; tar xpf - ) |
2956 | 112 |
3373
e9576ebedb26
Add msys-extension files to installer (Bug #40994)
John Donoghue <john.donoghue@ieee.org>
parents:
3366
diff
changeset
|
113 echo " msys extension files..." |
e9576ebedb26
Add msys-extension files to installer (Bug #40994)
John Donoghue <john.donoghue@ieee.org>
parents:
3366
diff
changeset
|
114 cd $TOPDIR/msys-extension |
e9576ebedb26
Add msys-extension files to installer (Bug #40994)
John Donoghue <john.donoghue@ieee.org>
parents:
3366
diff
changeset
|
115 tar -c -h -f - . | ( cd $OCTAVE_DIST_DIR ; tar xpf - ) |
e9576ebedb26
Add msys-extension files to installer (Bug #40994)
John Donoghue <john.donoghue@ieee.org>
parents:
3366
diff
changeset
|
116 |
e9576ebedb26
Add msys-extension files to installer (Bug #40994)
John Donoghue <john.donoghue@ieee.org>
parents:
3366
diff
changeset
|
117 |
2964 | 118 echo " notepad++..." |
119 cd $TOPDIR | |
120 tar -c -h -f - notepad++ | ( cd $OCTAVE_DIST_DIR ; tar xpf - ) | |
121 cp $TOPDIR/build_packages.m $OCTAVE_DIST_DIR/src | |
122 | |
2930 | 123 echo "making all files writable by user..." |
2962
486c081fd0b5
mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents:
2958
diff
changeset
|
124 chmod -R u+w $OCTAVE_DIST_DIR |
2930 | 125 |
2987
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
126 if [ $strip = "yes" ]; then |
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
127 echo "stripping files..." |
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
128 cd $OCTAVE_DIST_DIR |
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
129 for f in $(find . -name '*.dll' -o -name '*.exe'); do |
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
130 echo " $f" |
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
131 $STRIP $f |
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
132 done |
eb1643bd900c
mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents:
2965
diff
changeset
|
133 fi |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
134 |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
135 cd $TOPDIR/dist |
2992
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
136 |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
137 if [ $installer = "yes" ]; then |
3397
bf96d7158829
mk-dist: use short folder name for zip file
John Donoghue <john.donoghue@ieee.org>
parents:
3388
diff
changeset
|
138 ../makeinst-script.sh $OCTAVE_DIST_NAME |
2992
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
139 |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
140 echo "Generating installer ..." |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
141 $TOPDIR/usr/bin/$TARGET-makensis octave.nsi > /dev/null |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
142 |
3387
0779856e1186
Add desktop shortcut and octave-versionxxxxx-installer.exe naming.
John Donoghue <john.donoghue@ieee.org>
parents:
3374
diff
changeset
|
143 if [ -e octave-$OCTAVE_VERSION-installer.exe ]; then |
3010
8ac67219c241
Updates for nsis build and installer creation
John Donoghue <john.donoghue@ieee.org>
parents:
2992
diff
changeset
|
144 echo "Installer created" |
2992
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
145 rm octave.nsi |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
146 fi |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
147 |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
148 else |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
149 echo "creating zip file..." |
3397
bf96d7158829
mk-dist: use short folder name for zip file
John Donoghue <john.donoghue@ieee.org>
parents:
3388
diff
changeset
|
150 zip -q -9 -r $OCTAVE_DIST_DIR.zip $OCTAVE_DIST_NAME |
2992
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
151 fi |
4b450c162e39
Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents:
2987
diff
changeset
|
152 |