-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild-fedora-centos.sh
executable file
·66 lines (61 loc) · 2.58 KB
/
build-fedora-centos.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
# Copyright (C) 2014, Apertium Project Management Committee <[email protected]>
# Licensed under the GNU GPL version 2 or later; see https://www.gnu.org/licenses/
rm -rf /home/apertium/mock/*
cd /tmp/
for DISTRO in epel-6 epel-7 fedora-19 fedora-20
do
for ARCH in i386 x86_64
do
if [ ! -f /etc/mock/$DISTRO-$ARCH.cfg ]; then
echo "Skipping $DISTRO for $ARCH"
continue
fi
mkdir -p /home/apertium/mock/$DISTRO/$ARCH/
rm -rf /var/lib/mock/$DISTRO-$ARCH/root/builddir/build
echo "Updating $DISTRO for $ARCH"
mock -r $DISTRO-$ARCH --no-clean --no-cleanup-after --update --resultdir=/home/apertium/mock/$DISTRO/$ARCH/ -v >/home/apertium/public_html/apt/logs/$1/$DISTRO-$ARCH.log 2>&1
echo "Installing dependencies $DISTRO for $ARCH"
mock -r $DISTRO-$ARCH --no-clean --no-cleanup-after --resultdir=/home/apertium/mock/$DISTRO/$ARCH/ -v --installdeps /home/apertium/rpmbuild/SRPMS/$1*.src.rpm >>/home/apertium/public_html/apt/logs/$1/$DISTRO-$ARCH.log 2>&1
echo "Building $DISTRO for $ARCH"
mock -r $DISTRO-$ARCH --no-clean --no-cleanup-after --resultdir=/home/apertium/mock/$DISTRO/$ARCH/ -v /home/apertium/rpmbuild/SRPMS/$1*.src.rpm >>/home/apertium/public_html/apt/logs/$1/$DISTRO-$ARCH.log 2>&1 &
if [[ -n "$2" ]]; then
break
fi
done
done
for job in `jobs -p`
do
echo "Waiting for $job"
wait $job
done
for DISTRO in epel-6 epel-7 fedora-19 fedora-20
do
for ARCH in i386 x86_64
do
if ls /home/apertium/mock/$DISTRO/$ARCH/$1-*.rpm &>/dev/null; then
continue
fi
if [ ! -f /etc/mock/$DISTRO-$ARCH.cfg ]; then
continue
fi
echo "Failed build of $DISTRO for $ARCH - retrying"
rm -rf /home/apertium/mock/$DISTRO/$ARCH/
mkdir -p /home/apertium/mock/$DISTRO/$ARCH/
rm -rf /var/lib/mock/$DISTRO-$ARCH/root/builddir/build
echo "Updating $DISTRO for $ARCH"
mock -r $DISTRO-$ARCH --no-clean --no-cleanup-after --update --resultdir=/home/apertium/mock/$DISTRO/$ARCH/ -v >/home/apertium/public_html/apt/logs/$1/$DISTRO-$ARCH.log 2>&1
echo "Installing dependencies $DISTRO for $ARCH"
mock -r $DISTRO-$ARCH --no-clean --no-cleanup-after --resultdir=/home/apertium/mock/$DISTRO/$ARCH/ -v --installdeps /home/apertium/rpmbuild/SRPMS/$1*.src.rpm >>/home/apertium/public_html/apt/logs/$1/$DISTRO-$ARCH.log 2>&1
echo "Building $DISTRO for $ARCH"
mock -r $DISTRO-$ARCH --no-clean --no-cleanup-after --resultdir=/home/apertium/mock/$DISTRO/$ARCH/ -v /home/apertium/rpmbuild/SRPMS/$1*.src.rpm >>/home/apertium/public_html/apt/logs/$1/$DISTRO-$ARCH.log 2>&1 &
if [[ -n "$2" ]]; then
break
fi
done
done
for job in `jobs -p`
do
echo "Waiting for $job"
wait $job
done