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 |
slords |
1.19 |
SRPM=/builds/rpms/SRPMS/$NVR*.src.rpm |
18 |
slords |
1.14 |
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 |
slords |
1.15 |
kmod-*) |
30 |
slords |
1.14 |
build_package "--arch i586,i686" |
31 |
|
|
;; |
32 |
slords |
1.19 |
*-kmod) |
33 |
|
|
build_package "--arch i686" |
34 |
|
|
;; |
35 |
slords |
1.14 |
*) |
36 |
|
|
build_package |
37 |
|
|
;; |
38 |
|
|
esac |
39 |
|
|
} |
40 |
|
|
|
41 |
|
|
build_package() |
42 |
|
|
{ |
43 |
slords |
1.17 |
if LANG=en_US mzbuild $1 --specfile $SPEC >> $LOG 2>&1 |
44 |
slords |
1.14 |
then |
45 |
|
|
release_rpms *.rpm |
46 |
|
|
else |
47 |
|
|
echo "Build of $package failed - check $LOG" |
48 |
|
|
fi |
49 |
|
|
} |
50 |
gordonr |
1.1 |
|
51 |
slords |
1.21 |
for package in $(ls /mirrors/cvsroot/${2:-smeserver} | grep "^$1.*$") |
52 |
gordonr |
1.1 |
do |
53 |
gordonr |
1.2 |
case $package in |
54 |
slords |
1.23 |
CVSROOT|builds_bin|cdrom.image|common|devguide|isolinux|rpms) |
55 |
slords |
1.22 |
cd ~/work/$(hostname -s) |
56 |
|
|
rm -rf ~/work/$(hostname -s)/$package |
57 |
gordonr |
1.11 |
continue |
58 |
|
|
;; |
59 |
slords |
1.14 |
esac |
60 |
gordonr |
1.11 |
|
61 |
slords |
1.20 |
LOG=$HOME/work/$(hostname -s)/logs/$package.log |
62 |
slords |
1.14 |
> $LOG |
63 |
gordonr |
1.2 |
|
64 |
gordonr |
1.6 |
echo -n "Checking $package "; date |
65 |
slords |
1.14 |
(echo -n "Checking $package "; date) >> $LOG |
66 |
|
|
echo ========================================================== >> $LOG |
67 |
gordonr |
1.3 |
|
68 |
slords |
1.20 |
cd ~/work/$(hostname -s) |
69 |
|
|
rm -rf ~/work/$(hostname -s)/$package |
70 |
slords |
1.21 |
mzget --dir /mirrors/cvsroot/${2:-smeserver} $package >> $LOG |
71 |
gordonr |
1.2 |
|
72 |
slords |
1.20 |
cd ~/work/$(hostname -s)/$package |
73 |
gordonr |
1.4 |
|
74 |
slords |
1.14 |
SPEC=$(ls F/*.spec 2> /dev/null | tail -1) |
75 |
|
|
if [ -z "$SPEC" ] |
76 |
gordonr |
1.6 |
then |
77 |
slords |
1.14 |
echo "Not building $package (No SPEC file)" |
78 |
slords |
1.16 |
rm -f $LOG |
79 |
slords |
1.22 |
cd ~/work/$(hostname -s) |
80 |
|
|
rm -rf ~/work/$(hostname -s)/$package |
81 |
gordonr |
1.6 |
continue |
82 |
|
|
else |
83 |
slords |
1.16 |
TAGS=$(cvs status -v $SPEC | awk '/\(branch:/ && !/\(branch: 1\.1\.1\)/ { print $1 }' | sort -u) |
84 |
gordonr |
1.6 |
fi |
85 |
slords |
1.14 |
check_package |
86 |
gordonr |
1.4 |
|
87 |
slords |
1.14 |
for tag in $TAGS |
88 |
|
|
do |
89 |
|
|
echo >> $LOG |
90 |
|
|
|
91 |
|
|
echo -n "Checking $package ($tag) "; date |
92 |
|
|
(echo -n "Checking $package ($tag) "; date) >> $LOG |
93 |
|
|
echo ========================================================== >> $LOG |
94 |
slords |
1.20 |
cd ~/work/$(hostname -s) |
95 |
|
|
rm -rf ~/work/$(hostname -s)/$package |
96 |
slords |
1.21 |
mzget --dir /mirrors/cvsroot/${2:-smeserver} --tag $tag $package >> $LOG |
97 |
slords |
1.14 |
|
98 |
slords |
1.20 |
cd ~/work/$(hostname -s)/$package |
99 |
slords |
1.14 |
|
100 |
|
|
SPEC=$(ls F/*.spec 2> /dev/null | tail -1) |
101 |
|
|
if [ -z "$SPEC" ] |
102 |
|
|
then |
103 |
|
|
echo "Not building $package (No SPEC file)" |
104 |
|
|
continue |
105 |
|
|
fi |
106 |
|
|
check_package |
107 |
|
|
done |
108 |
gordonr |
1.4 |
done |