File ModemManager.spec of Package ModemManager.openSUSE_13.1_Update

#
# spec file for package ModemManager
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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:           ModemManager
Version:        1.0.0
Release:        0
# FIXME: enable qmi-glib and mbim-glib support once we have a package for it.
Summary:        DBus interface for modem handling
License:        GPL-2.0+ and GPL-3.0+
Group:          Productivity/Networking/System
Url:            http://cgit.freedesktop.org/ModemManager/ModemManager
Source0:        http://www.freedesktop.org/software/%{name}/%{name}-%{version}.tar.xz
Source1:        50-cdc_ncm.conf
BuildRequires:  dbus-1-glib-devel
BuildRequires:  hicolor-icon-theme
BuildRequires:  intltool >= 0.40.0
BuildRequires:  libgudev-1_0-devel
BuildRequires:  ppp-devel
BuildRequires:  pkgconfig(gudev-1.0) >= 147
#BuildRequires:  pkgconfig(mbim-glib)
BuildRequires:  pkgconfig(polkit-gobject-1) >= 0.97
BuildRequires:  pkgconfig(systemd)
#BuildRequires:  pkgconfig(qmi-glib)
Requires:       hicolor-icon-theme
Recommends:     usb_modeswitch
Provides:       org.freedesktop.ModemManager
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%define _udevdir %(pkg-config --variable udevdir udev)
%{?systemd_requires}

%description
DBus interface for modem handling. Provides a standard abstracted API
(over DBus) to communicate with all sorts of modems (landline, GSM,
CDMA).

%package -n libmm-glib0
Summary:        DBus interface for modem handling -- GLib bindings
Group:          System/Libraries

%description -n libmm-glib0
DBus interface for modem handling. Provides a standard abstracted API
(over DBus) to communicate with all sorts of modems (landline, GSM,
CDMA).

%package devel
Summary:        DBus interface for modem handling -- Development Files
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}
Requires:       libmm-glib0 = %{version}

%description devel
DBus interface for modem handling. Provides a standard abstracted API
(over DBus) to communicate with all sorts of modems (landline, GSM,
CDMA).

%prep
%setup -q
cp -p %SOURCE1 .

%build
pppddir=`ls -1d %{_libdir}/pppd/2*`
test -n "$pppddir" || exit 1
%configure \
    --disable-static \
    --with-polkit \
    --with-udev-base-dir=%{_udevdir} --without-qmi \
    --without-mbim
%__make %{?_smp_mflags}

%install
%makeinstall
find %{buildroot} -type f -name "*.la" -delete -print
mkdir -p %{buildroot}/etc/modprobe.d/
cp -p 50-cdc_ncm.conf %{buildroot}/etc/modprobe.d/50-cdc_ncm.conf

%pre
%service_add_pre ModemManager.service

%post
%icon_theme_cache_post
%service_add_post ModemManager.service
systemctl --quiet enable ModemManager.service || :

%preun
%service_del_preun ModemManager.service

%postun
%icon_theme_cache_postun
%service_del_postun ModemManager.service

%post -n libmm-glib0 -p /sbin/ldconfig

%postun -n libmm-glib0 -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc COPYING AUTHORS README
%{_bindir}/mmcli
%{_sbindir}/ModemManager
%config %{_sysconfdir}/dbus-1/system.d/org.freedesktop.ModemManager1.conf
%{_libdir}/ModemManager/
%{_datadir}/dbus-1/interfaces/*.xml
%{_datadir}/dbus-1/system-services/org.freedesktop.ModemManager1.service
%{_datadir}/icons/hicolor/*/*/ModemManager.png
%{_datadir}/polkit-1/actions/org.freedesktop.ModemManager1.policy
%{_udevdir}/rules.d/*-mm-*.rules
%{_unitdir}/ModemManager.service
%{_mandir}/man8/mmcli.8%{?ext_man}
%{_mandir}/man8/ModemManager.8%{?ext_man}
/etc/modprobe.d/
/etc/modprobe.d/50-cdc_ncm.conf

%files -n libmm-glib0
%defattr(-,root,root)
%{_libdir}/libmm-glib.so.*

%files devel
%defattr(-,root,root)
%{_includedir}/ModemManager/
%{_includedir}/libmm-glib/
%{_libdir}/libmm-glib.so
%{_libdir}/pkgconfig/ModemManager.pc
%{_libdir}/pkgconfig/mm-glib.pc

%changelog
openSUSE Build Service is sponsored by