Code

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