File ofono.spec of Package ofono

#
# spec file for package ofono
#
# Copyright (c) 2015 SUSE LINUX Products 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.16
Release:        0
Summary:        Open Source Telephony
License:        GPL-2.0
Group:          Communications/Connectivity Adaptation
Url:            http://ofono.org
Source0:        http://www.kernel.org/pub/linux/network/ofono/ofono-%{version}.tar.xz
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  libtool
BuildRequires:  systemd-rpm-macros
BuildRequires:  pkgconfig(bluez) >= 4.85
BuildRequires:  pkgconfig(dbus-1)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(libudev) >= 145
BuildRequires:  pkgconfig(mobile-broadband-provider-info)
%systemd_requires

%description
oFono aims to provide an easy to use interface that can be used to create
rich telephony applications without requiring one to have a deep understanding
of the underlying technology and its limitations. To accomplish this, oFono
provides language-independent D-Bus API that is extremely easy to use without
generated bindings or other 'messy' steps typically required to use an IPC
based API.

%package devel
Summary:        Open Source Telephony Stack -- Development files
Group:          Development/Libraries
Requires:       %{name} = %{version}

%description devel
oFono aims to provide an easy to use interface that can be used to create
rich telephony applications without requiring one to have a deep understanding
of the underlying technology and its limitations. To accomplish this, oFono
provides language-independent D-Bus API that is extremely easy to use without
generated bindings or other 'messy' steps typically required to use an IPC
based API.

%package tests
Summary:        Test Scripts for oFono
Group:          Development/Libraries
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
autoreconf -fi
%configure --disable-static \
	   --enable-test \
           --with-systemdunitdir="%{_libexecdir}/systemd/system"
make %{?_smp_mflags}

%check check %{?_smp_mflags}

%install
make DESTDIR=%{buildroot} install %{?_smp_mflags}

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
%defattr(-,root,root,-)
%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 /usr/lib/systemd/system/network.target.wants
%config %{_sysconfdir}/ofono/
%config %{_sysconfdir}/dbus-1/system.d/ofono.conf

%files devel
%defattr(-,root,root,-)
%doc ChangeLog README COPYING
%dir %{_includedir}/ofono/
%{_includedir}/ofono/*
%{_libdir}/pkgconfig/ofono.pc

%files tests
%defattr(-,root,root,-)
%doc ChangeLog README COPYING
%{_libdir}/%{name}/test/*
%dir %{_libdir}/%{name}/test
%dir %{_libdir}/%{name}

%changelog
openSUSE Build Service is sponsored by