File adwaita-qt.spec of Package adwaita-qt

#
# spec file for package adwaita-qt
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2015 Bjørn Lie, Bryne, Norway.
#
# 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 http://bugs.opensuse.org/
#


Name:           adwaita-qt
Version:        0.97
Release:        0
Summary:        Adwaita theme for Qt-based applications
License:        GPL-2.0+ and LGPL-2.1+
Group:          System/GUI/GNOME
Url:            https://github.com/MartinBriza/adwaita-qt
Source0:        https://github.com/MartinBriza/adwaita-qt/archive/%{version}.tar.gz
BuildRequires:  cmake
BuildRequires:  fdupes
BuildRequires:  libqt4-devel
BuildRequires:  libqt5-qtbase-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Theme to let Qt applications fit nicely into GNOME desktop.

%package -n adwaita-qt4
Summary:        Adwaita Qt4 theme
Supplements:    packageand(libqt4:gnome-session)

%description -n adwaita-qt4
Adwaita theme variant for applications utilizing Qt4

%package -n adwaita-qt5
Summary:        Adwaita Qt5 theme
Supplements:    packageand(libQt5Core5:gnome-session)

%description -n adwaita-qt5
Adwaita theme variant for applications utilizing Qt5

%prep
%setup -q

%build
# Qt4 build and install
%cmake -DUSE_QT4=ON
make %{?_smp_mflags}
cd ..
%cmake_install

# Qt5 build
%cmake -DUSE_QT4=OFF
make %{?_smp_mflags}

%install
# Qt5 install
%cmake_install

%fdupes -s %{buildroot}%{_datadir}/qt5/plugins/styles/

%files -n adwaita-qt4
%defattr(-,root,root)
%doc LICENSE.LGPL2 README.md
%dir %{_libdir}/qt4/plugins/styles
%{_libdir}/qt4/plugins/styles/adwaita.so

%files -n adwaita-qt5
%defattr(-,root,root)
%doc LICENSE.LGPL2 README.md
%dir %{_libdir}/qt5/plugins/styles
%{_libdir}/qt5/plugins/styles/adwaita.so

%changelog