]> piware.de Git - bin.git/blobdiff - build-devmock
build-devmock: Set up rhpkg
[bin.git] / build-devmock
index 54729fcb625a520e03e1de66c77b8615a7a1b2b8..60f51274e84d41ba769db923644fec2735c8e32e 100755 (executable)
@@ -2,9 +2,9 @@
 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 \
@@ -13,6 +13,7 @@ $MOCK -i $(sed -n '/^BuildRequires:/ {s/^.*: //; s/>=.*$//; s/%{.*}//; p}' ~/ups
     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
@@ -24,3 +25,16 @@ if [ -f /etc/bashrc ]; then
 fi
 . ~/.bashrc
 EOF
+
+# make mock compatible with ostree's /home → /var/home structure
+$MOCK --chroot -- ln -sf /home /var/home
+
+# install rhpkg
+$MOCK -i ~martin/Dokumente/Arbeit/RedHat/redhat-internal-cert-install-0.1-7.el7.csb.noarch.rpm
+$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'
+$MOCK -i rhpkg
+
+# ssh looks at passwd, not $HOME
+$MOCK --chroot --unpriv -- rm -rf /builddir/.ssh
+$MOCK --chroot --unpriv -- ln -s /home/martin/.ssh /builddir/.ssh
+$MOCK --chroot --unpriv -- ln -s /home/martin/upstream /builddir/upstream