File NetworkManager-openconnect.spec of Package NetworkManager-openconnect

#
# spec file for package NetworkManager-openconnect
#
# Copyright (c) 2012 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:           NetworkManager-openconnect
Version:        0.9.4.0
Release:        0
Summary:        NetworkManager VPN support for OpenConnect
License:        GPL-2.0+ ; LGPL-2.1
Group:          Productivity/Networking/System
Url:            http://www.gnome.org/projects/NetworkManager
Source0:        http://download.gnome.org/sources/NetworkManager-openconnect/0.9/%{name}-%{version}.tar.xz
# PATCH-FIX-UPSTREAM NetworkManager-openconnect-0.9.4-dropping_privs_check.patch bnc#732915 toddrme2178@gmail.com -- Taken from git, add check for success when dropping privs
Patch0:         NetworkManager-openconnect-0.9.4-dropping_privs_check.patch
BuildRequires:  intltool
BuildRequires:  openconnect-devel
BuildRequires:  translation-update-upstream
BuildRequires:  pkgconfig(NetworkManager) >= 0.9.4
BuildRequires:  pkgconfig(dbus-glib-1)
BuildRequires:  pkgconfig(gconf-2.0)
BuildRequires:  pkgconfig(gtk+-3.0)
BuildRequires:  pkgconfig(libnm-glib) >= 0.9.4
BuildRequires:  pkgconfig(libnm-glib-vpn) >= 0.9.4
BuildRequires:  pkgconfig(libnm-util) >= 0.9.4
BuildRequires:  pkgconfig(libxml-2.0)
Requires:       %{name}-frontend
Requires:       NetworkManager >= 0.8.995
Requires:       openconnect
Requires(pre):  pwdutils
Recommends:     %{name}-lang
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
ExcludeArch:    s390 s390x

%description
NetworkManager-openconnect provides VPN support to NetworkManager for
OpenConnect, an implementation of the Cisco AnyConnect VPN system.

%package gnome
Summary:        NetworkManager VPN support for OpenConnect
Group:          Productivity/Networking/System
Requires:       %{name} = %{version}
Requires:       NetworkManager-gnome >= 0.5.1
Provides:       %{name}-frontend

%description gnome
NetworkManager-openconnect provides VPN support to NetworkManager for
OpenConnect, an implementation of the Cisco AnyConnect VPN system.

%lang_package
%prep
%setup -q
%patch0 -p1
translation-update-upstream

%build
%configure \
        --disable-static
make %{?_smp_mflags}

%install
%make_install
%find_lang %{name} %{?no_lang_C}
find %{buildroot}%{_libdir} -name '*.la' -delete -print

%clean
rm -rf %{buildroot}

%pre
getent group  nm-openconnect >/dev/null || groupadd -r nm-openconnect
getent passwd nm-openconnect >/dev/null || useradd  -r -g nm-openconnect \
                                                    -d %{_localstatedir}/lib/nm-openconnect \
                                                    -s /sbin/nologin \
                                                    -c "NetworkManager user for OpenConnect" \
                                                    nm-openconnect
exit 0

%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING NEWS
%{_libexecdir}/nm-openconnect-service
%{_libexecdir}/nm-openconnect-service-openconnect-helper
%{_sysconfdir}/NetworkManager/VPN/nm-openconnect-service.name
%{_sysconfdir}/dbus-1/system.d/nm-openconnect-service.conf

%files gnome
%defattr(-,root,root,-)
%{_libdir}/NetworkManager/libnm-openconnect-properties.so*
%{_libexecdir}/nm-openconnect-auth-dialog
%{_datadir}/gnome-vpn-properties/

%files lang -f %{name}.lang

%changelog