File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,41 @@ include(PackageSpecs.cmake)
50
50
51
51
add_subdirectory (deb-in )
52
52
53
+ # RPM stuff
54
+
55
+ find_program (RPM rpm )
56
+
57
+ if (RPM )
58
+
59
+ # Get RPM version
60
+
61
+ execute_process (COMMAND ${RPM} "--version"
62
+ RESULT_VARIABLE res
63
+ OUTPUT_VARIABLE RPM_VERSION
64
+ OUTPUT_STRIP_TRAILING_WHITESPACE
65
+ )
66
+
67
+ if (res )
68
+ message (FATAL_ERROR "Could not determine RPM version (${RPM} --version command failed)" )
69
+ endif ()
70
+
71
+ # Set RPM_VER_NUM to version number in XYYZZ format
72
+
73
+ string (REGEX REPLACE "^RPM version *" "" RPM_VERSION ${RPM_VERSION} )
74
+ string (REPLACE "." ";" ver ${RPM_VERSION} )
75
+ list (GET ver 0 ver_major )
76
+ list (GET ver 1 ver_minor )
77
+ list (GET ver 2 ver_patch )
78
+ string (REGEX MATCH "..$" ver_minor "0${ver_minor} " )
79
+ string (REGEX MATCH "..$" ver_patch "0${ver_patch} " )
80
+ set (RPM_VER_NUM "${ver_major}${ver_minor}${ver_patch} " )
81
+
82
+ message (STATUS "Using RPM tools version: ${RPM_VERSION} (${RPM_VER_NUM} )" )
83
+
84
+ endif ()
85
+
86
+
87
+ # Gnerate RPM specification
53
88
54
89
if (PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME )
55
90
set (rpm_spec "${CMAKE_CURRENT_BINARY_DIR} /SPECS/mysql-connector-c++.spec" )
Original file line number Diff line number Diff line change 63
63
%global lib_base_name libmysqlcppconnx@ABI_VERSION_MAJOR@
64
64
%global lib_base_name_jdbc libmysqlcppconn@JDBC_ABI_VERSION_MAJOR@
65
65
66
+ # TODO: use %rpmversion if available, note that it is in the format X.Y.Z.Y
67
+ # and the current logic requires numeric format XYYZZ.
68
+
69
+ %global rpm_ver_num @RPM_VER_NUM@
70
+
71
+
66
72
###############################################
67
73
# Package specifications
68
74
###############################################
@@ -97,7 +103,10 @@ A C++ interface for communicating with MySQL servers.
97
103
%package jdbc
98
104
Summary: MySQL Driver for C++ which mimics the JDBC 4.0 API
99
105
Provides: %{lib_base_name_jdbc} = %{version}-%{release}
106
+ # Note: Field `Suggests` is recognized by RPM 4.13 and later
107
+ %if %{rpm_ver_num} >= 41300
100
108
Suggests: krb5-libs, cyrus-sasl-lib, libfido2
109
+ %endif
101
110
Obsoletes: %{lib_base_name_jdbc} < %{version}-%{release}
102
111
Obsoletes: mysql-connector-c++%{?product_suffix}-jdbc < %{version}-%{release}
103
112
Obsoletes: mysql-connector-c++-jdbc < %{version}-%{release}
You can’t perform that action at this time.
0 commit comments