File python-qcustomplot-pyqt.spec of Package python-qcustomplot-pyqt

#
# spec file for package python-qcustomplot
#
# Copyright (c) 2019-2026 Sergey Salnikov <salsergey@gmail.com>
#

%global qcustomplot_flavor @BUILD_FLAVOR@%{nil}
%if "%{qcustomplot_flavor}" == ""
ExclusiveArch:  do_not_build
%endif
%if "%{qcustomplot_flavor}" == "qt6"
%define qt6 1
%define qt_major 6
%endif
%if "%{qcustomplot_flavor}" == "qt5"
%define qt5 1
%define qt_major 5
%endif

%define pname python-qcustomplot-pyqt
%if 0%{?qt_major}
%define libname %{pname}%{qt_major}
%endif

Name:          %{pname}%{qt_major}
Summary:       Qt C++ widget for plotting and data visualization
Version:       2.1.1.2
Release:       3
Group:         Development/Libraries/Python
License:       MIT
Url:           https://github.com/salsergey/QCustomPlot-PyQt

Source0:       %{pname}-%{version}.tar.xz

%if "%{qcustomplot_flavor}" == "qt5"
BuildRequires: libqt5-qtbase-devel
BuildRequires: python3-qt5-devel
%endif

%if 0%{?suse_version}
BuildRequires: python3-sip6-devel
BuildRequires: python3-pyqt-builder
%if "%{qcustomplot_flavor}" == "qt6"
BuildRequires: qt6-base-devel
BuildRequires: python3-qt6-devel
%if 0%{?suse_version} > 1600
BuildRequires: qcustomplot-qt6-devel >= 2.1.0
%endif
%endif
%if "%{qcustomplot_flavor}" == "qt5"
BuildRequires: qcustomplot-qt5-devel >= 2.1.0
%endif
%endif

%if 0%{?fedora}
BuildRequires: python3-devel
BuildRequires: PyQt-builder
BuildRequires: python3dist(sip)
BuildRequires: qcustomplot-qt%{qt_major}-devel
%if "%{qcustomplot_flavor}" == "qt6"
BuildRequires: python3-pyqt6-devel
BuildRequires: qt6-qtbase-devel
%endif
%endif

%if 0%{?mageia}
BuildRequires: python3-devel
BuildRequires: python3-pyqt-builder
BuildRequires: python3dist(pyqt%{qt_major})
BuildRequires: python3-sip6
BuildRequires: lib64qcustomplot-qt%{qt_major}-devel
%if "%{qcustomplot_flavor}" == "qt6"
BuildRequires: python3-qt6-devel
%endif
%endif

Requires:      python3-PyQt%{qt_major}
%if 0%{?fedora}
Requires:      qcustomplot-qt%{qt_major} >= 2.1.0
%endif
%if 0%{?mageia}
Requires:      lib64qcustomplot-qt%{qt_major}_2 >= 2.1.0
%endif
Provides:      python3-qcustomplot == %{version}
Provides:      python3-qcustomplot-pyqt%{qt_major} == %{version}

BuildRoot:      %{_tmppath}/%{name}-%{version}-build


%if 0%{?fedora} || 0%{?mageia}
%global debug_package %{nil}
%endif


%description
QCustomPlot is a Qt C++ widget for plotting and data visualization.
It has no further dependencies and is well documented.
This plotting library focuses on making good looking, publication quality 2D plots,
graphs and charts, as well as offering high performance for realtime visualization applications.
Have a look at the Setting Up and the Basic Plotting tutorials to get started.

Authors:
--------
    Emanuel Eichhammer <support@qcustomplot.com>


%prep
%setup -q -n %{pname}-%{version}


%build
%if "%{qcustomplot_flavor}" == "qt5"
%if 0%{?suse_version} == 1600
sip-build --verbose --jobs %{jobs} \
          --qmake %{_bindir}/qmake-qt5\
          --no-static-qcustomplot
%else
sip-build --verbose --jobs %{jobs} \
          --qmake %{_bindir}/qmake-qt5 \
          --no-static-qcustomplot \
          --qcustomplot-lib qcustomplot-qt5
%endif
%endif
    
%if "%{qcustomplot_flavor}" == "qt6"
%if 0%{?suse_version} == 1600
sip-build --verbose --jobs %{jobs} \
          --qmake %{_bindir}/qmake6
%endif
%if 0%{?suse_version} > 1600 || 0%{?fedora}
sip-build --verbose --jobs %{jobs} \
          --qmake %{_bindir}/qmake6 \
          --no-static-qcustomplot \
          --qcustomplot-lib qcustomplot-qt6
%endif
%if 0%{?mageia}
sip-build --verbose --jobs %{jobs} \
          --qmake %{_bindir}/qmake-qt6 \
          --no-static-qcustomplot \
          --qcustomplot-lib qcustomplot-qt6
%endif
%endif


%install
cd build
make INSTALL_ROOT=%{buildroot} install


%files
%defattr(-,root,root)
%doc README.md examples
%license LICENSE*.txt
%{_prefix}/%{_lib}/python%{python3_version}/site-packages/QCustomPlot_PyQt%{qt_major}*
%if 0%{?suse_version}
%{_prefix}/%{_lib}/python%{python3_version}/site-packages/qcustomplot_pyqt%{qt_major}*
%endif

%changelog
openSUSE Build Service is sponsored by