File ofono.spec of Package ofono

#
# spec file for package ofono
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2014 Sergey Kondakov <virtuousfox@gmail.com>.
# Copyright (c) 2014 Bernd Wachter <bwachter@lart.info>.
#
# 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:           ofono
Version:        1.23
Release:        0
Summary:        Mobile telephony application development framework
License:        GPL-2.0-only
Group:          Productivity/Telephony/Utilities
Url:            https://01.org/ofono
Source0:        https://www.kernel.org/pub/linux/network/ofono/%{name}-%{version}.tar.xz
Source1:        https://www.kernel.org/pub/linux/network/ofono/sha256sums.asc#/%{name}-%{version}.tar.xz.sig
Source2:        http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x589DA6B1#/%{name}.keyring
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(bluez) >= 4.85
BuildRequires:  pkgconfig(dbus-1)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(libudev) >= 145
BuildRequires:  pkgconfig(mobile-broadband-provider-info)
BuildRequires:  pkgconfig(systemd)
BuildRequires:  pkgconfig(udev)
%systemd_requires

%description
oFono provides a mobile telephony (GSM/UMTS) application development
framework. It includes a high-level D-Bus API for use by telephony
applications, and a low-level plug-in API for integration with other
stacks, cellular modems, and storage back ends. The plug-in API
functionality is modeled on public standards, in particular 3GPP TS
27.007 "AT command set for User Equipment (UE)".

%package devel
Summary:        Development files for ofono, a mobile telephony framework
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}

%description devel
oFono provides a mobile telephony (GSM/UMTS) application development
framework. It includes a high-level D-Bus API for use by telephony
applications, and a low-level plug-in API.

This subpackage contains the header files for developing
applications that want to make use of ofono.

%package tests
Summary:        Test Scripts for oFono
Group:          Productivity/Telephony/Utilities
Requires:       %{name} = %{version}
Provides:       ofono-test >= 1.0
Obsoletes:      ofono-test < 1.0

%description tests
Scripts for testing oFono and its functionality.

%prep
%setup -q

%build
%configure \
  --disable-static \
  --enable-pie \
  --enable-threads \
  --enable-test \
  --with-systemdunitdir="%{_libexecdir}/systemd/system"
make %{?_smp_mflags} V=1

%install
%make_install

ln -sv %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}

mkdir -p %{buildroot}%{_libexecdir}/systemd/system/network.target.wants
ln -s ../ofono.service %{buildroot}%{_libexecdir}/systemd/system/network.target.wants/ofono.service

%pre
%service_add_pre ofono.service

%post
%service_add_post ofono.service

%preun
%service_del_preun ofono.service

%postun
%service_del_postun ofono.service

%files
%doc ChangeLog README COPYING
%{_sbindir}/ofonod
%{_sbindir}/rc%{name}
%{_mandir}/man8/ofonod.8%{?ext_man}
%{_unitdir}/ofono.service
%{_libexecdir}/systemd/system/network.target.wants/ofono.service
%dir %{_libexecdir}/systemd/system/network.target.wants
%config %{_sysconfdir}/ofono/
%config %{_sysconfdir}/dbus-1/system.d/ofono.conf

%files devel
%doc ChangeLog README COPYING
%dir %{_includedir}/ofono/
%{_includedir}/ofono/*
%{_libdir}/pkgconfig/ofono.pc

%files tests
%doc ChangeLog README COPYING
%{_libdir}/%{name}/test/*
%dir %{_libdir}/%{name}/test
%dir %{_libdir}/%{name}

%changelog