Blame adwaita-qt.spec

Bernhard M. Wiedemann 1907e3
#
4fdaee
# spec file
Bernhard M. Wiedemann 1907e3
#
4fdaee
# Copyright (c) 2022 SUSE LLC
Bernhard M. Wiedemann 1907e3
# Copyright (c) 2015 Bjørn Lie, Bryne, Norway.
Bernhard M. Wiedemann 1907e3
#
Bernhard M. Wiedemann 1907e3
# All modifications and additions to the file contributed by third parties
Bernhard M. Wiedemann 1907e3
# remain the property of their copyright owners, unless otherwise agreed
Bernhard M. Wiedemann 1907e3
# upon. The license for this file, and modifications and additions to the
Bernhard M. Wiedemann 1907e3
# file, is the same license as for the pristine package itself (unless the
Bernhard M. Wiedemann 1907e3
# license for the pristine package is not an Open Source License, in which
Bernhard M. Wiedemann 1907e3
# case the license is the MIT License). An "Open Source License" is a
Bernhard M. Wiedemann 1907e3
# license that conforms to the Open Source Definition (Version 1.9)
Bernhard M. Wiedemann 1907e3
# published by the Open Source Initiative.
Bernhard M. Wiedemann 1907e3
Bernhard M. Wiedemann 1907e3
# Please submit bugfixes or comments via https://bugs.opensuse.org/
Bernhard M. Wiedemann 1907e3
#
Bernhard M. Wiedemann 1907e3
Bernhard M. Wiedemann 1907e3
4fdaee
%global flavor @BUILD_FLAVOR@%{nil}
4fdaee
%if "%{flavor}" == ""
4fdaee
ExclusiveArch:  do_not_build
4fdaee
%endif
4fdaee
%if "%{flavor}" == "qt5"
4fdaee
  %define qt5 1
4fdaee
  %define qt_min_version 5.15.2
4fdaee
  %define _plugindir %{_libqt5_plugindir}
4fdaee
  %define _suffix %{nil}
4fdaee
%endif
4fdaee
%if "%{flavor}" == "qt6"
4fdaee
  %define qt6 1
4fdaee
  %define qt_min_version 6.2.0
4fdaee
  %define _plugindir %{_qt6_pluginsdir}
4fdaee
  %define _suffix 6
4fdaee
%endif
09b27e
%define sover 1
4fdaee
Name:           adwaita-qt%{?_suffix}%{?_suffix:-src}
4fdaee
Version:        1.4.1
Bernhard M. Wiedemann 1907e3
Release:        0
Bernhard M. Wiedemann 1907e3
Summary:        Adwaita theme for Qt-based applications
Bernhard M. Wiedemann 1907e3
License:        GPL-2.0-or-later AND LGPL-2.1-or-later
Bernhard M. Wiedemann 1907e3
URL:            https://github.com/FedoraQt/adwaita-qt
4fdaee
Source0:        %{url}/archive/%{version}/adwaita-qt-%{version}.tar.gz
4fdaee
BuildRequires:  cmake >= 3.17
Bernhard M. Wiedemann 1907e3
BuildRequires:  fdupes
4fdaee
BuildRequires:  pkgconfig
4fdaee
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150400
4fdaee
BuildRequires:  extra-cmake-modules
4fdaee
%else
4fdaee
BuildRequires:  gcc-c++
4fdaee
%endif
4fdaee
%if 0%{?qt5}
4fdaee
BuildRequires:  cmake(Qt5Core) >= %{qt_min_version}
4fdaee
BuildRequires:  cmake(Qt5DBus)
4fdaee
BuildRequires:  cmake(Qt5Gui)
4fdaee
BuildRequires:  cmake(Qt5Widgets)
4fdaee
BuildRequires:  cmake(Qt5X11Extras)
4fdaee
BuildRequires:  pkgconfig(xcb) >= 1.10
4fdaee
Requires:       adwaita-%{flavor}
cadb48
Obsoletes:      adwaita-qt4 < 1.2.0
4fdaee
%endif
4fdaee
%if 0%{?qt6}
4fdaee
BuildRequires:  cmake(Qt6Core) >= %{qt_min_version}
4fdaee
BuildRequires:  cmake(Qt6DBus)
4fdaee
BuildRequires:  cmake(Qt6Gui)
4fdaee
BuildRequires:  cmake(Qt6Widgets)
4fdaee
Requires:       adwaita-%{flavor}
4fdaee
%endif
Bernhard M. Wiedemann 1907e3
Bernhard M. Wiedemann 1907e3
%description
Bernhard M. Wiedemann 1907e3
Theme to let Qt applications fit nicely into GNOME desktop.
Bernhard M. Wiedemann 1907e3
4fdaee
%package -n adwaita-%{flavor}
4fdaee
Requires:       libadwaita%{flavor}-%{sover} = %{version}-%{release}
4fdaee
%if 0%{?qt5}
Bernhard M. Wiedemann 1907e3
Summary:        Adwaita Qt5 theme
4fdaee
%endif
4fdaee
%if 0%{?qt6}
4fdaee
Summary:        Adwaita Qt6 theme
4fdaee
%endif
4fdaee
%if 0%{?qt5}
Bernhard M. Wiedemann cbd686
Supplements:    (libQt5Core5 and gnome-session)
4fdaee
%endif
4fdaee
%if 0%{?qt6}
4fdaee
Supplements:    (libQt6Core6 and gnome-session)
4fdaee
%endif
Bernhard M. Wiedemann 1907e3
4fdaee
%description -n adwaita-%{flavor}
4fdaee
%if 0%{?qt5}
Bernhard M. Wiedemann 1907e3
Adwaita theme variant for applications utilizing Qt5
4fdaee
%endif
4fdaee
%if 0%{?qt6}
4fdaee
Adwaita theme variant for applications utilizing Qt6
4fdaee
%endif
Bernhard M. Wiedemann 1907e3
4fdaee
%package -n libadwaita%{flavor}-%{sover}
4fdaee
%if 0%{?qt5}
cadb48
Summary:        Adwaita Qt5 library
09b27e
# The package was wwronlgy called  libadwaitaqt1_2_0 in the past
09b27e
# As long as we are at .so.1, we can obsolete this old, wrong
09b27e
# package name
09b27e
Obsoletes:      libadwaitaqt1_2_0
4fdaee
Obsoletes:      libadwaitaqt%{sover} <= 1.4.0
4fdaee
Provides:       libadwaitaqt%{sover} = %{version}
4fdaee
%endif
4fdaee
%if 0%{?qt6}
4fdaee
Summary:        Adwaita Qt6 library
4fdaee
%endif
4fdaee
4fdaee
%description -n libadwaita%{flavor}-%{sover}
4fdaee
%if 0%{?qt5}
cadb48
Adwaita theme variant for applications utilizing Qt5
4fdaee
%endif
4fdaee
%if 0%{?qt6}
4fdaee
Adwaita theme variant for applications utilizing Qt6
4fdaee
%endif
4fdaee
4fdaee
%package -n libadwaita-%{flavor}-devel
4fdaee
Summary:        Development files for libadwaita-%{flavor}
4fdaee
Requires:       libadwaita%{flavor}-%{sover} = %{version}
4fdaee
%if 0%{?qt5}
4fdaee
Obsoletes:      libadwaitaqt-devel <= 1.4.0
4fdaee
Provides:       libadwaitaqt-devel = %{version}
4fdaee
%endif
4fdaee
%if 0%{?qt6}
4fdaee
Requires:       cmake(Qt6Core)
4fdaee
Requires:       cmake(Qt6Widgets)
4fdaee
%endif
4fdaee
4fdaee
%description -n libadwaita-%{flavor}-devel
4fdaee
The libadwaita-%{flavor}-devel package contains libraries and header files for
4fdaee
developing applications that use libadwaita-%{flavor}-%{sover}.
cadb48
Bernhard M. Wiedemann 1907e3
%prep
4fdaee
%autosetup -p1 -n adwaita-qt-%{version}
Bernhard M. Wiedemann 1907e3
Bernhard M. Wiedemann 1907e3
%build
4fdaee
%cmake \
4fdaee
%if 0%{?qt5}
4fdaee
  -DUSE_QT6=false \
4fdaee
%endif
4fdaee
%if 0%{?qt6}
4fdaee
  -DUSE_QT6=true \
4fdaee
%endif
4fdaee
cadb48
%cmake_build
Bernhard M. Wiedemann 1907e3
Bernhard M. Wiedemann 1907e3
%install
Bernhard M. Wiedemann 1907e3
%cmake_install
4fdaee
# qt6 does not have a pc file, so the generated pc we have is invalid, nuke it.
4fdaee
rm -rf %{buildroot}%{_libdir}/pkgconfig/adwaita-qt6.pc
Bernhard M. Wiedemann 1907e3
4fdaee
%ldconfig_scriptlets -n libadwaita%{flavor}-%{sover}
Bernhard M. Wiedemann 1907e3
4fdaee
%files -n adwaita-%{flavor}
Bernhard M. Wiedemann 1907e3
%license LICENSE.LGPL2
Bernhard M. Wiedemann 1907e3
%doc README.md
4fdaee
%dir %{_plugindir}/styles
4fdaee
%{_plugindir}/styles/adwaita.so
4fdaee
4fdaee
%files -n libadwaita%{flavor}-%{sover}
4fdaee
%{_libdir}/libadwaitaqt%{_suffix}.so.*
4fdaee
%{_libdir}/libadwaitaqt%{_suffix}priv.so.*
4fdaee
4fdaee
%files -n libadwaita-%{flavor}-devel
4fdaee
%dir %{_includedir}/AdwaitaQt%{_suffix}
4fdaee
%{_includedir}/AdwaitaQt%{_suffix}/*.h
4fdaee
%dir %{_libdir}/cmake/AdwaitaQt%{_suffix}
4fdaee
%{_libdir}/cmake/AdwaitaQt%{_suffix}/*.cmake
4fdaee
%if 0%{?qt5}
4fdaee
%{_libdir}/pkgconfig/adwaita-qt%{_suffix}.pc
4fdaee
%endif
4fdaee
%{_libdir}/libadwaitaqt%{_suffix}.so
4fdaee
%{_libdir}/libadwaitaqt%{_suffix}priv.so
cadb48
Bernhard M. Wiedemann 1907e3
%changelog