snapshot 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #! /bin/sh
  2. # This scipt assumes that you have anonCVS for nagios and nagiosplug
  3. # in ${IN}
  4. # cvs -d:pserver:anonymous@cvs.nagiosplug.sourceforge.net:/cvsroot/nagiosplug login
  5. # cvs -z3 -d:pserver:anonymous@cvs.nagiosplug.sourceforge.net:/cvsroot/nagiosplug co nagiosplug
  6. #
  7. # cvs -d:pserver:anonymous@cvs.nagios.sourceforge.net:/cvsroot/nagios login
  8. # cvs -z3 -d:pserver:anonymous@cvs.nagios.sourceforge.net:/cvsroot/nagios co nagios
  9. # Set directories
  10. IN=${HOME}/sf
  11. OUT=/col/htdocs/src/nagios
  12. RPM_TOPDIR=${HOME}/redhat
  13. # Update nagiosplug CVS
  14. cd ${IN}/nagiosplug
  15. rm configure configure.in Makefile.in
  16. cvs update
  17. DS=`date -u +%Y%m%d%H%M`
  18. sed "s/^VER=.*/VER=${DS}/;s/^REL=.*/REL=snapshot/" configure.in > configure.tmp
  19. mv configure.tmp configure.in
  20. aclocal
  21. autoheader
  22. autoconf
  23. automake
  24. autoreconf
  25. # Make the Nagiosplug dist tarball
  26. rm -r build-dist
  27. mkdir build-dist
  28. cd build-dist
  29. ../configure
  30. make dist
  31. cp -fv *.gz ${OUT}
  32. # Make the Nagiosplug custom RPM
  33. echo "%_topdir ${RPM_TOPDIR}" > ./.rpmrc
  34. mkdir -p ${RPM_TOPDIR}/RPMS/i386 ${RPM_TOPDIR}/SRPMS ${RPM_TOPDIR}/SOURCES ${RPM_TOPDIR}/BUILD ${RPM_TOPDIR}/SPECS
  35. rpm --rcfile "/usr/lib/rpm/rpmrc:${IN}/rpmrc" --define 'custom 1' -ta *.gz
  36. cp -fv ~/redhat/RPMS/i386/nagios-plugins-custom-*.i386.rpm /col/htdocs/src/nagios
  37. # Copy the new snapshot and delete the old ones
  38. cd ${OUT}
  39. GLOBIGNORE=nagios-plugins-${DS}-snapshot.tar.gz
  40. rm -f nagios-plugins-*.tar.gz
  41. GLOBIGNORE=nagios-plugins-custom-${DS}-snapshot.i386.rpm
  42. rm -f nagios-plugins-custom-*-snapshot.i386.rpm
  43. cd ~/redhat/SRPMS
  44. rm nagios-plugins-custom-${DS}-snapshot.src.rpm
  45. cd ~/redhat/RPMS/i386
  46. rm nagios-plugins-custom-${DS}-snapshot.i386.rpm
  47. # Update Nagios CVS
  48. cd ${IN}/sf/nagios
  49. rm configure configure.in nagios.spec base/nagios.c common/common.h \
  50. html/main.html Makefile.in
  51. cvs update
  52. # Make the Nagios tarball
  53. DS=`date -u +%Y%m%d%H%M`
  54. ./make-tarball ${DS}
  55. # Copy the new snapshot and delete the old ones
  56. mv ../nagios-${DS}.tar.gz /col/htdocs/src/nagios/
  57. GLOBIGNORE=${OUT}/nagios-${DS}.tar.gz
  58. rm ${OUT}/nagios-20*.tar.gz