Skip to content

Commit 128f483

Browse files
author
Pavel Siska
committed
Rpmbuild: Ensured the toolset is enabled when needed in the %build section based on GCC version.
1 parent 9a823cf commit 128f483

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

pkg/rpm/ipfixprobe-msec.spec.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,13 @@ The package contains tools, configuration files and traffic samples
4141
that make up the main components of the test environment.
4242

4343
%prep
44+
%global gcc_major_version %(gcc -dumpversion | cut -d. -f1)
4445
%autosetup
4546

4647
%build
48+
%if %{gcc_major_version} < 10
49+
source /opt/rh/gcc-toolset-13/enable
50+
%endif
4751
%cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_MILISECONDS_TIMESTAMP=ON
4852
%cmake_build
4953

pkg/rpm/ipfixprobe-nemea.spec.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,13 @@ The package contains tools, configuration files and traffic samples
5656
that make up the main components of the test environment.
5757

5858
%prep
59+
%global gcc_major_version %(gcc -dumpversion | cut -d. -f1)
5960
%autosetup
6061

6162
%build
63+
%if %{gcc_major_version} < 10
64+
source /opt/rh/gcc-toolset-13/enable
65+
%endif
6266
%cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_NEMEA=ON %{?with_output_unirec: -DENABLE_OUTPUT_UNIREC=ON}
6367
%cmake_build
6468

pkg/rpm/ipfixprobe.spec.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,13 @@ The package contains tools, configuration files and traffic samples
8888
that make up the main components of the test environment.
8989

9090
%prep
91+
%global gcc_major_version %(gcc -dumpversion | cut -d. -f1)
9192
%autosetup
9293

9394
%build
95+
%if %{gcc_major_version} < 10
96+
source /opt/rh/gcc-toolset-13/enable
97+
%endif
9498
%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}
9599
%cmake_build
96100

0 commit comments

Comments
 (0)