annotate mk-dist @ 2992:4b450c162e39

Add ability to create simple NSIS installer * makeinst-script.sh: New script * mk-dist: added --installer option, which will add nsis to the applications to build, and create an installer instead of a zip file.
author John Donoghue <john.donoghue@ieee.org>
date Sat, 18 May 2013 18:15:43 -0400
parents eb1643bd900c
children 8ac67219c241
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
2945
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
5 jobs=9
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
6
2957
0c4eab3a7903 mk-dist: --stable option
John W. Eaton <jwe@octave.org>
parents: 2956
diff changeset
7 OCTAVE_TARGET=octave
2987
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
8
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
9 strip=yes
2992
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
10 installer=no
2945
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
11 while [ $# -gt 0 ]; do
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
12 case "$1" in
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
13 --jobs)
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
14 shift
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
15 if [ $# -gt 0 ]; then
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
16 jobs=$1
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
17 shift
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
18 else
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
19 echo "mk-dist: expecting argument for --jobs option" 1>&2
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
20 exit 1
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
21 fi
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
22 ;;
2957
0c4eab3a7903 mk-dist: --stable option
John W. Eaton <jwe@octave.org>
parents: 2956
diff changeset
23 --stable)
0c4eab3a7903 mk-dist: --stable option
John W. Eaton <jwe@octave.org>
parents: 2956
diff changeset
24 OCTAVE_TARGET=stable-octave
0c4eab3a7903 mk-dist: --stable option
John W. Eaton <jwe@octave.org>
parents: 2956
diff changeset
25 shift
0c4eab3a7903 mk-dist: --stable option
John W. Eaton <jwe@octave.org>
parents: 2956
diff changeset
26 ;;
2987
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
27 --no-strip)
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
28 strip=no
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
29 shift
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
30 ;;
2992
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
31 --installer)
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
32 installer=yes
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
33 echo "making installer"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
34 shift
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
35 ;;
2945
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
36 *)
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
37 echo "mk-dist: unrecognized option: $1" 1>&2
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
38 exit 1
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
39 ;;
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
40 esac
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
41 done
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
42
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
43 TOPDIR=$(pwd)
2945
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
44 PATH=$TOPDIR/usr/bin:$PATH
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
45 PREFIX=/usr
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
46 TARGET=i686-pc-mingw32
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
47 BUILD=x86_64-unwknown-linux-gnu
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
48 STRIP=$TARGET-strip
2962
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
49 DATE=$(date +%Y-%m-%d-%H-%M)
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
50 OCTAVE_DIST_DIR=$TOPDIR/dist/$OCTAVE_TARGET-$DATE
2992
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
51 INSTALLER_PKG=
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
52
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
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
60 mkdir -p $OCTAVE_DIST_DIR
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
61
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
62 echo "building octave and dependencies..."
2992
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
63 make $OCTAVE_TARGET $INSTALLER_PKG msys-base native-gcc native-binutils octave-forge-packages npp JOBS=$jobs
2945
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
64
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
65 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
66
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
67 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
68 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
69 ./$TARGET
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
70 ./bin/$TARGET-*.exe
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
71 EOF
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
72
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
73 echo " gcc cross compiler files..."
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
74 cd $TOPDIR/cross-tools/$TOPDIR/$PREFIX/$TARGET
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
75 find . -type f -o -type l | sed "s,./,," > $TOPDIR/excluded-gcc-files
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
76
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
77 echo "copying files..."
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
78
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
79 echo " octave and dependencies..."
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
80 cd $TOPDIR/usr/$TARGET
2962
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
81 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
82 cp $TOPDIR/build_packages.m $OCTAVE_DIST_DIR/src
2957
0c4eab3a7903 mk-dist: --stable option
John W. Eaton <jwe@octave.org>
parents: 2956
diff changeset
83
2965
d35eda9fb1f3 octaverc file
John W. Eaton <jwe@octave.org>
parents: 2964
diff changeset
84 echo " octaverc file..."
d35eda9fb1f3 octaverc file
John W. Eaton <jwe@octave.org>
parents: 2964
diff changeset
85 cp $TOPDIR/octaverc $OCTAVE_DIST_DIR/share/octave/site/m/startup/octaverc
d35eda9fb1f3 octaverc file
John W. Eaton <jwe@octave.org>
parents: 2964
diff changeset
86
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
87 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
88 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
89 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
90
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
91 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
92 cd $OCTAVE_DIST_DIR
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
93 cp lib/gcc/i686-pc-mingw32/libgcc_s_dw2-1.dll bin
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
94
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
95 echo " msys base files..."
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
96 cd $TOPDIR/msys-base
2962
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
97 tar -c -h -f - . | ( cd $OCTAVE_DIST_DIR ; tar xpf - )
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
98
2964
1955438b24dc get notepad++
John W. Eaton <jwe@octave.org>
parents: 2962
diff changeset
99 echo " notepad++..."
1955438b24dc get notepad++
John W. Eaton <jwe@octave.org>
parents: 2962
diff changeset
100 cd $TOPDIR
1955438b24dc get notepad++
John W. Eaton <jwe@octave.org>
parents: 2962
diff changeset
101 tar -c -h -f - notepad++ | ( cd $OCTAVE_DIST_DIR ; tar xpf - )
1955438b24dc get notepad++
John W. Eaton <jwe@octave.org>
parents: 2962
diff changeset
102 cp $TOPDIR/build_packages.m $OCTAVE_DIST_DIR/src
1955438b24dc get notepad++
John W. Eaton <jwe@octave.org>
parents: 2962
diff changeset
103
2930
e7bd76ab0710 mk-dist script tweaks
John W. Eaton <jwe@octave.org>
parents: 2921
diff changeset
104 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
105 chmod -R u+w $OCTAVE_DIST_DIR
2930
e7bd76ab0710 mk-dist script tweaks
John W. Eaton <jwe@octave.org>
parents: 2921
diff changeset
106
2987
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
107 if [ $strip = "yes" ]; then
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
108 echo "stripping files..."
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
109 cd $OCTAVE_DIST_DIR
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
110 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
111 echo " $f"
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
112 $STRIP $f
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
113 done
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
114 fi
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
115
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
116 #echo "creating tar file..."
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
117 #cd $TOPDIR/dist
2962
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
118 #tar -c -j -f $OCTAVE_TARGET-$DATE.tar.bz2 $OCTAVE_TARGET-$DATE
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
119
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
120 cd $TOPDIR/dist
2992
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
121
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
122 if [ $installer = "yes" ]; then
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
123 sh ../makeinst-script.sh $OCTAVE_TARGET-$DATE
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
124
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
125 echo "Generating installer ..."
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
126 $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
127
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
128 if [ -e Octave-Installer.exe ]; then
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
129 rm octave.nsi
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
130 fi
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
131
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
132 else
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
133 echo "creating zip file..."
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
134 zip -q -9 -r $OCTAVE_TARGET-$DATE.zip $OCTAVE_TARGET-$DATE
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
135 fi
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
136