Skip to content

Commit 8804096

Browse files
author
Pavel Siska
committed
Rpmbuild: Ensured the toolset is enabled when needed in the %build section based on GCC version.
1 parent 3c4ab37 commit 8804096

File tree

3 files changed

+37
-6
lines changed

3 files changed

+37
-6
lines changed

pkg/rpm/ipfixprobe-msec.spec.in

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,15 @@ Conflicts: ipfixprobe-nemea, ipfixprobe
1616
Source0: %{name}-%{version}.tar.gz
1717

1818
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
19-
BuildRequires: (gcc >= 10 or gcc-toolset-13-gcc)
20-
BuildRequires: (gcc-c++ >= 10 or gcc-toolset-13-gcc-c++)
19+
%if 0%{?rhel} == 8
20+
BuildRequires: gcc-toolset-14-gcc
21+
BuildRequires: gcc-toolset-14-gcc-c++
22+
%endif
23+
24+
%if 0%{?rhel} == 9
25+
BuildRequires: gcc >= 10
26+
BuildRequires: gcc-c++ >= 10
27+
%endif
2128
BuildRequires: make
2229
BuildRequires: cmake >= 3.12
2330
BuildRequires: libunwind-devel
@@ -44,6 +51,9 @@ that make up the main components of the test environment.
4451
%autosetup
4552

4653
%build
54+
%if 0%{?rhel} == 8
55+
source /opt/rh/gcc-toolset-14/enable
56+
%endif
4757
%cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_MILISECONDS_TIMESTAMP=ON
4858
%cmake_build
4959

pkg/rpm/ipfixprobe-nemea.spec.in

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,15 @@ Requires: ipfixprobe-nemea
3030
%endif
3131

3232
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
33-
BuildRequires: (gcc >= 10 or gcc-toolset-13-gcc)
34-
BuildRequires: (gcc-c++ >= 10 or gcc-toolset-13-gcc-c++)
33+
%if 0%{?rhel} == 8
34+
BuildRequires: gcc-toolset-14-gcc
35+
BuildRequires: gcc-toolset-14-gcc-c++
36+
%endif
37+
38+
%if 0%{?rhel} == 9
39+
BuildRequires: gcc >= 10
40+
BuildRequires: gcc-c++ >= 10
41+
%endif
3542
BuildRequires: make
3643
BuildRequires: cmake >= 3.12
3744
BuildRequires: libunwind-devel
@@ -59,6 +66,9 @@ that make up the main components of the test environment.
5966
%autosetup
6067

6168
%build
69+
%if 0%{?rhel} == 8
70+
source /opt/rh/gcc-toolset-14/enable
71+
%endif
6272
%cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_NEMEA=ON %{?with_output_unirec: -DENABLE_OUTPUT_UNIREC=ON}
6373
%cmake_build
6474

pkg/rpm/ipfixprobe.spec.in

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,16 @@ Experimental process plugins.
6363
%endif
6464

6565
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
66-
BuildRequires: (gcc >= 10 or gcc-toolset-13-gcc)
67-
BuildRequires: (gcc-c++ >= 10 or gcc-toolset-13-gcc-c++)
66+
%if 0%{?rhel} == 8
67+
BuildRequires: gcc-toolset-14-gcc
68+
BuildRequires: gcc-toolset-14-gcc-c++
69+
%endif
70+
71+
%if 0%{?rhel} == 9
72+
BuildRequires: gcc >= 10
73+
BuildRequires: gcc-c++ >= 10
74+
%endif
75+
6876
BuildRequires: make
6977
BuildRequires: cmake >= 3.12
7078
BuildRequires: libunwind-devel
@@ -91,6 +99,9 @@ that make up the main components of the test environment.
9199
%autosetup
92100

93101
%build
102+
%if 0%{?rhel} == 8
103+
source /opt/rh/gcc-toolset-14/enable
104+
%endif
94105
%cmake -DCMAKE_BUILD_TYPE=Release %{?with_input_pcap:-DENABLE_INPUT_PCAP=ON} %{?with_input_dpdk:-DENABLE_INPUT_DPDK=ON} %{?with_input_nfb:-DENABLE_INPUT_NFB=ON} %{?with_process_experimental: -DENABLE_PROCESS_EXPERIMENTAL=ON}
95106
%cmake_build
96107

0 commit comments

Comments
 (0)