File qadwaitadecorations.spec of Package qadwaitadecorations

#
# spec file for package qadwaitadecorations
#
# Copyright (c) 2025 mantarimay
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == ""
ExclusiveArch:  do_not_build
%endif
%if "@BUILD_FLAVOR@" == "qt5"
%bcond_without qt5
%endif
%if "@BUILD_FLAVOR@" == "qt6"
%bcond_without qt6
%endif
Name:           qadwaitadecorations
Version:        0.1.7
Release:        0
Summary:        Qt decoration plugin implementing Adwaita-like client-side decorations
License:        LGPL-2.1-or-later
URL:            https://github.com/FedoraQt/QAdwaitaDecorations
Source0:        %{url}/archive/%{version}/QAdwaitaDecorations-%{version}.tar.gz
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  wayland-devel

%description
%{summary}.

%if %{with qt5}
%package qt5
Summary:        Qt5 decoration plugin implementing Adwaita-like client-side decorations
BuildRequires:  libqt5-qtbase-devel
BuildRequires:  libqt5-qtbase-private-headers-devel
BuildRequires:  libqt5-qtsvg-devel
BuildRequires:  libqt5-qtwayland-devel
BuildRequires:  libqt5-qtwayland-private-headers-devel

%description qt5
%{summary}.
%endif

%if %{with qt6}
%package qt6
Summary:        Qt6 decoration plugin implementing Adwaita-like client-side decorations
BuildRequires:  qt6-base-devel
BuildRequires:  qt6-base-private-devel
BuildRequires:  qt6-svg-devel
BuildRequires:  qt6-wayland-devel
BuildRequires:  qt6-waylandclient-private-devel

%description qt6
%{summary}.
%endif

%prep
%autosetup -p1 -n QAdwaitaDecorations-%{version}

%build
%if %{with qt5}
%cmake -DHAS_QT6_SUPPORT=true
%cmake_build
%endif
%if %{with qt6}
%cmake -DUSE_QT6=true
%cmake_build
%endif

%install
%cmake_install

%ldconfig_scriptlets

%if %{with qt5}
%files qt5
%doc README.md
%license LICENSE
%{_libqt5_plugindir}/wayland-decoration-client/libqadwaitadecorations.so
%endif

%if %{with qt6}
%files qt6
%doc README.md
%license LICENSE
%{_qt6_pluginsdir}/wayland-decoration-client/libqadwaitadecorations.so
%endif

%changelog
openSUSE Build Service is sponsored by