misc: Add CentOS 8 package support

Type: feature

Added missing dependencies on RPM spec file and install-dep

Ticket: VPP-1800

Signed-off-by: Renato Botelho do Couto <renato@netgate.com>
Change-Id: I91d39c94b3f03c213249dff42b264718ef772bdb
diff --git a/Makefile b/Makefile
index ff523ed..7bf6b73 100644
--- a/Makefile
+++ b/Makefile
@@ -100,6 +100,13 @@
 	RPM_DEPENDS += python3-virtualenv python3-jsonschema
 	RPM_DEPENDS += cmake
 	RPM_DEPENDS_GROUPS = 'C Development Tools and Libraries'
+else ifeq ($(OS_ID)-$(OS_VERSION_ID),centos-8)
+	RPM_DEPENDS += dnf-utils
+	RPM_DEPENDS += compat-openssl10
+	RPM_DEPENDS += python3-devel python3-ply
+	RPM_DEPENDS += python3-virtualenv python3-jsonschema
+	RPM_DEPENDS += cmake
+	RPM_DEPENDS_GROUPS = 'Development Tools'
 else
 	RPM_DEPENDS += yum-utils
 	RPM_DEPENDS += openssl-devel
@@ -291,6 +298,9 @@
 	@sudo -E yum groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
 	@sudo -E yum install $(CONFIRM) $(RPM_DEPENDS)
 	@sudo -E debuginfo-install $(CONFIRM) glibc openssl-libs mbedtls-devel zlib
+else ifeq ($(OS_ID)-$(OS_VERSION_ID),centos-8)
+	@sudo -E dnf groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
+	@sudo -E dnf install $(CONFIRM) $(RPM_DEPENDS)
 else ifeq ($(OS_ID),centos)
 	@sudo -E yum install $(CONFIRM) centos-release-scl-rh epel-release
 	@sudo -E yum groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
diff --git a/extras/rpm/vpp.spec b/extras/rpm/vpp.spec
index e20bf1f..09e70c5 100644
--- a/extras/rpm/vpp.spec
+++ b/extras/rpm/vpp.spec
@@ -59,20 +59,26 @@
 BuildRequires: python3, python36-devel, python3-virtualenv
 BuildRequires: cmake
 %else
-%if 0%{rhel} == 7
+%if 0%{rhel} >= 7
 Requires: epel-release
 Requires: vpp-lib = %{_version}-%{_release}, vpp-selinux-policy = %{_version}-%{_release}, net-tools, pciutils, python36
 Requires: boost-filesystem mbedtls libffi-devel
 BuildRequires: epel-release
 BuildRequires: mbedtls-devel mbedtls
-BuildRequires: devtoolset-7-toolchain
 BuildREquires: openssl-devel
 BuildRequires: python36-devel
+%if 0%{rhel} == 7
+BuildRequires: devtoolset-7-toolchain
 BuildRequires: cmake3
+BuildRequires: glibc-static, yum-utils
+%else
+BuildRequires: cmake
+BuildRequires: dnf-utils
+%endif
 %endif
 %endif
 BuildRequires: libffi-devel
-BuildRequires: glibc-static, yum-utils, redhat-lsb
+BuildRequires: redhat-lsb
 BuildRequires: apr-devel
 BuildRequires: numactl-devel
 BuildRequires: autoconf automake libtool byacc bison flex
@@ -165,7 +171,7 @@
 groupadd -f -r vpp
 
 %build
-%if 0%{?rhel}
+%if 0%{rhel} < 8
 . /opt/rh/devtoolset-7/enable
 %endif
 %if %{with aesni}