rebuild-makefiles.sh 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. #!/bin/sh
  2. CURDATE=`date -I`
  3. WORKDIR=/home/bake/bkl-cronjob
  4. WINSRCDIR=/mnt/daily
  5. FTPDIR=/home/ftp/pub
  6. LD_LIBRARY_PATH=/usr/local/lib
  7. update_from_svn()
  8. {
  9. (
  10. cd ${WORKDIR}/wxWidgets
  11. svn up
  12. find . -name \.#\* | xargs rm -rf
  13. )
  14. }
  15. regenerate_makefiles()
  16. {
  17. (cd ${WORKDIR}/wxWidgets/build/bakefiles && nice python -O /usr/local/bin/bakefile_gen)
  18. }
  19. do_package()
  20. {
  21. archtype=$1
  22. format=$2
  23. shift ; shift
  24. rm -f ${WORKDIR}/archives/wx-mk-${format}-*
  25. cd ${WORKDIR}/wxWidgets
  26. files=""
  27. for i in $* ; do
  28. files="$files `find -name "$i"`"
  29. done
  30. if test $archtype = tar ; then
  31. tar czf ../archives/wx-mk-${format}-${CURDATE}.tar.gz $files
  32. elif test $archtype = zip ; then
  33. ### zip -l -q -9 ../archives/wx-mk-${format}-${CURDATE}.zip $files
  34. zip -q -9 ../archives/wx-mk-${format}-${CURDATE}.zip $files
  35. fi
  36. cd ..
  37. }
  38. package_makefiles()
  39. {
  40. do_package tar autoconf Makefile.in autoconf_inc.m4
  41. do_package zip gnu makefile.unx
  42. do_package tar gnu makefile.unx
  43. do_package zip mingw makefile.gcc config.gcc
  44. do_package zip dmars makefile.dmc config.dmc makefile.dms config.dms
  45. do_package zip watcom_msw makefile.wat config.wat
  46. do_package zip msvc makefile.vc config.vc
  47. do_package zip msvc6prj '*.dsp' '*.dsw'
  48. do_package zip msvc7-8prj '*.vcproj' '*.sln'
  49. do_package zip evcprj '*.vcp' '*.vcw'
  50. (cd ${WORKDIR}/wxWidgets/build/bakefiles && nice python -O /usr/local/bin/bakefile_gen -f watcom -d ../os2/Bakefiles.os2.bkgen)
  51. do_package zip watcom_os2 makefile.wat config.wat
  52. }
  53. copy_files ()
  54. {
  55. ##delete old files and then copy new ones, add a symlink
  56. ## Makefiles
  57. find ${FTPDIR}/Daily_Makefiles/files -type f -name wx-mk\* -mtime +3 | xargs rm -rf
  58. cp ${WORKDIR}/archives/wx-mk-* ${FTPDIR}/Daily_Makefiles/files
  59. rm -f ${FTPDIR}/Daily_Makefiles/wx* ${FTPDIR}/Daily_Makefiles/MD5SUM
  60. ##there must be an easier way of doing these links...
  61. for f in `find ${FTPDIR}/Daily_Makefiles/files -type f -name wx-mk\* -mmin -601` ; do
  62. ln -s $f `echo $f | sed -e "s/-${CURDATE}//" | sed -e "s|/files||" `
  63. done
  64. md5sum ${FTPDIR}/Daily_Makefiles/wx* > ${FTPDIR}/Daily_Makefiles/MD5SUM
  65. sleep 10
  66. echo CVS Makefiles generated from bakefiles last updated at `date -u` > ${FTPDIR}/Daily_Makefiles/updated_at.txt
  67. ## Setup.exe
  68. find ${FTPDIR}/Daily_HEAD/files -type f -name wx\* -mtime +3 | xargs rm -rf
  69. cp ${WORKDIR}/archives/win/*.exe ${FTPDIR}/Daily_HEAD/files
  70. rm -f ${FTPDIR}/Daily_HEAD/*.exe ${FTPDIR}/Daily_HEAD/MD5SUM
  71. ##there must be an easier way of doing these links...
  72. for f in `find ${FTPDIR}/Daily_HEAD/files -type f -name wx\*.exe -mmin -601` ; do
  73. ln -s $f `echo $f | sed -e "s/-${CURDATE}//" | sed -e "s|/files||" `
  74. done
  75. md5sum ${FTPDIR}/Daily_HEAD/wx* > ${FTPDIR}/Daily_HEAD/MD5SUM
  76. sleep 10
  77. echo CVS HEAD last updated at `date -u` > ${FTPDIR}/Daily_HEAD/updated_at.txt
  78. }
  79. add_win_files ()
  80. {
  81. ### starts with wx***.zip
  82. for f in `find ${WINSRCDIR}/ -maxdepth 1 -name wx\*.zip ` ; do
  83. cp $f ${WORKDIR}/archives/win/`basename $f | sed -e "s/.zip//"`-${CURDATE}.zip
  84. done
  85. for f in `find ${WINSRCDIR}/ -maxdepth 1 -name wx\*.exe ` ; do
  86. cp $f ${WORKDIR}/archives/win/`basename $f | sed -e "s/.exe//"`-${CURDATE}.exe
  87. done
  88. }
  89. update_from_svn
  90. regenerate_makefiles
  91. package_makefiles
  92. add_win_files
  93. copy_files
  94. exit 0