checking in RPM build system
[freeside.git] / rpm / build / cvs-check-and-build
1 #!/bin/sh
2 #
3 # Copyright 2009, Elirion, Inc.  All rights reserved.
4 # This software is licensed under the same terms as Freeside itself.
5 #
6 # This script wraps other scripts in the build system.  It does a CVS comparison on the vserver
7 # to determine if the CVS contents have changed.  If so, an SRPM is built.  The script then invokes
8 # the local build script which pulls down this SRPM and uses mock to build binary RPMs for the
9 # default targets.  Finally, the repository is updated.
10 #
11 # There's currently no testing for failure.
12
13 FORCE_FLAG=
14 QUIET_FLAG=
15
16 usage() {
17         echo "cvs-check-and-build: check Freeside CVS and build RPMs if changed"
18         echo "where:"
19         echo " -f: force SRPM rebuild even if CVS contents have not changed"
20         echo " -h: print this help message"
21         echo " -q: run yum-arch and createrepo in quiet mode"
22         exit 0
23 }
24
25 while getopts "fhq" flag
26 do
27         case $flag in
28                 f)
29                         echo "Force mode"
30                         FORCE_FLAG=-f;;
31                 q)
32                         echo "Quiet mode"
33                         QUIET_FLAG=-q;;
34                 *)
35                         usage;;
36         esac
37 done
38
39 ssh 10.5.4.5 /home/rsiddall/build-from-cvs $FORCE_FLAG
40 cd /home/rsiddall/buildsys; ./build-freeside; ./refresh-repo $QUIET_FLAG
41