@@ -6,7 +6,6 @@ Group: Productivity/Databases/Tools
66License: GPL-3.0+
77URL: https://github.com/jonaski/sqlrestore
88Source0: %{name}-@SQLRESTORE_VERSION_PACKAGE@.tar.xz
9- BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
109
1110%if 0%{?suse_version} && 0%{?is_opensuse}
1211BuildRequires: libboost_headers-devel
@@ -32,41 +31,56 @@ BuildRequires: libappstream-glib
3231BuildRequires: appstream-util
3332%endif
3433%endif
35- %if 0%{?suse_version} || 0%{?fedora_version} || 0%{?mageia}
36- BuildRequires: cmake(Qt5LinguistTools)
37- %endif
3834BuildRequires: pkgconfig
3935BuildRequires: pkgconfig(glib-2.0)
4036BuildRequires: pkgconfig(gio-2.0)
4137BuildRequires: pkgconfig(gio-unix-2.0)
4238BuildRequires: pkgconfig(gthread-2.0)
4339BuildRequires: pkgconfig(zlib)
44- BuildRequires: pkgconfig(Qt5Core)
45- BuildRequires: pkgconfig(Qt5Gui)
46- BuildRequires: pkgconfig(Qt5Widgets)
47- BuildRequires: pkgconfig(Qt5Concurrent)
48- BuildRequires: pkgconfig(Qt5Network)
49- BuildRequires: pkgconfig(Qt5Sql)
50- BuildRequires: pkgconfig(Qt5Test)
40+
41+ %if "@QT_MAJOR_VERSION@" == "5" && ( 0%{?fedora} || 0%{?rhel_version} || 0%{?centos} )
42+ BuildRequires: pkgconfig(Qt@QT_MAJOR_VERSION@Core)
43+ BuildRequires: pkgconfig(Qt@QT_MAJOR_VERSION@Gui)
44+ BuildRequires: pkgconfig(Qt@QT_MAJOR_VERSION@Widgets)
45+ BuildRequires: pkgconfig(Qt@QT_MAJOR_VERSION@Concurrent)
46+ BuildRequires: pkgconfig(Qt@QT_MAJOR_VERSION@Network)
47+ BuildRequires: pkgconfig(Qt@QT_MAJOR_VERSION@Sql)
48+ %else
49+ BuildRequires: cmake(Qt@QT_MAJOR_VERSION@Core)
50+ BuildRequires: cmake(Qt@QT_MAJOR_VERSION@Gui)
51+ BuildRequires: cmake(Qt@QT_MAJOR_VERSION@Widgets)
52+ BuildRequires: cmake(Qt@QT_MAJOR_VERSION@Concurrent)
53+ BuildRequires: cmake(Qt@QT_MAJOR_VERSION@Network)
54+ BuildRequires: cmake(Qt@QT_MAJOR_VERSION@Sql)
55+ BuildRequires: cmake(Qt@QT_MAJOR_VERSION@Core5Compat)
56+ %endif
5157
5258BuildRequires: file-devel
5359
5460%if 0%{?fedora} || (0%{?suse_version} && 0%{?sle_version} < 150200)
61+ %if "@QT_MAJOR_VERSION@" == "5"
5562BuildRequires: quazip-qt5-devel
63+ %else
64+ BuildRequires: quazip-qt6-devel
65+ %endif
5666%else
57- %if 0%{?mageia}
58- %ifarch x86_64
67+ %if 0%{?mageia}
68+ %ifarch x86_64
5969BuildRequires: lib64quazip-devel
60- %else
70+ %else
6171BuildRequires: libquazip-devel
62- %endif
63- %else
72+ %endif
73+ %else
6474BuildRequires: quazip-devel
65- %endif
75+ %endif
6676%endif
6777
6878%if 0%{?suse_version}
79+ %if "@QT_MAJOR_VERSION@" == "5"
6980Requires: libQt5Sql5-unixODBC
81+ %else
82+ Requires: qt6-sql-unixODBC
83+ %endif
7084%endif
7185
7286%description
@@ -84,38 +98,33 @@ Features:
8498 - Works on Linux, macOS and Windows.
8599 - Compatible with MSSQL 2008 R2 to SQL 2019 server on Linux and Windows.
86100
101+ %if 0%{?suse_version}
102+ %debug_package
103+ %endif
104+
87105%prep
88106%setup -qn %{name}-@SQLRESTORE_VERSION_PACKAGE@
89107
90108%build
91- %if 0%{?suse_version} || 0%{?mageia}
92- %{cmake} ..
93- %else
94- mkdir -p %{_target_platform}
95- pushd %{_target_platform}
96- %{cmake} ..
97- popd
109+ %if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos}
110+ export CXXFLAGS="-fPIC $RPM_OPT_FLAGS"
98111%endif
99-
100- %if 0%{?suse_version} || 0%{?mageia}
101- %if 0%{?suse_version} && 0%{?suse_version} < 1500
102- make %{?_smp_mflags}
103- %else
104- %make_build
105- %endif
112+ %{cmake} -DCMAKE_BUILD_TYPE:STRING=Release -DQT_MAJOR_VERSION=@QT_MAJOR_VERSION@
113+ %if 0%{?centos} || (0%{?mageia} && 0%{?mageia} <= 7)
114+ %make_build
106115%else
107- %make_build -C %{_target_platform}
116+ %cmake_build
108117%endif
109118
110119%install
111- %if 0%{?suse_version }
112- %cmake_install
120+ %if 0%{?centos }
121+ %make_install
113122%else
114- %if 0%{?mageia}
115- %make_install -C build
116- %else
117- %make_install -C %{_target_platform}
118- %endif
123+ %if 0%{?mageia}
124+ %make_install -C build
125+ %else
126+ %cmake_install
127+ %endif
119128%endif
120129
121130%if 0%{?suse_version}
0 commit comments