File Qt6PdCom1.spec of Package QtPdCom1
#----------------------------------------------------------------------------
#
# Copyright (C) 2009-2022 Florian Pose <fp@igh.de>
# 2022 Bjarne von Horn <vh@igh.de>
#
# This file is part of the QtPdCom library.
#
# The QtPdCom 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 QtPdCom 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 QtPdCom Library. If not, see <http://www.gnu.org/licenses/>.
#
#----------------------------------------------------------------------------
%define projectname QtPdCom1
%define soversion 2
%define libname Qt6PdCom1
%define package_headers 0
%define fixed_gcc (0%{?suse_version} > 0 && 0%{?suse_version} < 1600)
Version: 0
Release: 0
Name: libQt6PdCom1-%{soversion}
Summary: Process data communication library for Qt
License: LGPL-3.0+
Vendor: Ingenieurgemeinschaft IgH GmbH
Group: Productivity/Other
URL: https://gitlab.com/etherlab.org/qtpdcom
Source: %{projectname}-%{version}.tar.bz2
%{echo: suse_version is %{?suse_version}}
%{echo: sle_version is %{?sle_version}}
%{echo: is_opensuse is %{?is_opensuse}}
BuildRequires: fdupes cmake
BuildRequires: libpdcom5-devel
%if %fixed_gcc
BuildRequires: gcc10-c++ gcc10
%else
BuildRequires: gcc-c++
%endif
BuildRequires: doxygen graphviz
BuildRequires: python3 python3-PyYAML
%if 0%{?fedora}
BuildRequires: qt6-qtdeclarative-devel
BuildRequires: qt6-qttools-devel
BuildRequires: qt6-qtbase-devel
%else
BuildRequires: qt6-core-devel
BuildRequires: qt6-qml-devel
BuildRequires: qt6-gui-devel
BuildRequires: qt6-linguist-devel
BuildRequires: qt6-network-devel
BuildRequires: qt6-tools-devel
BuildRequires: qt6-xml-devel
%endif
#----------------------------------------------------------------------------
# Main Package
#----------------------------------------------------------------------------
%description
This is a Qt6 implementation of the PdCom 5 interface, containing a
PdCom::Process class implementation using Qt's network layer. ScalarSubscriber
and ScalarVariable classes are included to provide process data access via
signals and slots. Messaging ist supported via the MessageModel class.
#----------------------------------------------------------------------------
# Development package
#----------------------------------------------------------------------------
%package -n lib%{libname}-devel
Summary: Development files for Applications using %{libname}
Group: Development/Libraries/C and C++
Requires: lib%{libname}-%{soversion} = %{version}
Requires: libpdcom5-devel
Requires: lib%{projectname}-headers = %{version}
%description -n lib%{libname}-devel
This is a Qt6 implementation of the PdCom 5 interface, containing a
PdCom::Process class implementation using Qt's network layer. ScalarSubscriber
and ScalarVariable classes are included to provide process data access via
signals and slots. Messaging ist supported via the MessageModel class.
#----------------------------------------------------------------------------
# QML package
#----------------------------------------------------------------------------
%package -n lib%{libname}-qml
Summary: QML module for %{libname}
Group: Productivity/Other
%description -n lib%{libname}-qml
This is a Qt5/Qt6 implementation of the PdCom 5 interface, containing a
PdCom::Process class implementation using Qt's network layer. ScalarSubscriber
and ScalarVariable classes are included to provide process data access via
signals and slots. Messaging ist supported via the MessageModel class.
This package contains QML bindings for %{libname}.
#----------------------------------------------------------------------------
# QML package
#----------------------------------------------------------------------------
%package -n lib%{libname}-qml-devel
Summary: QML module for %{libname}, devel files
Group: Productivity/Other
Requires: lib%{libname}-qml = %version
Requires: lib%{libname}-devel = %version
%description -n lib%{libname}-qml-devel
This is a Qt5/Qt6 implementation of the PdCom 5 interface, containing a
PdCom::Process class implementation using Qt's network layer. ScalarSubscriber
and ScalarVariable classes are included to provide process data access via
signals and slots. Messaging ist supported via the MessageModel class.
This package contains QML bindings for %{libname}.
%if 0%{?package_headers}
#----------------------------------------------------------------------------
# Headers package
#----------------------------------------------------------------------------
%package -n lib%{projectname}-headers
Summary: Headers for Applications using %{libname}
Group: Development/Libraries/C and C++
Requires: libpdcom5-devel
BuildArch: noarch
%description -n lib%{projectname}-headers
This is a Qt5/Qt6 implementation of the PdCom 5 interface, containing a
PdCom::Process class implementation using Qt's network layer. ScalarSubscriber
and ScalarVariable classes are included to provide process data access via
signals and slots. Messaging ist supported via the MessageModel class.
#----------------------------------------------------------------------------
# Development documentation package
#----------------------------------------------------------------------------
%package -n lib%{projectname}-doc
Summary: Documentation for %{libname}
Group: System/Libraries
BuildArch: noarch
%description -n lib%{projectname}-doc
Doxygen-generated API documentation for %{projectname}
%endif
#----------------------------------------------------------------------------
%prep
%setup -q -n %{projectname}-%{version}
#----------------------------------------------------------------------------
%build
pushd .
%if %fixed_gcc
export CC=gcc-10
export CXX=g++-10
%endif
%cmake -DVERSION_HASH=%{version} \
-DUSE_QT6=1 -DPUT_QT_MAJOR_INTO_LIBNAME=1 \
-DUSE_SYMBOL_VERSIONING=1
%cmake_build
popd
doxygen
#----------------------------------------------------------------------------
%install
pushd .
%cmake_install
popd
%if 0%{?package_headers}
# headers are provided elsewhere
mv doc/html .
%fdupes -s html
%else
rm -r %{buildroot}/%{_includedir}
rm -r doc/html
%endif
%fdupes -s %buildroot/%_prefix
#----------------------------------------------------------------------------
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root)
%doc AUTHORS COPYING NEWS README.md
%_libdir/lib%{libname}.so.*
%if 0%{?package_headers}
%files -n lib%{projectname}-headers
%defattr(-,root,root)
%_includedir/%{projectname}
%_includedir/%{projectname}.h
%files -n lib%{projectname}-doc
%defattr(-,root,root)
%doc html
%endif
%files -n lib%{libname}-devel
%defattr(-,root,root)
%dir %_libdir/cmake/%{libname}
%_libdir/cmake/%{libname}/%{libname}Targets*.cmake
%_libdir/cmake/%{libname}/%{libname}Config*.cmake
%_libdir/lib%{libname}.so
%dir %_libdir/qt6/metatypes
%_libdir/qt6/metatypes/qt6qt6pdcom1*_metatypes.json
%files -n lib%{libname}-qml-devel
%defattr(-,root,root)
%_libdir/cmake/%{libname}/%{libname}plugin*.cmake
%_libdir/cmake/%{libname}/%{libname}_qmldir*.cmake
%_libdir/cmake/%{libname}/%{libname}-Qml-config*.cmake
%files -n lib%{libname}-qml
%defattr(-,root,root)
%dir %_libdir/qt6/qml/de
%dir %_libdir/qt6/qml/de/igh
%_libdir/qt6/qml/de/igh/qtpdcom
#----------------------------------------------------------------------------
%changelog
* Fri Dec 15 2023 Bjarne von Horn
- Split headers from devel package for Qt6 support.
* Fri Jan 06 2023 Bjarne von Horn
- Fedora support
* Fri Nov 25 2022 Florian Pose
- Taken from QtPdWidgets2:pdcom
#----------------------------------------------------------------------------