File libQt6QmlPdWidgets1-1.spec of Package Qt6QmlPdWidgets1

#----------------------------------------------------------------------------
#
# $Id: QtPdWidgets.spec,v 2f71dcf9b977 2013/01/22 14:42:19 fp $
#
# Copyright (C) 2009  Florian Pose <fp@igh-essen.com>
#
# This file is part of the QtPdWidgets library.
#
# The QtPdWidgets library is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# The QtPdWidgets library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with the QtPdWidgets Library. If not, see
# <http://www.gnu.org/licenses/>.
#
# vim: tw=78
#
#----------------------------------------------------------------------------

%define libname Qt6QmlPdWidgets1
%define soversion 1

%define fixed_gcc (0%{?suse_version} > 0 && 0%{?suse_version} < 1600)


Name: lib%{libname}-%{soversion}
Version: 0
Release: 0

Summary: Process data widgets for Qt
License: LGPL-3.0+
Vendor: Ingenieurgemeinschaft IgH GmbH
Group: Productivity/Other
URL: http://etherlab.org/en/pdwidgets/index.php
Source: %{libname}-%{version}.tar.bz2

BuildRequires: fdupes
BuildRequires: libQt6PdCom1-devel
BuildRequires: libQt6PdCom1-qml-devel
Requires:      libQt6PdCom1-qml

%if %fixed_gcc
BuildRequires: gcc10-c++ gcc10
%else
BuildRequires: gcc-c++
%endif

%if 0%{?suse_version}
BuildRequires: libopenssl-devel
BuildRequires: qt6-tools-linguist
BuildRequires: qt6-base-common-devel
BuildRequires: qt6-charts-devel
BuildRequires: qt6-core-devel
BuildRequires: qt6-linguist-devel
BuildRequires: qt6-network-devel
BuildRequires: qt6-quickcontrols2-devel
BuildRequires: qt6-declarative-devel
BuildRequires: qt6-svg-devel
BuildRequires: qt6-xml-devel
BuildRequires: qt6-macros
%else
BuildRequires: qt6-qtbase-devel
BuildRequires: qt6-qtcharts-devel
BuildRequires: qt6-qtdeclarative-devel
BuildRequires: qt6-qtsvg-devel
BuildRequires: qt6-qttools-devel
BuildRequires: qt6-rpm-macros
%endif


#----------------------------------------------------------------------------
# Main Package
#----------------------------------------------------------------------------

%description
This is a bundle of QML-based process data widgets for Qt6.
It uses the QtPdCom library to access the actual process variables.
See http://etherlab.org/en/pdwidgets for more information.

#----------------------------------------------------------------------------
# Development package
#----------------------------------------------------------------------------

%package -n lib%{libname}-devel

Summary: Development files for Applications using %{name}
Group: Development/Libraries/C and C++
Requires: libQt6PdCom1-devel
Requires: lib%{libname}-%{soversion} = %{version}

%description -n lib%{libname}-devel
This is a bundle of QML-based process data widgets for Qt6.
It uses the QtPdCom library to access the actual process variables.
See http://etherlab.org/en/pdwidgets for more information.

#----------------------------------------------------------------------------
# Example application
#----------------------------------------------------------------------------

%package -n pdserv-example-qmlviewer-qt6

Summary:    Qml-based Gui for pdserv-example
Group:      Development/Libraries/C and C++
Recommends: pdserv-example
%if 0%{?suse_version}
Requires:   qt6-charts-imports
Requires:   qt6qmlimport(de.igh.pd)
%else
Requires:   qt6-qtcharts
Requires:   %name
%endif


%description -n pdserv-example-qmlviewer-qt6
Gui which demonstrates how many of the QML-based process data widgets work.
It is designed to interact with the oscillator demo provided by
pdserv-example.

#----------------------------------------------------------------------------

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

#----------------------------------------------------------------------------

%build

%if %fixed_gcc
export CC=gcc-10
export CXX=g++-10
%endif

%cmake \
  -DBUILD_EXAMPLE=1 \
  -DVERSION_HASH=%{version} \
  -DPD_QML_INSTALL_PATH=%{_qt6_qmldir} \
  -DQT_NO_STANDARD_PROJECT_SETUP=1 \
  -DCMAKE_AUTOMOC=1
%cmake_build

#----------------------------------------------------------------------------

%install

%cmake_install
mv %buildroot/%_bindir/Qml6Test %buildroot/%_bindir/pdserv-example-qmlviewer-qt6
# remove plugin so which are also installed in qml tree
rm -v %buildroot/%_libdir/lib%{libname}*plugin.so

%fdupes -s %buildroot/%_prefix

#----------------------------------------------------------------------------

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%defattr(-,root,root)
%doc COPYING README.md
%_libdir/lib%{libname}.so.*
%_libdir/lib%{libname}_style.so.*
%dir %_qt6_qmldir/de
%dir %_qt6_qmldir/de/igh
%_qt6_qmldir/de/igh/pd

%files -n lib%{libname}-devel
%defattr(-,root,root)
%_includedir/%{libname}
%_libdir/cmake/%{libname}
%_libdir/lib%{libname}.so
%_libdir/lib%{libname}_style.so

%files -n pdserv-example-qmlviewer-qt6
%defattr(-,root,root)
%_bindir/pdserv-example-qmlviewer-qt6


#----------------------------------------------------------------------------

%changelog
* Fri Jan  6 2024 Bjarne von Horn
- Fedora support
* Fri Nov 25 2022 Bjarne von Horn
- Initial version

#----------------------------------------------------------------------------
openSUSE Build Service is sponsored by