#!/usr/bin/env bash

echo Install various packages from Thirdlane and EPEL repo

# we need perl-5.26.3-422.el8.0.1.x86_64
#PVER=`rpm -qa | grep perl-5.26.3 | cut -d- -f3 | cut -d. -f1`
#if [ "$PVER" = "423" ]; then
#  echo Downgrade perl to perl-5.26.3-422.el8.0.1.x86_64
#  yum downgrade perl-5.26.3-422.el8.0.1.x86_64 -y
#fi

# install perl rpms and lock from upgrading
#PVER=5.26.3-422.el8.0.1.x86_64
#yum -y install perl-$PVER perl-Errno-$PVER perl-devel-$PVER perl-interpreter-$PVER perl-libs-$PVER perl-utils-$PVER
yum -y install perl-5.40.2-512.2.el10_0.x86_64 perl-Errno-1.38-512.2.el10_0.x86_64 perl-devel-5.40.2-512.2.el10_0.x86_64 perl-interpreter-5.40.2-512.2.el10_0.x86_64 perl-libs-5.40.2-512.2.el10_0.x86_64 perl-utils-5.40.2-512.2.el10_0.noarch
# --disablerepo=baseos --disablerepo=appstream
echo "exclude=perl perl-Errno perl-devel perl-interpreter perl-libs perl-utils nginx*" >> /etc/yum.conf
# remove rsyslog
yum -y remove rsyslog
yum -y install syslog-ng --enablerepo=epel

#yum -y install thirdlane-nginx thirdlane-nginx-config --enablerepo=epel

yum -y install \
  alsa-lib atk audiofile avahi-libs cairo ed fontconfig gd gdbm-devel gdk-pixbuf2 \
  giflib gnutls gperf gpm-libs gsm gtk2 hicolor-icon-theme jasper-libs jpackage-utils libICE libSM libX11 libX11-common libXau libXcomposite \
  libXcursor libXdamage libXext libXfixes libXft libXi libXinerama libXpm libXrandr libXrender libXtst libXxf86vm libdbi libevent \
  libfontenc libgomp libibverbs libical libjpeg-turbo libogg libpng libproxy libproxy-bin librdmacm libthai \
  libtheora libtiff libtiff-devel libtool-ltdl libunistring libuuid-devel libvorbis libxcb libxslt lksctp-tools lm_sensors-libs mailcap mc \
  memcached mesa-dri-filesystem mesa-libGL nc neon numactl  \
  pango patch pciutils pcsc-lite-libs perl-Compress-Raw-Zlib perl-Compress-Zlib perl-Cpanel-JSON-XS perl-DBD-MySQL perl-DBI perl-Encode-Detect \
  perl-ExtUtils-MakeMaker perl-ExtUtils-ParseXS perl-HTML-Parser perl-HTML-Tagset perl-IO-Compress-Base perl-IO-Compress-Zlib \
  perl-IPC-Cmd perl-Locale-Maketext-Simple perl-Module-Load perl-Module-Load-Conditional perl-Module-Pluggable perl-Net-SSLeay \
  perl-Params-Check perl-Pod-Escapes perl-Pod-Simple perl-Test-Harness perl-URI perl-libwww-perl perl-version pixman \
  postgresql-libs rdma speex ttmkfdir unixODBC unzip vsftpd xmlrpc-c xmlrpc-c-client xorg-x11-font-utils xorg-x11-fonts-Type1 \
  freetds jansson lame-libs libnet perl-IPC-ShareLite portaudio tmux \
  nspr nss nss-softokn nss-softokn-freebl nss-sysinit nss-tools nss-util php-cli php-common telnet tzdata-java ngrep \
  syslog-ng logrotate net-tools libmemcached nano bind-utils libsndfile-utils rsync bind-utils libnsl libxcrypt-compat telnet \
  libbson libmongocrypt mongo-c-driver-libs monit libnsl rsync tcpdump lrzsz lsof psmisc perl-App-cpanminus perl-JSON-XS mpg123 net-tools plocate patch \
  --enablerepo=epel 

yum -y install corosync corosynclib # --enablerepo=ha

yum -y install \
  hiredis json-glib libass libva \
  soxr x265-libs x264-libs vvenc-libs xvidcore \
  SDL ffmpeg libXv libasyncns libavdevice libdc1394 libraw1394 libsndfile libv4l libvdpau openal-soft pulseaudio-libs perl-Time-Piece \
  tftp-server tftp dmidecode rsync man mariadb-connector-odbc sox patch perl-IPC-Run git ghostscript bash-completion \
  GeoIP GeoIP-devel gmime-devel util-linux-user luajit bat sngrep lftp htop atop ncdu NetworkManager-tui util-linux s-nail python3-PyMySQL+rsa \
  --enablerepo=epel

yum -y install langpacks-en glibc-all-langpacks
localectl set-locale LANG=en_US.UTF-8
source /etc/locale.conf

yum -y install rng-tools
systemctl enable rngd
systemctl restart rngd
