5 |
# Normally run as "buildrobot" |
# Normally run as "buildrobot" |
6 |
# Requires CVS/SSH access to cvs.sourceforge.net:/cvsroot/smeserver |
# Requires CVS/SSH access to cvs.sourceforge.net:/cvsroot/smeserver |
7 |
|
|
8 |
PATH=/builds/bin:$PATH |
umask 002 |
|
export PATH |
|
9 |
|
|
10 |
cd ~/work |
PATH=~/bin:$PATH |
11 |
|
export PATH |
12 |
|
|
13 |
for package in $(cat modules) |
check_package() |
14 |
do |
{ |
15 |
|
for NVR in $(rpm -q --qf "%{NAME}-%{VERSION}-%{RELEASE}\n" --specfile $SPEC) |
16 |
|
do |
17 |
|
SRPM=/builds/rpms/SRPMS/$NVR.src.rpm |
18 |
|
if [ -f $SRPM ] |
19 |
|
then |
20 |
|
echo "$SRPM already exists" |
21 |
|
return |
22 |
|
fi |
23 |
|
done |
24 |
|
|
25 |
case $package in |
case $package in |
26 |
SMEServer) continue ;; |
openssl) |
27 |
builds_bin) continue ;; |
build_package "--arch i386,i586,i686" |
28 |
cdrom.image) continue ;; |
;; |
29 |
e-smith-qpsmtpd) continue ;; |
kmod-*) |
30 |
e-smith-spamassassin) continue ;; |
build_package "--arch i586,i686" |
31 |
isolinux) continue ;; |
;; |
32 |
|
*) |
33 |
|
build_package |
34 |
|
;; |
35 |
|
esac |
36 |
|
} |
37 |
|
|
38 |
|
build_package() |
39 |
|
{ |
40 |
|
if LANG=en_US mzbuild $1 --specfile $SPEC >> $LOG 2>&1 |
41 |
|
then |
42 |
|
release_rpms *.rpm |
43 |
|
else |
44 |
|
echo "Build of $package failed - check $LOG" |
45 |
|
fi |
46 |
|
} |
47 |
|
|
48 |
grub) echo "Not building $package" |
for package in $(ls /builds/cvsroot/smeserver | grep "^$1.*$") |
49 |
|
do |
50 |
|
case $package in |
51 |
|
CVSROOT|anaconda|booty|builds_bin|cdrom.image|devguide|isolinux) |
52 |
continue |
continue |
53 |
;; |
;; |
|
|
|
|
*) ;; |
|
54 |
esac |
esac |
55 |
|
|
56 |
echo -n "Checking $package "; date |
LOG=$HOME/logs/$package.log |
57 |
|
> $LOG |
58 |
|
|
59 |
[ -d $package ] || mzget $package |
echo -n "Checking $package "; date |
60 |
|
(echo -n "Checking $package "; date) >> $LOG |
61 |
cd $package |
echo ========================================================== >> $LOG |
|
|
|
|
LOG=$package.log |
|
|
mzclean >$LOG 2>&1 |
|
|
|
|
|
SPEC=$(echo F/*.spec) # XXX - FIXME - only one SPEC file |
|
|
|
|
|
if [ ! -f $SPEC ] |
|
|
then |
|
|
echo "Sorry - can't find $SPEC" |
|
|
continue |
|
|
fi |
|
62 |
|
|
63 |
NVR=$(rpm -q --qf "%{NAME}-%{VERSION}-%{RELEASE}" --specfile $SPEC) |
cd ~/work |
64 |
|
rm -rf ~/work/$package |
65 |
|
mzget --dir /builds/cvsroot/smeserver $package >> $LOG |
66 |
|
|
67 |
SRPM=/builds/rpms/SRPMS/$NVR.src.rpm |
cd ~/work/$package |
68 |
|
|
69 |
if [ -f $SRPM ] |
SPEC=$(ls F/*.spec 2> /dev/null | tail -1) |
70 |
|
if [ -z "$SPEC" ] |
71 |
then |
then |
72 |
echo "$SRPM already exists" |
echo "Not building $package (No SPEC file)" |
73 |
|
rm -f $LOG |
74 |
continue |
continue |
|
fi |
|
|
|
|
|
if mzbuild >>$LOG 2>&1 |
|
|
then |
|
|
: |
|
75 |
else |
else |
76 |
echo "Build of $package failed - check $LOG" |
TAGS=$(cvs status -v $SPEC | awk '/\(branch:/ && !/\(branch: 1\.1\.1\)/ { print $1 }' | sort -u) |
77 |
fi |
fi |
78 |
|
check_package |
79 |
|
|
80 |
cd ~/work |
for tag in $TAGS |
81 |
|
do |
82 |
|
echo >> $LOG |
83 |
|
|
84 |
|
echo -n "Checking $package ($tag) "; date |
85 |
|
(echo -n "Checking $package ($tag) "; date) >> $LOG |
86 |
|
echo ========================================================== >> $LOG |
87 |
|
cd ~/work |
88 |
|
rm -rf ~/work/$package |
89 |
|
mzget --dir /builds/cvsroot/smeserver --tag $tag $package >> $LOG |
90 |
|
|
91 |
|
cd ~/work/$package |
92 |
|
|
93 |
|
SPEC=$(ls F/*.spec 2> /dev/null | tail -1) |
94 |
|
if [ -z "$SPEC" ] |
95 |
|
then |
96 |
|
echo "Not building $package (No SPEC file)" |
97 |
|
continue |
98 |
|
fi |
99 |
|
check_package |
100 |
|
done |
101 |
done |
done |