Skip to content

Commit a950756

Browse files
committed
make-srpm.sh: update cmake macros and deps for cmake4
It seems %cmake4 macros are no longer provided in rawhide, nor is there a `Provides: cmake4`. For now we still need the ability to build for EPEL7, where unversioned cmake will resolve to v2, so conditionally we still use v3. https://fedoraproject.org/wiki/Changes/CMake4.0
1 parent 8604716 commit a950756

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

make-srpm.sh

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ SPEC="./$PKG.spec"
8181
cat > "$SPEC" << EOF
8282
# disable in source builds on EPEL <9
8383
%undefine __cmake_in_source_build
84-
%undefine __cmake3_in_source_build
8584
8685
# python2 is not available on RHEL > 7 and Fedora
8786
%if 0%{?rhel} > 7 || 0%{?fedora}
@@ -126,7 +125,11 @@ BuildRequires: boost1.78-devel
126125
BuildRequires: boost-devel
127126
%endif
128127
128+
%if 0%{?rhel} == 7
129129
BuildRequires: cmake3
130+
%else
131+
BuildRequires: cmake
132+
%endif
130133
BuildRequires: gcc-c++
131134
BuildRequires: help2man
132135
BuildRequires: make
@@ -194,18 +197,34 @@ export BOOST_LIBRARYDIR=/usr/lib64/boost169
194197
%endif
195198
196199
make version.cc
197-
%cmake3 \\
200+
%if 0%{?rhel} == 7
201+
%cmake3 \\
202+
%else
203+
%cmake \\
204+
%endif
198205
-DCSGREP_STATIC=%{?with_static:ON} \\
199206
-DPYCSDIFF_PYTHON2=%{?with_python2:ON} \\
200207
-DPYCSDIFF_PYTHON3=%{?with_python3:ON} \\
201208
-DVERSION='%{name}-%{version}-%{release}'
209+
%if 0%{?rhel} == 7
202210
%cmake3_build
211+
%else
212+
%cmake_build
213+
%endif
203214
204215
%install
216+
%if 0%{?rhel} == 7
205217
%cmake3_install
218+
%else
219+
%cmake_install
220+
%endif
206221
207222
%check
223+
%if 0%{?rhel} == 7
208224
%ctest3
225+
%else
226+
%ctest
227+
%endif
209228
210229
%files
211230
%doc README

0 commit comments

Comments
 (0)