File libPdQmlWidgets2-2.spec of Package PdQmlWidgets

#----------------------------------------------------------------------------
#
# $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 PdQmlWidgets2
%define soversion 2

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: libQtPdCom1-devel

%if 0%{?suse_version}
BuildRequires: libqt5-qttools-devel
BuildRequires: libqt5-qtbase-common-devel
BuildRequires: libQt5Charts5-devel
BuildRequires: libQt5Core-devel
BuildRequires: libQt5Network-devel
BuildRequires: libQt5QuickControls2-devel
BuildRequires: libQt5Widgets-devel
BuildRequires: libqt5-qtdeclarative-devel
BuildRequires: libqt5-qtsvg-devel
%else
BuildRequires: qt5-qtbase-devel
BuildRequires: qt5-qtcharts-devel
BuildRequires: qt5-qtdeclarative-devel
BuildRequires: qt5-qtquickcontrols2-devel
BuildRequires: qt5-qtsvg-devel
BuildRequires: qt5-qttools-devel
# for obs service scm
BuildRequires: glibc-langpack-en
%endif

# workaround for missing choice
%if 0%{?fedora} == 36
BuildRequires: clang-libs
%endif

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

%description
This is a bundle of QML-based process data widgets for Qt5.
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: libQtPdCom1-devel
Requires: lib%{libname}-%{soversion} = %{version}

%description -n lib%{libname}-devel
This is a bundle of QML-based process data widgets for Qt5.
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

Summary:    Qml-based Gui for pdserv-example
Group:      Development/Libraries/C and C++
Recommends: pdserv-example


%description -n pdserv-example-qmlviewer
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

%cmake -DBUILD_EXAMPLE=1 -DVERSION_HASH=%{version}
%cmake_build

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

%install

%cmake_install
mv %buildroot/%_bindir/QmlTest %buildroot/%_bindir/pdserv-example-qmlviewer

%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/qt5/qml

%files -n lib%{libname}-devel

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

%files -n pdserv-example-qmlviewer

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


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

%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