]> piware.de Git - bin.git/blob - build-devmock
60f51274e84d41ba769db923644fec2735c8e32e
[bin.git] / build-devmock
1 #!/bin/sh
2 set -eux
3 MOCK="mock -r ${OS:-default}"
4
5 $MOCK --clean
6
7 # install cockpit's build deps and other development tools
8 $MOCK -i $(sed -n '/^BuildRequires:/ {s/^.*: //; s/>=.*$//; s/%{.*}//; p}' ~/upstream/cockpit/tools/cockpit.spec) \
9     npm fontconfig git valgrind chromium-headless \
10     libvirt-daemon-kvm libvirt-client python3-libvirt \
11     virt-viewer libguestfs-tools-c \
12     expect python3-pycodestyle python3-pyflakes \
13     fedpkg /usr/bin/oc /usr/bin/genisoimage \
14     man-pages socat wget genisoimage vim-enhanced
15
16 # interactive shell sessions work as user martin, not builder
17 $MOCK --unpriv --copyin /dev/stdin /builddir/.bashrc <<EOF
18 export HOME=/home/martin
19 export TERM=xterm
20 cd
21
22 # Source global definitions
23 if [ -f /etc/bashrc ]; then
24         . /etc/bashrc
25 fi
26 . ~/.bashrc
27 EOF
28
29 # make mock compatible with ostree's /home → /var/home structure
30 $MOCK --chroot -- ln -sf /home /var/home
31
32 # install rhpkg
33 $MOCK -i ~martin/Dokumente/Arbeit/RedHat/redhat-internal-cert-install-0.1-7.el7.csb.noarch.rpm
34 $MOCK --chroot --cwd=/etc/yum.repos.d -- 'echo >> /etc/dnf/dnf.conf; curl --location https://download.devel.redhat.com/rel-eng/RCMTOOLS/rcm-tools-fedora.repo >> /etc/dnf/dnf.conf'
35 $MOCK -i rhpkg
36
37 # ssh looks at passwd, not $HOME
38 $MOCK --chroot --unpriv -- rm -rf /builddir/.ssh
39 $MOCK --chroot --unpriv -- ln -s /home/martin/.ssh /builddir/.ssh
40 $MOCK --chroot --unpriv -- ln -s /home/martin/upstream /builddir/upstream