File minisatip.spec of Package minisatip

#
# spec file for package minisatip
#
# 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:           minisatip
Version:        1.3.2
Release:        1
Summary:        A multi-threaded SAT>IP server
License:        GPL-2.0-or-later
Group:          Hardware/TV
Url:            https://github.com/catalinii/%{name}
# https://github.com/catalinii/minisatip/archive/refs/tags/v1.2.23.tar.gz
Source0:        %{name}-%{version}.tar.gz
Source1:        minisatip.service
Source2:        runminisatip
Source3:        runminisatip.conf
BuildRequires:  gcc-c++
BuildRequires:  libopenssl-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Minisatip is a multi-threaded SAT>IP server that runs under Linux and it was tested with DVB-S, DVB-S2, DVB-T, DVB-T2, DVB-C, DVB-C2, ATSC and ISDB-T cards.
It is tested on x86_64, x86, ARM and MIPS platforms and it requires DVBAPI 5.

%prep
%setup -q

%build
%configure
make %{?_smp_mflags}

%install
install -m 0755 -D minisatip  %{buildroot}%{_bindir}/minisatip
install -m 0644 -D %{SOURCE1} %{buildroot}%{_unitdir}/minisatip.service
install -m 0755 -d            %{buildroot}%{_sbindir}
ln -s /usr/sbin/service       %{buildroot}%{_sbindir}/rcminisatip
install -m 0755 -D %{SOURCE2} %{buildroot}%{_bindir}/runminisatip
install -m 0644 -D %{SOURCE3} %{buildroot}%{_sysconfdir}/runminisatip.conf
install -m 0700 -d            %{buildroot}%{_datadir}/minisatip
cp -a              html       %{buildroot}%{_datadir}/minisatip/
install -m 0700 -d            %{buildroot}%{_localstatedir}/cache/minisatip

%pre
%service_add_pre minisatip.service

%post
%service_add_post minisatip.service

%preun
%service_del_preun minisatip.service

%postun
%service_del_postun minisatip.service

%files
%defattr(-,root,root)
%{_bindir}/minisatip
%{_unitdir}/minisatip.service
%{_sbindir}/rcminisatip
%{_bindir}/runminisatip
%config(noreplace) %{_sysconfdir}/runminisatip.conf
%{_datadir}/minisatip
%{_localstatedir}/cache/minisatip
%ghost  %{_localstatedir}/cache/minisatip/bootid

%changelog
* Thu Sep 29 2022 Walter Laub 1.2.23-0.1
- Initial RPM release
openSUSE Build Service is sponsored by