File qlcplus5.spec of Package qlcplus5
#
# spec file for package qlcplus5
#
# Copyright (c) 2025 SUSE LLC
# Copyright (c) 2025 edogawa@aon.at
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
# disable debuginfo packages for all target repos (some don't obey repo setup)
%global debug_package %{nil}
Name: qlcplus5
Version: 5.1.0
Release: 0
Summary: Q Light Controller Plus - The free DMX lighting console
License: Apache-2.0
Group: Productivity/Multimedia/Other
URL: http://www.qlcplus.org/
Source0: %{name}-%{version}.tar.xz
Patch0: %{name}-udev.patch
Patch1: %{name}-lrelease.patch
BuildRequires: desktop-file-utils
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: cmake
BuildRequires: pkgconfig
BuildRequires: glibc-devel
BuildRequires: cmake(Qt6Multimedia)
BuildRequires: cmake(Qt6MultimediaWidgets)
BuildRequires: cmake(Qt6Widgets)
BuildRequires: cmake(Qt6Svg)
BuildRequires: cmake(Qt63DCore)
BuildRequires: cmake(Qt63DRender)
BuildRequires: cmake(Qt63DInput)
BuildRequires: cmake(Qt63DQuickExtras)
BuildRequires: cmake(Qt6PrintSupport)
BuildRequires: cmake(Qt6SerialPort)
BuildRequires: cmake(Qt6Test)
BuildRequires: cmake(Qt6Svg)
BuildRequires: cmake(Qt6WebSockets)
BuildRequires: cmake(Qt6LinguistTools)
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(fftw3)
BuildRequires: pkgconfig(libftdi1)
BuildRequires: pkgconfig(libola)
BuildRequires: pkgconfig(libudev)
BuildRequires: pkgconfig(libusb)
BuildRequires: pkgconfig(cups)
%if %{defined fedora}
BuildRequires: qt6-linguist
BuildRequires: pkgconfig(sndfile)
%else
BuildRequires: cmake(SndFile)
# disable post-build-checks
BuildRequires: -post-build-checks
%endif
Requires(post): /sbin/ldconfig
Requires(post): shared-mime-info
Requires(postun): /sbin/ldconfig
Requires(postun): shared-mime-info
Conflicts: qlcplus qlcplus-git qlcplus-qt5 qlcplus-qt5-git qlcplus-qt6 qlcplus-qt6-git qlcplus5-git
%description
QLC+ is a fork of the great QLC project written
by Heikki Junnila. This project aims to continue
the development of QLC and to introduce new features.
The primary goal is to bring QLC+ at the level
of other lighting control commercial softwares.
## Plugins sub-package ###################
%package -n %{name}-olaplugin
Summary: OLA Plugin for QLC+
Group: Productivity/Multimedia/Other
Requires: %{name}
Requires: ola
%description olaplugin
QLC+ I/O plugin for the OLA (Open Light Architecture) server
#############################################################################
## Preparation ####################
%prep
%autosetup -p1
## Remove Unneeded Files/Dirs ####################
rm -rf debian
rm -rf create-*.sh
rm -rf *.bat
## Build ####################
%build
export QTDIR=/usr/lib64/qt6
export CXXFLAGS="${CXXFLAGS} -Wno-unused-result -idirafter /usr/include"
export CFLAGS="${CFLAGS} -idirafter /usr/include"
%cmake -DCMAKE_PREFIX_PATH=%{_libdir}/cmake/Qt6 \
-DCMAKE_INSTALL_LIBDIR="%_lib" \
-DCMAKE_BUILD_TYPE="Release" \
-Dudev=ON \
-Dqmlui=ON
%cmake_build
## Install ####################
%install
%cmake_install
mkdir -p %{buildroot}%{_udevrulesdir}
mv -v %{buildroot}%{_sysconfdir}/udev/rules.d/* %{buildroot}%{_udevrulesdir}
# remove installed pixmap icon and desktop file
rm %{buildroot}%{_datadir}/pixmaps/qlcplus.png
rm %{buildroot}%{_datadir}/applications/*.desktop
# install alternate svg icon and patched-for-v5 desktop file
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/
install -m 644 ./resources/icons/svg/qlcplus.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/
# correct Exec: binary name in desktop file
sed -i -e 's/qlcplus/qlcplus-qml/' ./platforms/linux/qlcplus.desktop
# install corrected desktop file
install -m 644 ./platforms/linux/qlcplus.desktop %{buildroot}%{_datadir}/applications/qlcplus5.desktop
%fdupes %{buildroot}
## Tests ####################
%check
%if %{defined fedora}
cd redhat-linux-build/
%else
cd build/
%endif
make check
## Post install scripts ####################
%post
/sbin/ldconfig
%mime_database_post
%postun
/sbin/ldconfig
%mime_database_post
## Files ####################
%files
%license COPYING
%{_bindir}/*
%{_libdir}/libqlcplusengine.so
%{_libdir}/libqlcpluswebaccess.a
%{_libdir}/qt6/plugins/qlcplus/*
%{_datadir}/applications/qlcplus5.desktop
%{_datadir}/icons/*
%{_datadir}/qlcplus/*
%{_datadir}/mime/packages/qlcplus.xml
%{_datadir}/metainfo/*
%{_udevrulesdir}/*
%files -n %{name}-olaplugin
%{_libdir}/qt6/plugins/qlcplus/libolaio.so
## Change Log ####################
%changelog