blob: bac03c60ebf136fe753b7ec7379ec886df5b58c6 (
plain)
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
|
#!/bin/sh
# Requires rpm >= 4.10.0 see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=683759
# $ sudo dpkg --force-all -i rpm-common_4.10.0-5_amd64.deb librpm3_4.10.0-5_amd64.deb \
# librpmio3_4.10.0-5_amd64.deb librpmsign1_4.10.0-5_amd64.deb librpmbuild3_4.10.0-5_amd64.deb \
# rpm_4.10.0-5_amd64.deb rpm2cpio_4.10.0-5_amd64.deb liblzma5_5.1.1alpha+20120614-1_amd64.deb \
# python-rpm_4.10.0-5_amd64.deb
set -e
CHROOT_PREFIX=$1
DISTRO=$2
DISTRO_VERSION=$3
ARCH=$4
USER=$5
CHROOT_PATH=$CHROOT_PREFIX/$DISTRO-$DISTRO_VERSION-$ARCH
die() {
echo "ERROR: $@"
exit 1
}
echo "bootstraping $DISTRO-$DISTRO_VERSION"
apt-get install yum rpm
echo "installing mock"
set +e
groupadd -r mock
usermod -G $USER mock
git clone git://git.fedorahosted.org/git/mock.git mock
set -e
cd mock
./autogen.sh
./configure
make
make install
echo "config_opts['basedir'] = '$CHROOT_PREFIX'" > /usr/local/etc/mock/site-defaults.cfg
mock -r $DISTRO-$DISTRO_VERSION-$ARCH --init --resultdir=~/mock
echo "installing yum git and vim"
mock -r $DISTRO-$DISTRO_VERSION-$ARCH install git yum vim --resultdir=~/mock
|