build-devtoolbox: rcm-tools is available for all current Fedoras now
[bin.git] / build-devtoolbox
1 #!/bin/sh
2 set -eux
3 NAME=devel
4
5 if [ -n "${TOOLBOX_RELEASE:-}" ]; then
6     RELEASE="--release $TOOLBOX_RELEASE"
7     NAME="$NAME-$TOOLBOX_RELEASE"
8 else
9     RELEASE=''
10 fi
11
12 toolbox rm --force $NAME || true
13 yes | toolbox create $RELEASE -c $NAME
14
15 # install cockpit's build deps and other development tools
16 toolbox run -c "$NAME" sh -exc '
17 # https://bugzilla.redhat.com/show_bug.cgi?id=1785244
18 if [ ! -e /etc/resolv.conf ]; then
19     sudo ln -sfn /run/host/monitor/resolv.conf /etc/resolv.conf
20 fi
21
22 # useful hostname
23 . /etc/os-release
24 echo "${ID}-${VERSION_ID}" | sudo tee /etc/hostname
25 sudo hostname -F /etc/hostname
26
27 # this just refuses to rpm -i normally
28 sudo dnf install -y cpio
29 rpm2cpio ~martin/Dokumente/Arbeit/RedHat/redhat-internal-cert-install-0.1-7.el7.csb.noarch.rpm | sudo cpio -id --directory=/ --verbose "./etc/pki/*"
30 sudo update-ca-trust
31
32 (cd /etc/yum.repos.d; sudo curl -O --location https://download.devel.redhat.com/rel-eng/RCMTOOLS/rcm-tools-fedora.repo)
33
34 sudo dnf builddep -y cockpit
35 sudo dnf install -y make npm fontconfig git valgrind chromium \
36     libvirt-daemon-kvm libvirt-client python3-libvirt \
37     virt-viewer virt-install libappstream-glib \
38     expect python3-pycodestyle python3-pyflakes \
39     fedpkg rhpkg /usr/bin/oc /usr/bin/genisoimage \
40     man-pages socat wget genisoimage vim-X11 \
41     ansible standard-test-roles rsync strace diffstat \
42     pwgen glibc-langpack-en tig twine dbus-daemon
43
44 sudo dnf debuginfo-install -y glib2 glibc libssh gnutls
45
46 sudo dnf clean packages
47
48 sudo pip install awscli
49
50 # unbreak kerberos; https://github.com/debarshiray/toolbox/issues/235
51 cat <<EOF | sudo tee /etc/krb5.conf.d/0_file_ccache
52 [libdefaults]
53     default_ccache_name = FILE:/tmp/krb5.ccache
54 EOF
55
56 # vim-X11 does not ship vim binary
57 sudo ln -s vimx /usr/bin/vim
58 '