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 |
|
|
19 |
|
e-smith*) ;; |
20 |
|
|
21 |
|
smeserver*) ;; |
22 |
|
|
23 |
|
|
24 |
|
*) echo -n "Skipping $package "; date |
25 |
|
continue |
26 |
|
;; |
27 |
|
esac |
28 |
|
|
29 |
|
echo -n "Checking $package "; date |
30 |
|
|
31 |
|
[ -d $package ] || mzget $package |
32 |
|
|
33 |
|
cd $package |
34 |
|
|
35 |
|
LOG=$package.log |
36 |
|
mzclean >>$LOG 2>&1 |
37 |
|
|
38 |
|
SPEC=$(echo F/*.spec) # XXX - FIXME - only one SPEC file |
39 |
|
|
40 |
|
if [ ! -f $SPEC ] |
41 |
then |
then |
42 |
echo "Already built: $file" |
echo "Sorry - can't find $SPEC" |
43 |
continue |
continue |
44 |
fi |
fi |
45 |
|
|
46 |
echo "Building: $file" |
NVR=$(rpm -q --qf "%{NAME}-%{VERSION}-%{RELEASE}" --specfile $SPEC) |
47 |
if rpmbuild --rebuild $file |
|
48 |
|
SRPM=/builds/rpms/SRPMS/$NVR.src.rpm |
49 |
|
|
50 |
|
if [ -f $SRPM ] |
51 |
then |
then |
52 |
cp -p $file /builds/rpms/SRPMS |
echo "$SRPM already exists" |
53 |
|
continue |
54 |
|
fi |
55 |
|
|
56 |
|
if mzbuild >>$LOG 2>&1 |
57 |
|
then |
58 |
|
release_rpms *.rpm |
59 |
else |
else |
60 |
echo "FAILED: $file" |
echo "Build of $package failed - check $LOG" |
|
FAILED="$FAILED $file" |
|
61 |
fi |
fi |
|
done |
|
62 |
|
|
63 |
echo "Failed to build: $FAILED" |
cd ~/work |
64 |
|
done |