File hyperion.ng.spec of Package hyperion

#
# spec file for package nasm
#
# Copyright (c) 2022 SUSE LLC
#
# 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/
#

Name:           hyperion.ng
Version:        git
Release:        0
Summary:        The successor to Hyperion aka Hyperion Next Generation
License:        MIT
URL:            https://github.com/hyperion-project/hyperion.ng/
Source:         %{name}-%{version}.tar.xz
BuildRequires:  cmake
BuildRequires:  pkgconfig
BuildRequires:  libqt5-qtbase-devel
BuildRequires:  mbedtls-devel
BuildRequires:  fdupes
BuildRequires:  update-desktop-files
BuildRequires:  cmake(Qt5SerialPort)
BuildRequires:  cmake(Qt5Svg)
BuildRequires:  cmake(Qt5X11Extras)
#BuildRequires:  cmake(Flatbuffers)
BuildRequires:  flatbuffers-devel
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(libusb)
BuildRequires:  pkgconfig(libturbojpeg)
BuildRequires:  pkgconfig(python3)
BuildRequires:  pkgconfig(protobuf)
BuildRequires:  pkgconfig(xcb-image)
BuildRequires:  pkgconfig(xcb-event)
BuildRequires:  pkgconfig(libcec)
Requires:       libQt5Sql5-sqlite

%description
Hyperion is an opensource Bias or Ambient Lighting implementation which you
might know from TV manufacturers. It supports many LED devices and video grabbers.

%prep
%autosetup -p1

%build
%ifarch x86_64 i586 i486 i386
%cmake -DPLATFORM=x11 \
       -DENABLE_MDNS=OFF \
       -DENABLE_DEPLOY_DEPENDENCIES=OFF \
       -DUSE_SYSTEM_FLATBUFFERS_LIBS=ON \
       -DUSE_SYSTEM_PROTO_LIBS=ON \
       -DUSE_SYSTEM_MBEDTLS_LIBS=ON \
       -DCMAKE_BUILD_TYPE=Release \
       -DBUILD_SHARED_LIBS:BOOL=OFF \
       -DBUILD_STATIC_LIBS:BOOL=ON
%else
%ifarch aarch64 armv7l armv7hl armv6l armv6hl
%cmake -DPLATFORM=rpi \
       -DENABLE_MDNS=OFF \
       -DENABLE_DEPLOY_DEPENDENCIES=OFF \
       -DUSE_SYSTEM_FLATBUFFERS_LIBS=ON \
       -DUSE_SYSTEM_PROTO_LIBS=ON \
       -DUSE_SYSTEM_MBEDTLS_LIBS=ON \
       -DCMAKE_BUILD_TYPE=Release \
       -DBUILD_SHARED_LIBS:BOOL=OFF \
       -DBUILD_STATIC_LIBS:BOOL=ON
%endif
%endif
%cmake_build

%install
DESTDIR=%buildroot /usr/bin/make install/strip -C build
rm -f %buildroot/%_bindir/*
mv %buildroot/%_datadir/hyperion/bin/* %buildroot/%_bindir/
rm -rf %buildroot/%_datadir/hyperion/bin
rm -rf %buildroot/%_datadir/hyperion/scripts
rm -f %buildroot/%_datadir/hyperion/service/hyperion.init
rm -f %buildroot/%_datadir/hyperion/service/hyperion.initctl

%fdupes %buildroot

%service_add_pre hyperion.systemd
%post
%service_add_post hyperion.systemd
%preun
%service_del_preun hyperion.systemd
%postun
%service_del_postun hyperion.systemd

%files
%license LICENSE
%_bindir/*
%dir %_datadir/hyperion/
%_datadir/hyperion/*

%changelog
openSUSE Build Service is sponsored by