
%global qt_module qtdatavis3d

Summary: Qt6 - Qt Data Visualization component
Name:    qt6-%{qt_module}
Version: 6.5.0
Release: 1

# See LGPL_EXCEPTIONS.txt, LICENSE.GPL3, respectively, for exception details
License: LGPLv2 with exceptions or GPLv3 with exceptions
Url:     http://www.qt.io
%global majmin %(echo %{version} | cut -d. -f1-2)
%global  qt_version %(echo %{version} | cut -d~ -f1)

Source0: https://download.qt.io/official_releases/qt/%{majmin}/%{version}/submodules/%{qt_module}-everywhere-src-%{version}.tar.xz
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: ninja-build
BuildRequires: openssl-devel
BuildRequires: pkgconfig(xkbcommon)
BuildRequires: qt6-qtbase-devel >= %{version}
BuildRequires: qt6-qtbase-private-devel
BuildRequires: qt6-qtdeclarative-devel >= %{version}
%{?_qt6:Requires: %{_qt6}%{?_isa} = %{_qt6_version}}

%description
Qt Data Visualization module provides multiple graph types to visualize data in
3D space both with C++ and Qt Quick 2.

%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: qt6-qtbase-devel%{?_isa}
Requires: qt6-qtdeclarative-devel%{?_isa}
%description devel
%{summary}.

%package examples
Summary: Programming examples for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description examples
%{summary}.


%prep
%autosetup -n %{qt_module}-everywhere-src-%{qt_version} -p1


%build
%cmake_qt6
cmake --build . %{?_smp_mflags} --verbose

%install
DESTDIR="%{buildroot}" cmake --install .

%files
%license LICENSES/GPL*
%{_qt6_libdir}/libQt6DataVisualization.so.6*
%{_qt6_libdir}/libQt6DataVisualizationQml.so.6*
%{_qt6_qmldir}/QtDataVisualization/

%files devel
%dir %{_qt6_libdir}/cmake/Qt6DataVisualization
%dir %{_qt6_libdir}/cmake/Qt6DataVisualizationQml
%{_qt6_headerdir}/QtDataVisualization/
%{_qt6_headerdir}/QtDataVisualizationQml/
%{_qt6_libdir}/libQt6DataVisualization.so
%{_qt6_libdir}/libQt6DataVisualization.prl
%{_qt6_libdir}/libQt6DataVisualizationQml.prl
%{_qt6_libdir}/libQt6DataVisualizationQml.so
%{_qt6_libdir}/cmake/Qt6DataVisualization/*.cmake
%{_qt6_libdir}/cmake/Qt6DataVisualizationQml/*.cmake
%{_qt6_archdatadir}/mkspecs/modules/*
%{_qt6_libdir}/cmake/Qt6BuildInternals/StandaloneTests/QtDataVisualizationTestsConfig.cmake
%{_qt6_libdir}/cmake/Qt6Qml/QmlPlugins/*.cmake
%{_qt6_archdatadir}/modules/*.json
%{_qt6_archdatadir}/metatypes/qt6*_metatypes.json
%{_qt6_libdir}/pkgconfig/*.pc

%if 0%{?_qt6_examplesdir:1}
# no examples, yet
%files examples
%{_qt6_examplesdir}/
%endif


%changelog
* Fri May 5 2023 EastDong <xudong23@iscas.ac.cn> - 6.5.0-1
- update package

* Wed Nov 16 2022 Jingwiw <wangjingwei@iscas.ac.cn> - 6.4.0-1
- init package
