]> piware.de Git - bin.git/blobdiff - build-devmock
build-devmock: make mock compatible with ostree's /home → /var/home structure
[bin.git] / build-devmock
index d288959d1f27f571dcca9d260359305c6292b499..2e50451f1b595ac9203c1c5af1da81e9feecc5b1 100755 (executable)
@@ -2,11 +2,29 @@
 set -eux
 MOCK="mock -r ${OS:-default}"
 
-mock --clean
+$MOCK --clean
 
-# install cockpit's build deps
+# install cockpit's build deps and other development tools
 $MOCK -i $(sed -n '/^BuildRequires:/ {s/^.*: //; s/>=.*$//; s/%{.*}//; p}' ~/upstream/cockpit/tools/cockpit.spec) \
     npm fontconfig git valgrind chromium-headless \
     libvirt-daemon-kvm libvirt-client python3-libvirt \
+    virt-viewer libguestfs-tools-c \
     expect python3-pycodestyle python3-pyflakes \
-    fedpkg /usr/bin/oc
+    fedpkg /usr/bin/oc /usr/bin/genisoimage \
+    man-pages socat wget genisoimage vim-enhanced
+
+# interactive shell sessions work as user martin, not builder
+$MOCK --unpriv --copyin /dev/stdin /builddir/.bashrc <<EOF
+export HOME=/home/martin
+export TERM=xterm
+cd
+
+# Source global definitions
+if [ -f /etc/bashrc ]; then
+       . /etc/bashrc
+fi
+. ~/.bashrc
+EOF
+
+# make mock compatible with ostree's /home → /var/home structure
+mock -r ${OS:-default} --chroot -- ln -sf /home /var/home