Skip to content

Commit b5c7f7c

Browse files
committed
rpm: Refactor
1 parent c4f3e42 commit b5c7f7c

File tree

1 file changed

+44
-38
lines changed

1 file changed

+44
-38
lines changed

dist/unix/strawberry.spec.in

Lines changed: 44 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,47 +11,21 @@ License: GPL-3.0+
1111
URL: https://www.strawberrymusicplayer.org/
1212
Source0: %{name}-@STRAWBERRY_VERSION_PACKAGE@.tar.xz
1313

14-
%if 0%{?suse_version}
15-
BuildRequires: libboost_headers-devel
16-
%else
17-
BuildRequires: boost-devel
18-
%endif
19-
BuildRequires: cmake
2014
BuildRequires: gcc-c++
21-
BuildRequires: hicolor-icon-theme
2215
BuildRequires: make
16+
BuildRequires: cmake
2317
BuildRequires: git
24-
BuildRequires: desktop-file-utils
25-
%if 0%{?suse_version}
26-
BuildRequires: update-desktop-files
27-
BuildRequires: appstream-glib
28-
%endif
29-
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos}
30-
BuildRequires: libappstream-glib
31-
%endif
32-
%if 0%{?mageia} || "%{?_vendor}" == "openmandriva"
33-
BuildRequires: appstream-util
34-
%endif
3518
BuildRequires: pkgconfig
3619
BuildRequires: pkgconfig(glib-2.0)
3720
BuildRequires: pkgconfig(gio-2.0)
3821
BuildRequires: pkgconfig(gio-unix-2.0)
3922
BuildRequires: pkgconfig(gthread-2.0)
4023
BuildRequires: pkgconfig(alsa)
24+
BuildRequires: pkgconfig(icu-uc)
25+
BuildRequires: pkgconfig(icu-i18n)
4126
BuildRequires: pkgconfig(sqlite3) >= 3.9
4227
BuildRequires: pkgconfig(taglib)
4328
BuildRequires: pkgconfig(fftw3)
44-
BuildRequires: pkgconfig(icu-uc)
45-
BuildRequires: pkgconfig(icu-i18n)
46-
BuildRequires: cmake(Qt@QT_VERSION_MAJOR@Core)
47-
BuildRequires: cmake(Qt@QT_VERSION_MAJOR@Concurrent)
48-
BuildRequires: cmake(Qt@QT_VERSION_MAJOR@Network)
49-
BuildRequires: cmake(Qt@QT_VERSION_MAJOR@Sql)
50-
BuildRequires: cmake(Qt@QT_VERSION_MAJOR@DBus)
51-
BuildRequires: cmake(Qt@QT_VERSION_MAJOR@Gui)
52-
BuildRequires: cmake(Qt@QT_VERSION_MAJOR@Widgets)
53-
BuildRequires: cmake(Qt@QT_VERSION_MAJOR@Test)
54-
BuildRequires: cmake(Qt@QT_VERSION_MAJOR@LinguistTools)
5529
BuildRequires: pkgconfig(gstreamer-1.0)
5630
BuildRequires: pkgconfig(gstreamer-app-1.0)
5731
BuildRequires: pkgconfig(gstreamer-audio-1.0)
@@ -64,13 +38,45 @@ BuildRequires: pkgconfig(libebur128)
6438
BuildRequires: pkgconfig(libgpod-1.0)
6539
BuildRequires: pkgconfig(libmtp)
6640
BuildRequires: pkgconfig(libsparsehash)
67-
BuildRequires: cmake(GTest)
6841
BuildRequires: pkgconfig(gmock)
42+
BuildRequires: cmake(Qt@QT_VERSION_MAJOR@Core)
43+
BuildRequires: cmake(Qt@QT_VERSION_MAJOR@Concurrent)
44+
BuildRequires: cmake(Qt@QT_VERSION_MAJOR@Network)
45+
BuildRequires: cmake(Qt@QT_VERSION_MAJOR@Sql)
46+
BuildRequires: cmake(Qt@QT_VERSION_MAJOR@DBus)
47+
BuildRequires: cmake(Qt@QT_VERSION_MAJOR@Gui)
48+
BuildRequires: cmake(Qt@QT_VERSION_MAJOR@Widgets)
49+
BuildRequires: cmake(Qt@QT_VERSION_MAJOR@Test)
50+
BuildRequires: cmake(Qt@QT_VERSION_MAJOR@LinguistTools)
51+
BuildRequires: cmake(GTest)
52+
BuildRequires: desktop-file-utils
53+
BuildRequires: hicolor-icon-theme
6954

70-
%if 0%{?fedora} || (0%{?suse_version} && 0%{?suse_version} > 1600) || "%{?_vendor}" == "openmandriva"
55+
%if 0%{?suse_version}
56+
BuildRequires: libboost_headers-devel
57+
%else
58+
BuildRequires: boost-devel
59+
%endif
60+
61+
%if (!0%{?suse_version} && !0%{?mageia}) || (0%{?suse_version} && 0%{?suse_version} > 1600)
7162
BuildRequires: cmake(KDSingleApplication-qt6)
7263
%endif
7364

65+
%if 0%{?suse_version}
66+
BuildRequires: update-desktop-files
67+
BuildRequires: appstream-glib
68+
%endif
69+
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos}
70+
BuildRequires: libappstream-glib
71+
%endif
72+
%if 0%{?mageia} || "%{?_vendor}" == "openmandriva"
73+
BuildRequires: appstream-util
74+
%endif
75+
76+
%if "%{?_vendor}" == "openmandriva"
77+
BuildRequires: qt6-qtbase-theme-gtk3
78+
%endif
79+
7480
%if 0%{?suse_version}
7581
Requires: qt6-sql-sqlite
7682
Requires: qt6-network-tls
@@ -104,18 +110,18 @@ Features:
104110
%debug_package
105111
%endif
106112

113+
%if "%{?_vendor}" == "openmandriva"
114+
%define debug_package %{nil}
115+
%endif
116+
107117
%prep
108118
%setup -qn %{name}-@STRAWBERRY_VERSION_PACKAGE@
109119

110120
%build
111-
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos}
112-
export CXXFLAGS="-fPIC -Wno-maybe-uninitialized $RPM_OPT_FLAGS"
113-
%endif
121+
%cmake --log-level=DEBUG -DBUILD_WERROR=ON
114122
%if "%{?_vendor}" == "openmandriva"
115-
%{cmake} -DBUILD_WERROR=ON
116123
%make_build
117124
%else
118-
%{cmake} -DBUILD_WERROR=ON
119125
%cmake_build
120126
%endif
121127

@@ -129,9 +135,9 @@ Features:
129135
%check
130136
export QT_QPA_PLATFORM="offscreen"
131137
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos}
132-
%{cmake_build} -t strawberry_tests
138+
%cmake_build -t strawberry_tests
133139
%else
134-
%{make_build} -j $(nproc) -C build strawberry_tests
140+
%make_build -j $(nproc) -C build strawberry_tests
135141
%endif
136142
desktop-file-validate %{buildroot}%{_datadir}/applications/org.strawberrymusicplayer.strawberry.desktop
137143
%if 0%{?suse_version}

0 commit comments

Comments
 (0)