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  && \
    dnf install -y mock

RUN dnf install -y \
        git \
        rpm-build \
        tar \
        make \
        autoconf \
        automake \
        nasm \
        cmake \
        speexdsp-devel \
        pulseaudio-libs-devel \
        libcanberra-devel \
        libcurl-devel \
        libtool \
        mesa-libgbm-devel \
        mesa-dri-drivers \
        dbus-devel \
        expat-devel \
        pcre-devel \
        yaml-cpp-devel \
        dbus-c++-devel \
        dbus-devel \
        libXext-devel \
        libXfixes-devel \
        yasm \
        speex-devel \
        gsm-devel \
        chrpath \
        check \
        astyle \
        gettext-devel \
        gcc-c++ \
        libstdc++-static \
        which \
        alsa-lib-devel \
        systemd-devel \
        libuuid-devel \
        uuid-devel \
        gnutls-devel \
        nettle-devel \
        opus-devel \
        patch \
        jsoncpp-devel \
        libnatpmp-devel \
        webkitgtk4-devel \
        cryptopp-devel \
        libva-devel \
        libvdpau-devel \
        msgpack-devel \
        NetworkManager-libnm-devel \
        openssl-devel \
        clutter-devel \
        clutter-gtk-devel \
        libappindicator-gtk3-devel \
        libnotify-devel \
        libupnp-devel \
        qrencode-devel \
        sqlite-devel \
        libdrm \
        gperf \
        bison \
        flex \
        nodejs \
        nss-devel \
        kernel-headers \
        python2 \
        libargon2-devel \
        wget

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

CMD /opt/build-package-rpm.sh