#!/bin/bash # Build all locally maintained packages from CVS # Check whether anything is new and let us know if there is # Normally run as "buildrobot" # Requires CVS/SSH access to cvs.sourceforge.net:/cvsroot/smeserver umask 002 PATH=~/bin:$PATH export PATH check_package() { for NVR in $(rpm -q --qf "%{NAME}-%{VERSION}-%{RELEASE}\n" --specfile $SPEC) do SRPM=/builds/rpms/SRPMS/$NVR.src.rpm if [ -f $SRPM ] then echo "$SRPM already exists" return fi done case $package in openssl) build_package "--arch i386,i586,i686" ;; kmod-*) build_package "--arch i586,i686" ;; *) build_package ;; esac } build_package() { if mzbuild $1 --specfile $SPEC >> $LOG 2>&1 then release_rpms *.rpm else echo "Build of $package failed - check $LOG" fi } for package in $(ls /builds/cvsroot/smeserver | grep "^$1.*$") do case $package in CVSROOT|anaconda|builds_bin|cdrom.image|devguide|isolinux) continue ;; esac LOG=$HOME/logs/$package.log > $LOG echo -n "Checking $package "; date (echo -n "Checking $package "; date) >> $LOG echo ========================================================== >> $LOG cd ~/work rm -rf ~/work/$package mzget --dir /builds/cvsroot/smeserver $package >> $LOG cd ~/work/$package SPEC=$(ls F/*.spec 2> /dev/null | tail -1) if [ -z "$SPEC" ] then echo "Not building $package (No SPEC file)" continue else TAGS=$(cvs status -v $SPEC | awk '/\(revision:/{ print $1 }' | sort -u) fi check_package for tag in $TAGS do echo >> $LOG echo -n "Checking $package ($tag) "; date (echo -n "Checking $package ($tag) "; date) >> $LOG echo ========================================================== >> $LOG cd ~/work rm -rf ~/work/$package mzget --dir /builds/cvsroot/smeserver --tag $tag $package >> $LOG cd ~/work/$package SPEC=$(ls F/*.spec 2> /dev/null | tail -1) if [ -z "$SPEC" ] then echo "Not building $package (No SPEC file)" continue fi check_package done done