File: mkwindist

package info (click to toggle)
gretl 1.9.1-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 31,704 kB
  • ctags: 19,144
  • sloc: ansic: 276,238; sh: 10,907; makefile: 1,995; lisp: 1,205; perl: 364; xml: 320
file content (278 lines) | stat: -rwxr-xr-x 7,921 bytes parent folder | download
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
#!/bin/sh

# Shell script to make gretl win32 distribution

BUILDTYPE=$1

if [ "x${BUILDTYPE}" = "x" ] ; then
  echo "mkwindist: argument must be 'cross' or 'native'"
  exit 1
fi

TOPDIR=".."
THISDIR=`pwd`

########## CONFIGURE HERE ###################

if [ "$BUILDTYPE" = "cross" ] ; then
  WINFILES=/home/cottrell/stats/esl/win32
  HLPDIR=${TOPDIR}/share
  DOCDIR=${TOPDIR}/build/doc/tex
  SYSBIN=/opt/cross-tools/mingw32/bin
  INNO_CMD="wine c:/innodir/ISCC.exe"
else
  WINFILES=/mingw/winbuild
  HLPDIR=${WINFILES}/help
  DOCDIR=${WINFILES}/doc
  SYSBIN=c:/mingw/bin
  # C:/Program Files/Inno Setup 5/ISCC.exe
  INNO_CMD="c:/progra~1/innose~1/iscc.exe"
fi

#############################################

# function: add content of unexploded tar package
# the single argument is the path to the tarball
function process_tarball {
    echo "adding content of $1"
    tar tvfz $1 | awk '{ print $3" "$4" "$5" "$6 }' | \
       grep -v ^0 >> MANIFEST
    tar xfz $1
}

# function: add individual file to package
# arg1 is path to file to add, arg2 is where to put it
function add_file {
    finfo=`ls -l $1 | awk '{ print $5" "$6" "$7 }'`
    cp -p $1 windist/$2
    echo $2
    echo "$finfo $2" >> windist/MANIFEST
}

# start of script proper

VERSION=$(grep GRETL_VERSION[^_] $TOPDIR/lib/src/version.h | \
     awk '{ print $NF}' | sed s/[\"\;]//g)

if [ -f windist/MANIFEST ] ; then
   cp windist/MANIFEST windist/MANIFEST.`date +%Y-%m-%d`
fi
echo "VERSION $VERSION" > windist/MANIFEST
echo "DATE `date`" >> windist/MANIFEST
rm -rf windist/gretl

# make gretl directory structure
mkdir -p windist
mkdir -p windist/gretl
mkdir -p windist/gretl/data
mkdir -p windist/gretl/data/misc
mkdir -p windist/gretl/data/greene
mkdir -p windist/gretl/data/nist
mkdir -p windist/gretl/data/plotbars
mkdir -p windist/gretl/functions
mkdir -p windist/gretl/scripts
mkdir -p windist/gretl/scripts/misc
mkdir -p windist/gretl/db
mkdir -p windist/gretl/doc
mkdir -p windist/gretl/helpfigs
mkdir -p windist/gretl/plugins
mkdir -p windist/gretl/plugins/data
mkdir -p windist/gretl/ui

# put binaries in place
add_file gretlcli.exe gretl/gretlcli.exe
add_file gretlw32.exe gretl/gretlw32.exe

# home-made dynamic libs
for f in dlls/*.dll ; do
    add_file $f gretl/`basename $f`
done

# gretl plugins
for f in plugins/*.dll ; do
    add_file $f gretl/plugins/`basename $f`
done

# gretl translations
LANGS=`cat ${TOPDIR}/po/LINGUAS | grep -v ^#`
for lang in $LANGS ; do
   mkdir -p windist/gretl/locale/${lang}/LC_MESSAGES
done

# auxiliary dlls
for f in \
    libgmp-3.dll libmpfr-1.dll libxml2.dll readline5.dll history5.dll \
    zlib1.dll libblas.dll liblapack.dll libgtksourceview.dll \
    iconv.dll intl.dll libfftw3-3.dll libpng12-0.dll 
do
    add_file ${WINFILES}/misc-dll/$f gretl/$f
done

# system DLLs for threads/openmp, if required
# add_file ${SYSBIN}/mingwm10.dll gretl/mingwm10.dll
# add_file ${SYSBIN}/pthreadGC2.dll gretl/pthreadGC2.dll

# GTK/pango dependencies
for f in \
    libexpat-1.dll freetype6.dll libfontconfig-1.dll
do 
    add_file ${WINFILES}/misc-dll/$f gretl/$f
done

# XML UI-definition files
for f in ${TOPDIR}/gui2/*.xml ; do
  add_file $f gretl/ui/`basename $f`
done

# lang files for gtksourceview
mkdir -p windist/gretl/share/gtksourceview-1.0/language-specs
add_file gretl.lang \
  gretl/share/gtksourceview-1.0/language-specs/gretl.lang
add_file ${TOPDIR}/gui2/gnuplot.lang \
  gretl/share/gtksourceview-1.0/language-specs/gnuplot.lang
add_file ${TOPDIR}/gui2/R.lang \
  gretl/share/gtksourceview-1.0/language-specs/R.lang
add_file ${TOPDIR}/gui2/cpp.lang \
  gretl/share/gtksourceview-1.0/language-specs/cpp.lang
add_file ${TOPDIR}/gui2/octave.lang \
  gretl/share/gtksourceview-1.0/language-specs/octave.lang

# help files, license, logo
add_file ${HLPDIR}/gretlgui.hlp gretl/gretlgui_hlp.txt
add_file ${HLPDIR}/gretlcmd.hlp gretl/gretlcmd_hlp.txt
add_file ${HLPDIR}/gretlcli.hlp gretl/gretlcli_hlp.txt
add_file ${HLPDIR}/genrcli.hlp gretl/genrcli.hlp
add_file ${HLPDIR}/genrgui.hlp gretl/genrgui.hlp
add_file ${HLPDIR}/genrcli.hlp.it gretl/genrcli.hlp.it
add_file ${HLPDIR}/genrgui.hlp.it gretl/genrgui.hlp.it
for f in ${TOPDIR}/share/texfigs/*.png ; do
   add_file $f gretl/helpfigs/`basename $f`
done
for lang in es it ; do
   add_file ${HLPDIR}/gretlgui.hlp.${lang} \
       gretl/gretlgui_hlp_${lang}.txt
   add_file ${HLPDIR}/gretlcmd.hlp.${lang} \
       gretl/gretlcmd_hlp_${lang}.txt
   add_file ${HLPDIR}/gretlcli.hlp.${lang} \
       gretl/gretlcli_hlp_${lang}.txt
done
add_file ${TOPDIR}/COPYING gretl/COPYING
add_file ${TOPDIR}/pixmaps/gretl-logo.xpm gretl/gretl-logo.xpm
add_file ${DOCDIR}/gretl-guide.pdf gretl/doc/gretl-guide.pdf
add_file ${DOCDIR}/gretl-ref.pdf gretl/doc/gretl-ref.pdf

# top-level data files
for f in ${TOPDIR}/share/data/*.gdt ; do
    add_file $f gretl/data/`basename $f`
done
for f in ${TOPDIR}/share/data/*.dtd ; do
    add_file $f gretl/data/`basename $f`
done
for f in ${TOPDIR}/share/data/descriptions ; do
    add_file $f gretl/data/`basename $f`
done

# Greene data files
for f in ${TOPDIR}/share/data/greene/*.gdt ; do
    add_file $f gretl/data/greene/`basename $f`
done
for f in ${TOPDIR}/share/data/greene/wg_descriptions ; do
    add_file $f gretl/data/greene/`basename $f`
done

# "misc" data files
for f in ${TOPDIR}/share/data/misc/*.gdt ; do
    add_file $f gretl/data/misc/`basename $f`
done
for f in ${TOPDIR}/share/data/misc/descriptions ; do
    add_file $f gretl/data/misc/`basename $f`
done

# Plot bars data files
for f in ${TOPDIR}/share/data/plotbars/*.txt ; do
    add_file $f gretl/data/plotbars/`basename $f`
done

# NIST test data files
for f in ${TOPDIR}/tests/*.dat ; do
    add_file $f gretl/data/nist/`basename $f`
done

# top-level scripts
for f in ${TOPDIR}/share/scripts/*.inp ; do
    add_file $f gretl/scripts/`basename $f`
done
for f in ${TOPDIR}/share/scripts/*tions ; do
    add_file $f gretl/scripts/`basename $f`
done

# "misc" scripts
for f in ${TOPDIR}/share/scripts/misc/*.inp ; do
    add_file $f gretl/scripts/misc/`basename $f`
done
for f in ${TOPDIR}/share/scripts/misc/ps_descriptions ; do
    add_file $f gretl/scripts/misc/`basename $f`
done

# function package DTD and sample(s)
for f in ${TOPDIR}/share/functions/*.dtd ; do
    add_file $f gretl/functions/`basename $f`
done
for f in ${TOPDIR}/share/functions/*.gfn ; do
    add_file $f gretl/functions/`basename $f`
done

# database files
if [ "$BUILDTYPE" = "cross" ] ; then
  make -C ${TOPDIR}/build/share/bcih
  add_file ${TOPDIR}/build/share/bcih/fedstl.bin gretl/db/fedstl.bin
  add_file ${TOPDIR}/share/bcih/fedstl.idx gretl/db/fedstl.idx 
else
  make -C db
  add_file db/fedstl.bin gretl/db/fedstl.bin
  add_file ${TOPDIR}/share/bcih/fedstl.idx gretl/db/fedstl.idx 
fi

# translations (make sure they're up to date first)
make -C mo
for lang in $LANGS ; do
  add_file mo/$lang.mo gretl/locale/$lang/LC_MESSAGES/gretl.mo
done

# ensure updater is au courant
make -C updater

# misc files
add_file ${TOPDIR}/plugin/data/urcdata.gz gretl/plugins/data/urcdata.gz
add_file ${TOPDIR}/plugin/data/dwdata.gz gretl/plugins/data/dwdata.gz
add_file gretl_website.url gretl/gretl_website.url
add_file updater/gretl_updater.exe gretl/gretl_updater.exe
date > gretl.stamp
add_file gretl.stamp gretl/gretl.stamp

# add GTK runtime and gnuplot distribution: note that we move
# into the "windist" subdir first
cd windist
if [ ! -f ${WINFILES}/gtk-runtime.tar.gz ] ; then
  echo "Couldn't find gtk-runtime.tar.gz"
  exit 1
else 
  process_tarball ${WINFILES}/gtk-runtime.tar.gz
fi

if [ ! -f ${WINFILES}/gp45cvsw32.tar.gz ] ; then
  echo "Couldn't find gp45cvsw32.tar.gz"
  exit 1
else
  process_tarball ${WINFILES}/gp45cvsw32.tar.gz
fi

make gretl.iss

# make Inno installer
echo "Building gretl installer executable..."
${INNO_CMD} ./gretl.iss 2>errlog && \
mv Output/setup.exe Output/gretl_install.exe && \
ls -l Output/gretl_install.exe

touch dist.stamp