FROM docker.io/roboxes/rhel8

ARG PASS
ENV PASS=$PASS

RUN subscription-manager register --username=jamisfl --password=$PASS
RUN subscription-manager attach --auto
RUN subscription-manager repos  --enable=codeready-builder-for-rhel-8-x86_64-rpms

RUN dnf clean all
RUN dnf install -y dnf-command\(builddep\) rpmdevtools

RUN dnf clean all
RUN dnf upgrade -y && \
    dnf install -y mesa-dri-drivers && \
    dnf install -y \
        git \
        rpm-build \
        tar \
        make \
        autoconf \
        automake \
        cmake \
        nasm \
        pulseaudio-libs-devel \
        libcanberra-devel \
        libcurl-devel \
        libtool \
        dbus-devel \
        expat-devel \
        pcre-devel \
        boost-devel \
        dbus-devel \
        libXext-devel \
        libXfixes-devel \
        chrpath \
        check \
        gettext-devel \
        gcc-c++ \
        which \
        alsa-lib-devel \
        systemd-devel \
        libuuid-devel \
        gnutls-devel \
        nettle-devel \
        patch \
        webkitgtk4-devel \
        libva-devel \
        openssl-devel \
        qt5-devel \
        clutter \
        clutter-devel \
        clutter-gtk-devel \
        qrencode-devel \
        yasm \
        opus \
        opus-devel \
        libvdpau-devel \
        libvdpau \
        speexdsp \
        speexdsp-devel \
        cppunit-devel \
        cppunit \
        libsndfile \
        libsndfile-devel \
        gsm-devel \
        evolution-data-server \
        evolution-devel \
	qt5-qtbase-5.11.1-7.el8.i686 \
        dbus-c++ \
        jsoncpp-devel

ADD scripts/build-package-rhel.sh  /opt/build-package-rhel.sh

CMD /opt/build-package-rhel.sh

RUN subscription-manager unregister
