File hexagonrpc.spec of Package hexagonrpc
#
# spec file for package phosh
#
# 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/
#
%define libname libhexagonrpc0_3
Name: hexagonrpc
Version: v0.4.0
Release: 0
Summary: FastRPC ioctl wrapper and a reverse tunnel
License: GPL-3.0-or-later
URL: https://github.com/linux-msm/hexagonrpc
Source0: %{name}-%{version}.tar.xz
Source1: hexagonrpcd-adsp-rootpd.service
Source2: hexagonrpcd-adsp-sensorspd.service
Source3: hexagonrpcd-sdsp.service
BuildRequires: systemd-rpm-macros
BuildRequires: cmake
BuildRequires: gcc
BuildRequires: meson
%description
FastRPC is used to communicate with the Context Hub Runtime Environment, a program on the DSP that manages sensors, and to serve files to remote processors.
%package -n %{libname}
Summary: FastRPC ioctl wrapper and a reverse tunnel
Group: System/Libraries
%description -n %{libname}
FastRPC ioctl wrapper and a reverse tunnel
%package devel
Summary: Header files for Fastrpc
Group: Development
Requires: %{name} = %{version}
%description devel
Devel files for FastRPC ioctl wrapper and a reverse tunnel
%prep
%autosetup -p1
%build
%meson
%meson_build
%install
%meson_install
%{__install} -Dm0644 -t %{buildroot}%{_unitdir} %{SOURCE1} %{SOURCE2} %{SOURCE3}
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%pre -n %{name}
%service_add_pre hexagonrpcd-adsp-rootpd.service hexagonrpcd-adsp-sensorspd.service hexagonrpcd-sdsp.service
%post -n %{name}
%service_add_post hexagonrpcd-adsp-rootpd.service hexagonrpcd-adsp-sensorspd.service hexagonrpcd-sdsp.service
%preun -n %{name}
%service_del_preun hexagonrpcd-adsp-rootpd.service hexagonrpcd-adsp-sensorspd.service hexagonrpcd-sdsp.service
%postun -n %{name}
%service_del_postun_without_restart hexagonrpcd-adsp-rootpd.service hexagonrpcd-adsp-sensorspd.service hexagonrpcd-sdsp.service
%files
%doc %{_datadir}/man/man1/hexagonrpcd.1.gz
%{_bindir}/hexagonrpcd
%dir %{_libexecdir}/hexagonrpc/
%{_libexecdir}/hexagonrpc/chrecd
%{_unitdir}/*
%files -n %{libname}
%{_libdir}/lib%{name}.so.*
%files devel
%{_libdir}/libhexagonrpc.so
%changelog