File osmo-cbc.spec of Package osmo-cbc

#
# spec file for package osmo-cbc
#
# Copyright (c) 2019-2024, Martin Hauke <mardnh@gmx.de>
#
# 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 http://bugs.opensuse.org/
#

Name:           osmo-cbc
Version:        0.5.1.7
Release:        0
Summary:        Osmocom Cell Broadcast Centre
License:        AGPL-3.0-or-later
Group:          Productivity/Telephony/Utilities
URL:            https://projects.osmocom.org/projects/osmo-cbc
#Git-Clone:     https://gitea.osmocom.org/cellular-infrastructure/osmo-cbc
Source:         %{name}-%{version}.tar.xz
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  libtool
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(libosmo-netif) >= 1.5.0
BuildRequires:  pkgconfig(libosmocore) >= 1.10.0
BuildRequires:  pkgconfig(libosmogsm) >= 1.10.0
BuildRequires:  pkgconfig(libosmovty) >= 1.10.0
BuildRequires:  pkgconfig(libulfius)
BuildRequires:  pkgconfig(systemd)

%description
Osmocom Cell Broadcast Centre.

%package utils
Summary:        CLI utility to interface osmo-cbc REST interface
License:        MIT
Group:          Productivity/Telephony/Utilities
Requires:       python3-requests
BuildArch:      noarch

%description utils
CLI utility to interface with the osmo-cbc REST interface (ECBE).

%package -n libosmo-sbcap2
Summary:        Osmocom's library to encode/decode SBc-AP messages
Group:          System/Libraries

%description -n libosmo-sbcap2
Osmocom's library to encode/decode SBc-AP messages.

%package -n libosmo-sbcap-devel
Summary:        Development files for libosmo-sbcap
Group:          Development/Libraries/C and C++
Requires:       libosmo-sbcap2 = %{version}

%description -n libosmo-sbcap-devel
Osmocom's library to encode/decode SBc-AP messages.

This subpackage contains libraries and header files for developing
applications that want to make use of libosmo-sbcap.

%prep
%setup -q
sed -i 's|#!%{_bindir}/env python3|#!%{_bindir}/python3|g' contrib/cbc-apitool.py

%build
echo "%{version}" >.tarball-version
autoreconf -fiv
%configure \
  --docdir=%{_docdir}/%{name} \
  --with-systemdsystemunitdir=%{_unitdir}
%make_build

%install
%make_install
install -D -m0755 contrib/cbc-apitool.py %{buildroot}/%{_bindir}/cbc-apitool
find %{buildroot} \( -name '*.la' -o -name '*.a' \) -delete -print

%check
%make_build check || (find . -name testsuite.log -exec cat {} +)

%preun
%service_del_preun %{name}.service

%postun
%service_del_postun %{name}.service

%pre
%service_add_pre %{name}.service

%post
%service_add_post %{name}.service

%ldconfig_scriptlets -n libosmo-sbcap2

%files
%license COPYING
%doc README.md
%dir %{_docdir}/%{name}/examples
%dir %{_docdir}/%{name}/examples/osmo-cbc
%{_docdir}/%{name}/examples/osmo-cbc/osmo-cbc*.cfg
%{_bindir}/osmo-cbc
%{_unitdir}/osmo-cbc.service
%dir %{_sysconfdir}/osmocom
%config(noreplace) %{_sysconfdir}/osmocom/osmo-cbc.cfg

%files utils
%{_bindir}/cbc-apitool

%files -n libosmo-sbcap2
%{_libdir}/libosmo-sbcap.so.2*

%files -n libosmo-sbcap-devel
%{_libdir}/libosmo-sbcap.so
%{_libdir}/pkgconfig/libosmo-sbcap.pc
%dir %{_includedir}/osmocom
%dir %{_includedir}/osmocom/sbcap
%{_includedir}/osmocom/sbcap/*.h

%changelog
openSUSE Build Service is sponsored by