2006-07-05 00:37:42 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Make a distribution of an application on MSW.
|
|
|
|
# Example:
|
|
|
|
# ../distrib/msw/makesetup.sh --wxmsw --verbose &> log
|
|
|
|
|
|
|
|
# If your zip accepts Cygwin-style paths, then
|
|
|
|
# use cygpath, else substitute echo
|
|
|
|
CYGPATHPROG=cygpath
|
|
|
|
#CYGPATHPROG=echo
|
|
|
|
|
|
|
|
SPINMSW=0
|
|
|
|
SPINOS2=0
|
|
|
|
SPINDOCS=0
|
|
|
|
SPINALL=0
|
|
|
|
SPINWXALL=0
|
|
|
|
SPINBASE=0
|
|
|
|
GETMAKEFILES=0
|
|
|
|
VERBOSE=0
|
|
|
|
ZIPFLAGS=
|
|
|
|
|
|
|
|
PROGNAME=$0
|
2007-04-02 13:42:42 -04:00
|
|
|
|
2006-07-05 00:37:42 -04:00
|
|
|
. $SCRIPTDIR/utils.inc
|
|
|
|
|
2006-07-21 05:10:35 -04:00
|
|
|
MANIFESTDIR=$WXWIN/distrib/scripts/manifests
|
2006-07-05 00:37:42 -04:00
|
|
|
WEBFILES=$WXWIN/../wxWebSite
|
|
|
|
if [ ! "$CYGPATH" = "" ]; then
|
|
|
|
WEBFILES=`$CYGPATH "$WEBFILES"`
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Set this to the required version
|
|
|
|
if [ "$VERSION" = "" ]; then
|
2008-05-27 14:07:13 -04:00
|
|
|
VERSION=2.9.0
|
2006-07-05 00:37:42 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
getfilelist(){
|
|
|
|
port=$1
|
|
|
|
outfile=$2
|
2006-12-19 03:29:37 -05:00
|
|
|
|
2006-07-05 00:37:42 -04:00
|
|
|
filelist="base.rsp"
|
|
|
|
utilsfiles="tex2rtf.rsp utils.rsp utilmake.rsp"
|
2007-04-14 10:26:29 -04:00
|
|
|
commonfiles="generic.rsp generic_samples.rsp stc.rsp jpeg.rsp tiff.rsp xml.rsp makefile.rsp $utilsfiles"
|
2006-12-19 03:29:37 -05:00
|
|
|
|
2006-07-05 00:37:42 -04:00
|
|
|
if [ ! $port = "base" ]; then
|
2006-12-19 03:29:37 -05:00
|
|
|
filelist="$filelist $commonfiles"
|
|
|
|
fi
|
|
|
|
|
2006-07-05 00:37:42 -04:00
|
|
|
if [ $port = "msw" ] || [ $port = "all" ]; then
|
2007-04-12 22:13:41 -04:00
|
|
|
filelist="$filelist msw.rsp univ.rsp vc.rsp wince.rsp dmc.rsp"
|
2006-07-05 00:37:42 -04:00
|
|
|
fi
|
2006-12-19 03:29:37 -05:00
|
|
|
|
2006-07-05 00:37:42 -04:00
|
|
|
if [ $port = "os2" ] || [ $port = "all" ]; then
|
|
|
|
filelist="$filelist os2.rsp"
|
|
|
|
fi
|
2006-12-19 03:29:37 -05:00
|
|
|
|
2006-07-05 00:37:42 -04:00
|
|
|
if [ $port = "x11" ] || [ $port = "all" ]; then
|
2006-12-19 03:29:37 -05:00
|
|
|
filelist="$filelist univ.rsp x11.rsp"
|
2006-07-05 00:37:42 -04:00
|
|
|
fi
|
2006-12-19 03:29:37 -05:00
|
|
|
|
2006-07-05 00:37:42 -04:00
|
|
|
if [ $port = "mgl" ] || [ $port = "all" ]; then
|
2007-05-07 05:34:27 -04:00
|
|
|
filelist="$filelist univ.rsp mgl.rsp"
|
2006-07-05 00:37:42 -04:00
|
|
|
fi
|
2007-04-12 22:13:41 -04:00
|
|
|
|
2007-01-10 10:01:42 -05:00
|
|
|
if [ $port = "dfb" ] || [ $port = "all" ]; then
|
2007-04-12 22:13:41 -04:00
|
|
|
filelist="$filelist univ.rsp dfb.rsp"
|
2007-01-10 10:01:42 -05:00
|
|
|
fi
|
2007-04-12 22:13:41 -04:00
|
|
|
|
2006-07-05 00:37:42 -04:00
|
|
|
if [ $port = "gtk" ] || [ $port = "all" ]; then
|
|
|
|
filelist="$filelist gtk.rsp"
|
|
|
|
fi
|
2006-12-19 03:29:37 -05:00
|
|
|
|
2006-07-05 00:37:42 -04:00
|
|
|
if [ $port = "motif" ] || [ $port = "all" ]; then
|
|
|
|
filelist="$filelist motif.rsp"
|
|
|
|
fi
|
2006-12-19 03:29:37 -05:00
|
|
|
|
2006-07-05 00:37:42 -04:00
|
|
|
if [ $port = "mac" ] || [ $port = "all" ]; then
|
|
|
|
filelist="$filelist mac.rsp cocoa.rsp"
|
|
|
|
fi
|
2006-12-19 03:29:37 -05:00
|
|
|
|
2006-07-05 00:37:42 -04:00
|
|
|
if [ $port = "all" ]; then
|
2006-08-07 09:49:55 -04:00
|
|
|
filelist="$filelist gtk1.rsp palmos.rsp docsrc.rsp"
|
2006-07-05 00:37:42 -04:00
|
|
|
fi
|
2006-12-19 03:29:37 -05:00
|
|
|
|
2006-07-05 00:37:42 -04:00
|
|
|
tempfile="/tmp/wx$port.files.in"
|
|
|
|
rm -f $outfile
|
2006-12-19 03:29:37 -05:00
|
|
|
|
2006-07-05 00:37:42 -04:00
|
|
|
olddir=$PWD
|
|
|
|
cd $MANIFESTDIR
|
2006-12-19 03:29:37 -05:00
|
|
|
|
2006-07-05 00:37:42 -04:00
|
|
|
cat $filelist > $outfile
|
2006-12-19 03:29:37 -05:00
|
|
|
|
2006-07-05 00:37:42 -04:00
|
|
|
cd $olddir
|
|
|
|
}
|
|
|
|
|
|
|
|
copyfilelist(){
|
|
|
|
FILELIST=$1
|
|
|
|
APPDIR=$2
|
|
|
|
DESTDIR=$3
|
2006-12-19 03:29:37 -05:00
|
|
|
|
2006-07-05 00:37:42 -04:00
|
|
|
for line in `cat $FILELIST` ; do
|
|
|
|
if [ "$line" != "" ]; then
|
|
|
|
subdir=`dirname $line`
|
|
|
|
mkdir -p $DESTDIR/$subdir
|
2006-12-19 03:29:37 -05:00
|
|
|
cp -rf $APPDIR/$line $DESTDIR/$subdir
|
2006-07-05 00:37:42 -04:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
doinit()
|
|
|
|
{
|
|
|
|
if [ "$VERBOSE" != "1" ]; then
|
|
|
|
ZIPFLAGS=-q
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
dospinport(){
|
|
|
|
port=$1
|
2006-12-19 03:29:37 -05:00
|
|
|
|
2006-10-12 15:47:12 -04:00
|
|
|
case "$port" in
|
2006-10-12 15:57:23 -04:00
|
|
|
all)
|
|
|
|
portname="Widgets";;
|
|
|
|
base)
|
|
|
|
portname="Base";;
|
|
|
|
motif)
|
|
|
|
portname="Motif";;
|
|
|
|
mac)
|
|
|
|
portname="Mac";;
|
|
|
|
*)
|
2007-01-10 10:01:42 -05:00
|
|
|
# for all the others (DFB, GTK, MGL, DFB, MSW, X11) just use the
|
2006-10-12 15:57:23 -04:00
|
|
|
# upper-case version as they are abbreviations
|
|
|
|
portname=`echo $port | tr '[a-z]' '[A-Z]'`;;
|
2006-10-12 15:47:12 -04:00
|
|
|
esac
|
2006-12-19 03:29:37 -05:00
|
|
|
|
2006-07-05 00:37:42 -04:00
|
|
|
echo "Creating wx$portname distribution..."
|
|
|
|
|
|
|
|
cd $APPDIR
|
|
|
|
portfiles="/tmp/wx$port.files"
|
|
|
|
getfilelist "$port" "$portfiles"
|
2006-12-19 03:29:37 -05:00
|
|
|
|
2006-09-02 13:38:35 -04:00
|
|
|
TMPFILESDIR=/tmp/wx$port/wx$portname-$VERSION
|
2006-07-05 00:37:42 -04:00
|
|
|
rm -rf $TMPFILESDIR
|
|
|
|
mkdir -p $TMPFILESDIR
|
|
|
|
|
|
|
|
copyfilelist $portfiles $APPDIR $TMPFILESDIR
|
2006-07-18 02:54:02 -04:00
|
|
|
|
|
|
|
if [ $port = "msw" ]; then
|
2009-02-16 05:09:55 -05:00
|
|
|
FILES=`find . -type f \( -path '*/.svn/*' -prune -o -exec ${SCRIPTDIR}/is_text.sh {} \; -print \)`
|
2006-07-18 02:54:02 -04:00
|
|
|
echo "$FILES" > /tmp/textfiles
|
|
|
|
fi
|
|
|
|
|
2006-07-05 00:37:42 -04:00
|
|
|
pushd /tmp/wx$port
|
2006-07-16 19:19:03 -04:00
|
|
|
# use DOS line endings for text files for MSW archives.
|
2006-07-16 18:46:30 -04:00
|
|
|
if [ $port = "msw" ]; then
|
2006-09-02 13:38:35 -04:00
|
|
|
pushd /tmp/wx$port/wx$portname-$VERSION
|
2006-07-18 02:54:02 -04:00
|
|
|
for file in `cat /tmp/textfiles`; do
|
2006-07-19 09:56:41 -04:00
|
|
|
unix2dos $file
|
2006-07-18 02:54:02 -04:00
|
|
|
done
|
|
|
|
popd
|
2006-07-16 18:46:30 -04:00
|
|
|
fi
|
2006-07-05 00:37:42 -04:00
|
|
|
echo "Creating wx$portname-$VERSION.zip..."
|
2007-04-02 13:42:42 -04:00
|
|
|
zip $ZIPFLAGS -r -9 $DIST_DIR/wx$portname-$VERSION.zip .
|
2006-07-05 00:37:42 -04:00
|
|
|
echo "Creating wx$portname-$VERSION.tar.gz..."
|
2007-04-02 13:42:42 -04:00
|
|
|
tar czf $DIST_DIR/wx$portname-$VERSION.tar.gz wx$portname-$VERSION
|
2006-07-05 00:37:42 -04:00
|
|
|
echo "Creating wx$portname-$VERSION.tar.bz2..."
|
2007-04-02 13:42:42 -04:00
|
|
|
tar ch wx$portname-$VERSION | bzip2 -f9 > $DIST_DIR//wx$portname-$VERSION.tar.bz2
|
2006-07-05 00:37:42 -04:00
|
|
|
popd
|
|
|
|
rm -rf /tmp/wx$port
|
2006-07-20 07:14:38 -04:00
|
|
|
rm ${portfiles}
|
2006-12-13 04:24:20 -05:00
|
|
|
rm /tmp/textfiles
|
2006-07-05 00:37:42 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
prepareforrelease()
|
|
|
|
{
|
|
|
|
pushd $APPDIR
|
|
|
|
echo Copying FAQ and other files from $WEBFILES
|
|
|
|
cp $WEBFILES/site/faq*.htm $APPDIR/docs/html
|
|
|
|
cp $WEBFILES/site/platform.htm $APPDIR/docs/html
|
|
|
|
cp $WEBFILES/site/i18n.htm $APPDIR/docs/html
|
2006-12-19 03:29:37 -05:00
|
|
|
|
2006-07-05 00:37:42 -04:00
|
|
|
echo Copying readme files...
|
|
|
|
cp $APPDIR/docs/msw/readme.txt README-MSW.txt
|
|
|
|
cp $APPDIR/docs/msw/install.txt INSTALL-MSW.txt
|
|
|
|
cp $APPDIR/docs/os2/install.txt INSTALL-OS2.txt
|
|
|
|
cp $APPDIR/docs/licence.txt LICENCE.txt
|
|
|
|
cp $APPDIR/docs/lgpl.txt COPYING.LIB
|
|
|
|
cp $APPDIR/docs/changes.txt CHANGES.txt
|
|
|
|
cp $APPDIR/docs/readme.txt README.txt
|
2006-07-16 18:46:30 -04:00
|
|
|
|
|
|
|
cp $APPDIR/docs/mgl/readme.txt $APPDIR/readme-mgl.txt
|
|
|
|
cp $APPDIR/docs/mgl/install.txt $APPDIR/install-mgl.txt
|
2007-04-12 22:13:41 -04:00
|
|
|
|
2007-01-10 10:01:42 -05:00
|
|
|
cp $APPDIR/docs/dfb/install.txt $APPDIR/install-dfb.txt
|
2006-07-16 18:46:30 -04:00
|
|
|
|
|
|
|
cp $APPDIR/docs/x11/readme.txt $APPDIR/readme-x11.txt
|
|
|
|
cp $APPDIR/docs/x11/install.txt $APPDIR/install-x11.txt
|
|
|
|
|
|
|
|
cp $APPDIR/docs/motif/readme.txt $APPDIR/readme-motif.txt
|
|
|
|
cp $APPDIR/docs/motif/install.txt $APPDIR/install-motif.txt
|
|
|
|
|
|
|
|
cp $APPDIR/docs/gtk/readme.txt $APPDIR/readme-gtk.txt
|
|
|
|
cp $APPDIR/docs/gtk/install.txt $APPDIR/install-gtk.txt
|
|
|
|
|
|
|
|
cp $APPDIR/docs/mac/readme.txt $APPDIR/readme-mac.txt
|
|
|
|
cp $APPDIR/docs/mac/install.txt $APPDIR/install-mac.txt
|
|
|
|
|
|
|
|
cp $APPDIR/docs/cocoa/readme.txt $APPDIR/readme-cocoa.txt
|
|
|
|
cp $APPDIR/docs/cocoa/install.txt $APPDIR/install-cocoa.txt
|
2006-12-19 03:29:37 -05:00
|
|
|
|
2006-07-05 00:37:42 -04:00
|
|
|
# Now delete a few files that are unnecessary
|
2007-07-05 04:03:48 -04:00
|
|
|
rm -f BuildSVN.txt descrip.mms
|
2006-07-05 00:37:42 -04:00
|
|
|
rm -f setup.h_vms
|
|
|
|
rm -f docs/html/wxbook.htm docs/html/roadmap.htm
|
|
|
|
rm -f src/mingegcs.bat
|
|
|
|
rm -f src/gtk/descrip.mms src/motif/descrip.mms
|
2006-12-19 03:29:37 -05:00
|
|
|
|
2006-07-05 00:37:42 -04:00
|
|
|
# Copy setup0.h files to setup.h
|
|
|
|
# OS/2 always built with configure now
|
|
|
|
# cp $APPDIR/include/wx/os2/setup0.h $APPDIR/include/wx/os2/setup.h
|
|
|
|
cp $APPDIR/include/wx/msw/setup0.h $APPDIR/include/wx/msw/setup.h
|
|
|
|
cp $APPDIR/include/wx/univ/setup0.h $APPDIR/include/wx/univ/setup.h
|
2006-12-19 03:29:37 -05:00
|
|
|
|
2006-07-16 18:46:30 -04:00
|
|
|
# Make MSW project files always have DOS line endings.
|
2006-12-19 03:29:37 -05:00
|
|
|
unix2dos `cat $MANIFESTDIR/vc.rsp`
|
|
|
|
|
2006-07-05 00:37:42 -04:00
|
|
|
popd
|
|
|
|
}
|
|
|
|
|
|
|
|
usage()
|
|
|
|
{
|
|
|
|
echo "Usage: $PROGNAME [ options ]" 1>&2
|
|
|
|
echo Options:
|
|
|
|
echo " --help Display this help message"
|
|
|
|
echo " --wxmac Build wxMac distribution"
|
|
|
|
echo " --wxmsw Build wxMSW distribution"
|
|
|
|
echo " --wxos2 Build wxOS2 distribution"
|
|
|
|
echo " --wxall Build wxAll zip distribution"
|
|
|
|
echo " --wxbase Build wxBase zip distribution"
|
|
|
|
echo " --all Build all distributions (the default)"
|
|
|
|
echo " --verbose Verbose zip operation"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
# Process command line options.
|
|
|
|
|
|
|
|
for i in "$@"; do
|
|
|
|
|
|
|
|
case "$i" in
|
2008-05-27 14:07:13 -04:00
|
|
|
--wxmac) SPINMAC=1; SPINALL=0 ;;
|
|
|
|
--wxmsw) SPINMSW=1; SPINALL=0 ;;
|
|
|
|
--wxos2) SPINOS2=1; SPINALL=0 ;;
|
|
|
|
--wxall) SPINWXALL=1; SPINALL=0 ;;
|
|
|
|
--wxbase) SPINBASE=1; SPINALL=0 ;;
|
|
|
|
--getmakefiles) GETMAKEFILES=1; SPINALL=0 ;;
|
|
|
|
--docs) SPINDOCS=1; SPINALL=0 ;;
|
|
|
|
--all) SPINALL=1 ;;
|
|
|
|
--verbose) VERBOSE=1 ;;
|
|
|
|
*)
|
|
|
|
usage
|
|
|
|
exit
|
|
|
|
;;
|
2006-07-05 00:37:42 -04:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
doinit
|
|
|
|
prepareforrelease
|
|
|
|
|
|
|
|
# Do OS/2 spin
|
|
|
|
if [ "$SPINOS2" = "1" ] || [ "$SPINALL" = "1" ]; then
|
|
|
|
dospinport "os2"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Do MSW spin
|
|
|
|
if [ "$SPINMSW" = "1" ] || [ "$SPINALL" = "1" ]; then
|
|
|
|
dospinport "msw"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Do wxBase spin
|
|
|
|
if [ "$SPINBASE" = "1" ] || [ "$SPINALL" = "1" ]; then
|
|
|
|
dospinport "base"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Do wxAll spin
|
|
|
|
if [ "$SPINWXALL" = "1" ] || [ "$SPINALL" = "1" ]; then
|
2006-12-19 03:29:37 -05:00
|
|
|
dospinport "all"
|
2006-07-05 00:37:42 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$SPINALL" = "1" ]; then
|
|
|
|
dospinport "mgl"
|
2007-01-10 10:01:42 -05:00
|
|
|
dospinport "dfb"
|
2006-07-05 00:37:42 -04:00
|
|
|
dospinport "gtk"
|
|
|
|
dospinport "x11"
|
|
|
|
dospinport "motif"
|
|
|
|
dospinport "mac"
|
|
|
|
fi
|
|
|
|
|