]> git.saurik.com Git - wxWidgets.git/blob - distrib/scripts/pre-flight.sh
make prefix /usr by default, not /opt/gnome
[wxWidgets.git] / distrib / scripts / pre-flight.sh
1 #!/bin/sh
2
3 if [ "$VERSION" = "" ]; then
4 echo "Including build-environ.cfg"
5 . scripts/build-environ.cfg
6 fi
7
8 echo "$WX_TEMP_DIR"
9
10 START_DIR="$PWD"
11 SCRIPTDIR=${START_DIR}/scripts
12 WX_WEB_DIR=$WX_TEMP_DIR/wxWebSite
13 WX_SRC_DIR=$WX_TEMP_DIR/wxWidgets
14
15 CURDATE=`date -I`
16
17 # first, grab the latest revision with specified tag
18 if [ ! -d $WX_TEMP_DIR ]; then
19 mkdir $WX_TEMP_DIR
20 fi
21
22 cd $WX_TEMP_DIR
23
24 # just do an update if we started a build but it failed somewhere
25 if [ ! -d $WX_WEB_DIR ]; then
26 cvs -d:pserver:anoncvs:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets login
27 echo "Grabbing wxWebSite sources..."
28 cvs -d:pserver:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets checkout wxWebSite
29 else
30 cd $WX_WEB_DIR
31 cvs update -d
32 fi
33
34 if [ ! -d $WX_SRC_DIR ]; then
35 cvs -d:pserver:anoncvs:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets login
36 echo "Grabbing wx CVS with tag $BUILD_TAG"
37 cvs -d:pserver:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets checkout -r $BUILD_TAG wxWidgets
38 else
39 cd $WX_SRC_DIR
40 cvs update -d
41 fi
42
43 # this is where we will store the wxAll tarball we create
44 if [ ! -d $START_DIR/$DISTDIR ]; then
45 mkdir -p $START_DIR/$DISTDIR
46 fi
47
48 #re-bake the bakefiles
49 if [ $rebake = "yes" ]; then
50 cd $WX_SRC_DIR/build/bakefiles
51 bakefile_gen -d ../../distrib/scripts/Bakefiles.release.bkgen
52 fi
53
54 cd $WX_SRC_DIR
55 if [ ! -d $WX_SRC_DIR/deliver ]; then
56 mkdir $WX_SRC_DIR/deliver
57 fi
58
59 # Now generate the mega tarball with everything. We will push this to our build machines.
60
61 cd $WX_TEMP_DIR
62 export APPDIR=$WX_TEMP_DIR/wxWidgets
63 export WXWIN=$WX_TEMP_DIR/wxWidgets
64 export VERSION=$BUILD_VERSION
65 export SCRIPTDIR=${SCRIPTDIR}
66
67 #remove old files
68 rm -rf $APPDIR/deliver/*
69 rm -rf $START_DIR/$DIST_DIR/*
70
71 tar czf $START_DIR/$DIST_DIR/wxWidgets-snapshot-$BUILD_VERSION.tar.gz `basename $APPDIR`
72
73 #export DESTDIR=$STAGING_DIR
74 cp $SCRIPTDIR/create_archives.sh $APPDIR/distrib/scripts
75 chmod +x $APPDIR/distrib/scripts/create_archives.sh
76 $APPDIR/distrib/scripts/create_archives.sh --all
77
78 # copy all the archives we created to the master machine's deliver directory
79 cp $APPDIR/deliver/*.zip $START_DIR/$DIST_DIR
80 cp $APPDIR/deliver/*.tar.gz $START_DIR/$DIST_DIR
81 cp $APPDIR/deliver/*.tar.bz2 $START_DIR/$DIST_DIR
82
83 echo "Tarballs located at: $START_DIR/$DIST_DIR"
84
85 if [ ! -f $WX_TARBALL ]; then
86 echo "ERROR: wxAll tarball was not created by pre-flight.sh. Build cannot continue."
87 exit 1
88 else
89 cd $START_DIR
90 #cp $WX_TARBALL $STAGING_DIR
91 #cp -r $WX_WEB_DIR $STAGING_DIR
92
93 echo "Pre-flight complete. Ready for takeoff."
94 fi
95
96 if [ "$KIND" = "daily" ]; then
97 ##delete old files and then copy new ones, add a symlink
98 find ${FTPDIR}/files -type f -name wx\* -mtime +6 | xargs rm -rf
99 cp $START_DIR/$DIST_DIR/wx* ${FTPDIR}/files
100
101 rm -f ${FTPDIR}/wx* ${FTPDIR}/MD5SUM
102 for f in `find ${FTPDIR}/files -type f -name wx\* -mmin -601` ; do
103 ln -s $f `echo $f | sed -e "s/-${CURDATE}//" | sed -e "s|/files||" `
104 done
105 else
106 ## not a daily build
107 ##get install.txt files etc
108 ##.../docs/plat/install.txt goes to install-plat-2.7.0.txt
109 ## wince has a file down one dir
110 cp ${DOCDIR}/changes.txt $START_DIR/$DIST_DIR/changes-${BUILD_VERSION}.txt
111
112 for f in `find ${DOCDIR} -name install.txt` ; do
113 cp $f $START_DIR/$DIST_DIR/install-`echo $f | sed -e "s|${DOCDIR}||g" | sed -e "s|/install.txt||g"`-${BUILD_VERSION}.txt
114 done
115
116 for g in `find ${DOCDIR} -name readme.txt` ; do
117 cp $g $START_DIR/$DIST_DIR/readme-`echo $g | sed -e "s|${DOCDIR}||g" | sed -e "s|msw/wince|wince|g" | sed -e "s|/readme.txt||g"`-${BUILD_VERSION}.txt
118 done
119 ## copy files ...
120 mkdir ${FTPDIR}/
121 cp $START_DIR/$DIST_DIR/* ${FTPDIR}/
122
123 fi
124
125 md5sum ${FTPDIR}/wx* > ${FTPDIR}/MD5SUM
126
127 ## make sure updated at is really last
128 sleep 10
129 echo cvs checkout done at date -u > ${FTPDIR}/updated_at.txt
130
131 echo "Delivery complete. Flying."