]> piware.de Git - bin.git/blob - build-devmock
build-devmock: make mock compatible with ostree's /home → /var/home structure
[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 -r ${OS:-default} --chroot -- ln -sf /home /var/home