| 1 | #!/bin/sh |
| 2 | # tardist: make up a tar.gz distribution of wxWidgets 2 |
| 3 | # Supply a source (e.g. ~/wx2) and destination (e.g. ~/wx2/deliver) |
| 4 | |
| 5 | # We can't use e.g. this: |
| 6 | # ls `cat $SRC/distrib/msw/makefile.rsp` zip -@ -u $DEST/wxWidgets-$VERSION-gen.zip |
| 7 | # because there's not enough space on the command line, plus we need to ignore the |
| 8 | # blank lines. |
| 9 | |
| 10 | PROGNAME=$0 |
| 11 | WXSRC=$1 |
| 12 | WXDEST=$2 |
| 13 | WXVER=$3 |
| 14 | |
| 15 | # for docopyreadmefiles and docopysetup_h |
| 16 | SCRIPTDIR=$WXSRC/distrib/scripts |
| 17 | . $SCRIPTDIR/utils.inc |
| 18 | |
| 19 | TAR=tar |
| 20 | ARCH=`arch` |
| 21 | if [ "$ARCH" = "ppc" ]; then |
| 22 | TAR=gnutar |
| 23 | fi |
| 24 | |
| 25 | expandlines() |
| 26 | { |
| 27 | toexpand=$1 |
| 28 | outputfile=$2 |
| 29 | |
| 30 | rm -f $outputfile |
| 31 | touch $outputfile |
| 32 | for line in `cat $toexpand` ; do |
| 33 | if [ "$line" != "" ]; then |
| 34 | ls $line >> $outputfile |
| 35 | fi |
| 36 | uniq < $outputfile > /tmp/uniqtemp.txt |
| 37 | mv /tmp/uniqtemp.txt $outputfile |
| 38 | done |
| 39 | } |
| 40 | |
| 41 | doinit() |
| 42 | { |
| 43 | cd $WXSRC |
| 44 | echo Removing backup files... |
| 45 | rm *~ */*~ */*/*~ */*/*/*~ */*/*/*/*~ |
| 46 | |
| 47 | rm -f $WXDEST/wx*-${WXVER}*.tar.gz |
| 48 | # Copy setup files |
| 49 | cp $WXSRC/include/wx/msw/setup0.h $WXSRC/include/wx/msw/setup.h |
| 50 | cp $WXSRC/include/wx/univ/setup0.h $WXSRC/include/wx/univ/setup.h |
| 51 | |
| 52 | # Copy readme and other files |
| 53 | docopydocs $WXSRC $WXDEST |
| 54 | |
| 55 | # Make .mo files |
| 56 | cd $WXSRC/locale |
| 57 | make allmo |
| 58 | } |
| 59 | |
| 60 | dospinwxmac() |
| 61 | { |
| 62 | echo Tarring wxMac... |
| 63 | ### wxMac |
| 64 | cp $WXSRC/include/wx/mac/setup0.h $WXSRC/include/wx/setup.h |
| 65 | cp $WXSRC/include/wx/mac/setup0.h $WXSRC/include/wx/mac/setup.h |
| 66 | cd $WXSRC |
| 67 | cat $SCRIPTDIR/manifests/mac.rsp \ |
| 68 | $SCRIPTDIR/manifests/cocoa.rsp \ |
| 69 | $SCRIPTDIR/manifests/generic.rsp \ |
| 70 | $SCRIPTDIR/manifests/generic_samples.rsp \ |
| 71 | $SCRIPTDIR/manifests/cw_mac.rsp \ |
| 72 | $SCRIPTDIR/manifests/tex2rtf.rsp \ |
| 73 | $SCRIPTDIR/manifests/utils.rsp \ |
| 74 | $SCRIPTDIR/manifests/xml.rsp \ |
| 75 | $SCRIPTDIR/manifests/makefile.rsp \ |
| 76 | $SCRIPTDIR/manifests/tiff.rsp \ |
| 77 | $SCRIPTDIR/manifests/jpeg.rsp \ |
| 78 | > /tmp/wxmac_in.txt |
| 79 | expandlines /tmp/wxmac_in.txt /tmp/wxmac.txt |
| 80 | $TAR cf $WXDEST/wxMac-${WXVER}.tar -T /tmp/wxmac.txt |
| 81 | |
| 82 | rm -f $WXSRC/include/wx/setup.h |
| 83 | |
| 84 | echo Re-tarring wxMac in a subdirectory... |
| 85 | cd $WXDEST |
| 86 | mkdir wxMac-${WXVER} |
| 87 | cd wxMac-${WXVER} |
| 88 | |
| 89 | $TAR xf ../wxMac-${WXVER}.tar |
| 90 | echo Copying readme files... |
| 91 | cp $WXSRC/docs/mac/readme.txt README-MAC.txt |
| 92 | cp $WXSRC/docs/mac/install.txt INSTALL-MAC.txt |
| 93 | |
| 94 | cd .. |
| 95 | rm -f wxMac-${WXVER}.tar |
| 96 | $TAR cf $WXDEST/wxMac-${WXVER}.tar wxMac-${WXVER}/* |
| 97 | rm -f -r wxMac-${WXVER} |
| 98 | gzip $WXDEST/wxMac-${WXVER}.tar |
| 99 | } |
| 100 | |
| 101 | ### wxUniv: universal-specific files |
| 102 | #cd $WXSRC |
| 103 | #cat $SCRIPTDIR/manifests/univ.rsp > /tmp/wxuniv_in.txt |
| 104 | #expandlines /tmp/wxuniv_in.txt /tmp/wxuniv.txt |
| 105 | #$TAR cf $WXDEST/wxWidgets-${WXVER}-Univ.tar -T /tmp/wxuniv.txt |
| 106 | # |
| 107 | #echo Re-tarring wxUniversal in a subdirectory... |
| 108 | #cd $WXDEST |
| 109 | #mkdir wxWidgets-${WXVER} |
| 110 | #cd wxWidgets-${WXVER} |
| 111 | #$TAR xf ../wxWidgets-${WXVER}-Univ.tar |
| 112 | #cd .. |
| 113 | #rm -f wxWidgets-${WXVER}-Univ.tar |
| 114 | #$TAR cf $WXDEST/wxWidgets-${WXVER}-Univ.tar wxWidgets-${WXVER}/* |
| 115 | #rm -f -r wxWidgets-${WXVER} |
| 116 | #gzip $WXDEST/wxWidgets-${WXVER}-Univ.tar |
| 117 | |
| 118 | dospinwxall() |
| 119 | { |
| 120 | echo Tarring wxAll... |
| 121 | |
| 122 | ### wxAll: all distributions in one giant archive |
| 123 | cd $WXSRC |
| 124 | cat $SCRIPTDIR/manifests/generic.rsp \ |
| 125 | $SCRIPTDIR/manifests/generic_samples.rsp \ |
| 126 | $SCRIPTDIR/manifests/msw.rsp \ |
| 127 | $SCRIPTDIR/manifests/wince.rsp \ |
| 128 | $SCRIPTDIR/manifests/vc.rsp \ |
| 129 | $SCRIPTDIR/manifests/cw.rsp \ |
| 130 | $SCRIPTDIR/manifests/cw_mac.rsp \ |
| 131 | $SCRIPTDIR/manifests/gtk.rsp \ |
| 132 | $SCRIPTDIR/manifests/x11.rsp \ |
| 133 | $SCRIPTDIR/manifests/motif.rsp \ |
| 134 | $SCRIPTDIR/manifests/mac.rsp \ |
| 135 | $SCRIPTDIR/manifests/cocoa.rsp \ |
| 136 | $SCRIPTDIR/manifests/os2.rsp \ |
| 137 | $SCRIPTDIR/manifests/palmos.rsp \ |
| 138 | $SCRIPTDIR/manifests/x11.rsp \ |
| 139 | $SCRIPTDIR/manifests/univ.rsp \ |
| 140 | $SCRIPTDIR/manifests/mgl.rsp \ |
| 141 | $SCRIPTDIR/manifests/dfb.rsp \ |
| 142 | $SCRIPTDIR/manifests/utilmake.rsp \ |
| 143 | $SCRIPTDIR/manifests/utils.rsp \ |
| 144 | $SCRIPTDIR/manifests/tex2rtf.rsp \ |
| 145 | $SCRIPTDIR/manifests/xml.rsp \ |
| 146 | $SCRIPTDIR/manifests/makefile.rsp \ |
| 147 | $SCRIPTDIR/manifests/tiff.rsp \ |
| 148 | $SCRIPTDIR/manifests/jpeg.rsp \ |
| 149 | $SCRIPTDIR/manifests/docsrc.rsp \ |
| 150 | | uniq > /tmp/wxall_in.txt |
| 151 | expandlines /tmp/wxall_in.txt /tmp/wxall.txt |
| 152 | $TAR cf $WXDEST/wxWidgets-${WXVER}.tar -T /tmp/wxall.txt |
| 153 | |
| 154 | echo Re-tarring wxAll in a subdirectory... |
| 155 | cd $WXDEST |
| 156 | mkdir wxWidgets-${WXVER} |
| 157 | |
| 158 | cd wxWidgets-${WXVER} |
| 159 | |
| 160 | # If we have the full set of VC++ project files, |
| 161 | # get them |
| 162 | if [ -f $WXDEST/extra/wxWidgets-${WXVER}-VC.zip ]; then |
| 163 | unzip -o $WXDEST/extra/wxWidgets-${WXVER}-VC.zip |
| 164 | else |
| 165 | echo "Warning - did not find $WXDEST/deliver/extra/wxWidgets-${WXVER}-VC.zip" |
| 166 | fi |
| 167 | |
| 168 | # If we have the full set of eVC++ project files, |
| 169 | # get them |
| 170 | if [ -f $WXDEST/extra/wxWidgets-${WXVER}-eVC.zip ]; then |
| 171 | unzip -o $WXDEST/extra/wxWidgets-${WXVER}-eVC.zip |
| 172 | else |
| 173 | echo "Warning - did not find $WXDEST/deliver/extra/wxWidgets-${WXVER}-eVC.zip" |
| 174 | fi |
| 175 | |
| 176 | # If we have the full set of DMC project files, |
| 177 | # get them |
| 178 | if [ -f $WXDEST/extra/wxWidgets-${WXVER}-DMC.zip ]; then |
| 179 | unzip -o $WXDEST/extra/wxWidgets-${WXVER}-DMC.zip |
| 180 | else |
| 181 | echo "Warning - did not find $WXDEST/deliver/extra/wxWidgets-${WXVER}-DMC.zip" |
| 182 | fi |
| 183 | |
| 184 | $TAR xf ../wxWidgets-${WXVER}.tar |
| 185 | |
| 186 | # Translate all .dsp and .dsw files to DOS format |
| 187 | unix2dos --unix2dos `cat $SCRIPTDIR/manifests/vc.rsp` |
| 188 | |
| 189 | cd .. |
| 190 | rm -f wxWidgets-${WXVER}.tar |
| 191 | $TAR cf $WXDEST/wxWidgets-${WXVER}.tar wxWidgets-${WXVER}/* |
| 192 | rm -f -r wxWidgets-${WXVER} |
| 193 | gzip -c $WXDEST/wxWidgets-${WXVER}.tar > $WXDEST/wxWidgets-${WXVER}.tar.gz |
| 194 | bzip2 $WXDEST/wxWidgets-${WXVER}.tar |
| 195 | } |
| 196 | |
| 197 | domakedocs() |
| 198 | { |
| 199 | mkdir -p $WXSRC/docs/html/wx |
| 200 | mkdir -p $WXSRC/docs/html/tex2rtf |
| 201 | mkdir -p $WXSRC/docs/html/fl |
| 202 | mkdir -p $WXSRC/docs/html/ogl |
| 203 | mkdir -p $WXSRC/docs/htb |
| 204 | |
| 205 | rm -f -r $WXSRC/docs/html/wx/*.htm* |
| 206 | rm -f -r $WXSRC/docs/htb/wx.htb |
| 207 | |
| 208 | echo Making HTML wxWidgets manual... |
| 209 | cd $WXSRC/docs/latex/wx |
| 210 | cp *.gif $WXSRC/docs/html/wx |
| 211 | tex2rtf manual.tex $WXSRC/docs/html/wx/wx.htm -twice -html |
| 212 | |
| 213 | echo Making HTB wxWidgets manual... |
| 214 | cd $WXSRC/docs/html/wx |
| 215 | zip -q $WXSRC/docs/htb/wx.htb *.html *.gif *.hhp *.hhc *.hhk |
| 216 | |
| 217 | echo Done making manuals. |
| 218 | } |
| 219 | |
| 220 | init="" |
| 221 | if [ "$1" = "" ] |
| 222 | then |
| 223 | echo Usage: tardist wx-dir output-dir version |
| 224 | exit |
| 225 | fi |
| 226 | |
| 227 | if [ "$2" = "" ] |
| 228 | then |
| 229 | echo Usage: tardist wx-dir output-dir version |
| 230 | exit |
| 231 | fi |
| 232 | |
| 233 | if [ "$3" = "" ] |
| 234 | then |
| 235 | echo Usage: tardist wx-dir output-dir version |
| 236 | exit |
| 237 | fi |
| 238 | |
| 239 | SPINWXALL=0 |
| 240 | SPINWXMAC=0 |
| 241 | SPINEVERYTHING=0 |
| 242 | SILENT=0 |
| 243 | |
| 244 | usage() |
| 245 | { |
| 246 | echo Usage: $PROGNAME "src-dir dest-dir version-number [ options ]" |
| 247 | echo Options: |
| 248 | echo " --help Display this help message" |
| 249 | echo " --wxall Spin wxAll" |
| 250 | echo " --wxmac Spin wxMac" |
| 251 | echo " --all Spin EVERYTHING" |
| 252 | echo " --silent Don't ask for confirmation before running" |
| 253 | |
| 254 | exit 1 |
| 255 | } |
| 256 | |
| 257 | # Process command line options. |
| 258 | shift 3 |
| 259 | for i in "$@"; do |
| 260 | case "$i" in |
| 261 | --wxall) SPINWXALL=1 ;; |
| 262 | --wxmac) SPINWXMAC=1 ;; |
| 263 | --all) SPINEVERYTHING=1 ;; |
| 264 | --silent) SILENT=1 ;; |
| 265 | *) |
| 266 | usage |
| 267 | exit |
| 268 | ;; |
| 269 | esac |
| 270 | done |
| 271 | |
| 272 | if [ "$SILENT" = "0" ]; then |
| 273 | echo About to archive wxWidgets: |
| 274 | echo From $WXSRC |
| 275 | echo To $WXDEST |
| 276 | echo Version $WXVER |
| 277 | echo CTRL-C if this is not correct. |
| 278 | read dummy |
| 279 | fi |
| 280 | |
| 281 | doinit |
| 282 | |
| 283 | if [ "$SPINWXMAC" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then |
| 284 | dospinwxmac |
| 285 | fi |
| 286 | |
| 287 | if [ "$SPINWXALL" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then |
| 288 | dospinwxall |
| 289 | fi |
| 290 | |