1 |
gordonr |
1.2 |
#!/bin/bash |
2 |
|
|
# Build all locally maintained packages from CVS |
3 |
|
|
# Check whether anything is new and let us know if there is |
4 |
gordonr |
1.1 |
|
5 |
gordonr |
1.2 |
# Normally run as "buildrobot" |
6 |
|
|
# Requires CVS/SSH access to cvs.sourceforge.net:/cvsroot/smeserver |
7 |
gordonr |
1.1 |
|
8 |
slords |
1.14 |
umask 002 |
9 |
|
|
|
10 |
|
|
PATH=~/bin:$PATH |
11 |
gordonr |
1.4 |
export PATH |
12 |
|
|
|
13 |
slords |
1.14 |
check_package() |
14 |
|
|
{ |
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 |
26 |
|
|
openssl) |
27 |
|
|
build_package "--arch i386,i586,i686" |
28 |
|
|
;; |
29 |
|
|
kernel-module-*|kmod-*|ipp2p) |
30 |
|
|
build_package "--arch i586,i686" |
31 |
|
|
;; |
32 |
|
|
*) |
33 |
|
|
build_package |
34 |
|
|
;; |
35 |
|
|
esac |
36 |
|
|
} |
37 |
|
|
|
38 |
|
|
build_package() |
39 |
|
|
{ |
40 |
|
|
if 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 |
gordonr |
1.1 |
|
48 |
slords |
1.14 |
for package in $(ls /builds/cvsroot/smeserver | grep "^$1.*$") |
49 |
gordonr |
1.1 |
do |
50 |
gordonr |
1.2 |
case $package in |
51 |
slords |
1.14 |
CVSROOT|anaconda|builds_bin|cdrom.image|devguide|isolinux) |
52 |
gordonr |
1.11 |
continue |
53 |
|
|
;; |
54 |
slords |
1.14 |
esac |
55 |
gordonr |
1.11 |
|
56 |
slords |
1.14 |
LOG=$HOME/logs/$package.log |
57 |
|
|
> $LOG |
58 |
gordonr |
1.2 |
|
59 |
gordonr |
1.6 |
echo -n "Checking $package "; date |
60 |
slords |
1.14 |
(echo -n "Checking $package "; date) >> $LOG |
61 |
|
|
echo ========================================================== >> $LOG |
62 |
gordonr |
1.3 |
|
63 |
slords |
1.14 |
cd ~/work |
64 |
|
|
rm -rf ~/work/$package |
65 |
|
|
mzget --dir /builds/cvsroot/smeserver $package >> $LOG |
66 |
gordonr |
1.2 |
|
67 |
slords |
1.14 |
cd ~/work/$package |
68 |
gordonr |
1.4 |
|
69 |
slords |
1.14 |
SPEC=$(ls F/*.spec 2> /dev/null | tail -1) |
70 |
|
|
if [ -z "$SPEC" ] |
71 |
gordonr |
1.6 |
then |
72 |
slords |
1.14 |
echo "Not building $package (No SPEC file)" |
73 |
gordonr |
1.6 |
continue |
74 |
|
|
else |
75 |
slords |
1.14 |
TAGS=$(cvs status -v $SPEC | awk '/\(revision:/{ print $1 }' | sort -u) |
76 |
gordonr |
1.6 |
fi |
77 |
slords |
1.14 |
check_package |
78 |
gordonr |
1.4 |
|
79 |
slords |
1.14 |
for tag in $TAGS |
80 |
|
|
do |
81 |
|
|
echo >> $LOG |
82 |
|
|
|
83 |
|
|
echo -n "Checking $package ($tag) "; date |
84 |
|
|
(echo -n "Checking $package ($tag) "; date) >> $LOG |
85 |
|
|
echo ========================================================== >> $LOG |
86 |
|
|
cd ~/work |
87 |
|
|
rm -rf ~/work/$package |
88 |
|
|
mzget --dir /builds/cvsroot/smeserver --tag $tag $package >> $LOG |
89 |
|
|
|
90 |
|
|
cd ~/work/$package |
91 |
|
|
|
92 |
|
|
SPEC=$(ls F/*.spec 2> /dev/null | tail -1) |
93 |
|
|
if [ -z "$SPEC" ] |
94 |
|
|
then |
95 |
|
|
echo "Not building $package (No SPEC file)" |
96 |
|
|
continue |
97 |
|
|
fi |
98 |
|
|
check_package |
99 |
|
|
done |
100 |
gordonr |
1.4 |
done |