1 |
#!/bin/sh |
#!/bin/bash |
2 |
|
# Build all locally maintained packages from CVS |
3 |
|
# Check whether anything is new and let us know if there is |
4 |
|
|
5 |
cd /mirrors/mitel/devel/repo/SRPMS |
# Normally run as "buildrobot" |
6 |
|
# Requires CVS/SSH access to cvs.sourceforge.net:/cvsroot/smeserver |
7 |
|
|
8 |
FAILED="" |
PATH=/builds/bin:$PATH |
9 |
|
export PATH |
10 |
|
|
11 |
for file in e-smith* |
cd ~/work |
12 |
|
|
13 |
|
for package in $(cat modules) |
14 |
do |
do |
15 |
if [ -f /builds/rpms/SRPMS/$file ] |
|
16 |
|
case $package in |
17 |
|
SMEServer) continue ;; |
18 |
|
builds_bin) continue ;; |
19 |
|
cdrom.image) continue ;; |
20 |
|
e-smith-qpsmtpd) continue ;; |
21 |
|
e-smith-spamassassin) continue ;; |
22 |
|
isolinux) continue ;; |
23 |
|
|
24 |
|
grub) echo "Not building $package" |
25 |
|
continue |
26 |
|
;; |
27 |
|
|
28 |
|
*) ;; |
29 |
|
esac |
30 |
|
|
31 |
|
echo -n "Checking $package "; date |
32 |
|
|
33 |
|
[ -d $package ] || mzget $package |
34 |
|
|
35 |
|
cd $package |
36 |
|
|
37 |
|
LOG=$package.log |
38 |
|
mzclean >$LOG 2>&1 |
39 |
|
|
40 |
|
SPEC=$(echo F/*.spec) # XXX - FIXME - only one SPEC file |
41 |
|
|
42 |
|
if [ ! -f $SPEC ] |
43 |
then |
then |
44 |
echo "Already built: $file" |
echo "Sorry - can't find $SPEC" |
45 |
continue |
continue |
46 |
fi |
fi |
47 |
|
|
48 |
echo "Building: $file" |
NVR=$(rpm -q --qf "%{NAME}-%{VERSION}-%{RELEASE}" --specfile $SPEC) |
49 |
if rpmbuild --rebuild $file |
|
50 |
|
SRPM=/builds/rpms/SRPMS/$NVR.src.rpm |
51 |
|
|
52 |
|
if [ -f $SRPM ] |
53 |
|
then |
54 |
|
echo "$SRPM already exists" |
55 |
|
continue |
56 |
|
fi |
57 |
|
|
58 |
|
if mzbuild >>$LOG 2>&1 |
59 |
then |
then |
60 |
cp -p $file /builds/rpms/SRPMS |
: |
61 |
else |
else |
62 |
echo "FAILED: $file" |
echo "Build of $package failed - check $LOG" |
|
FAILED="$FAILED $file" |
|
63 |
fi |
fi |
|
done |
|
64 |
|
|
65 |
echo "Failed to build: $FAILED" |
cd ~/work |
66 |
|
done |