File gnome-keyring.spec of Package gnome-keyring

#
# spec file for package gnome-keyring
#
# 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:           gnome-keyring
Version:        3.8.0
Release:        0
Url:            http://www.gnome.org/
Summary:        GNOME Keyring
License:        GPL-2.0+ and LGPL-2.1+
Group:          System/GUI/GNOME
Source:         http://download.gnome.org/sources/gnome-keyring/3.8/%{name}-%{version}.tar.xz
Source99:       baselibs.conf
# PATCH-FEATURE-OPENSUSE gnome-keyring-check-session.patch vuntz@novell.com -- Only start gnome-keyring in the pam module if GNOME, Xfce or LXDE is started
Patch4:         gnome-keyring-check-session.patch
# PATCH-FIX-OPENSUSE gnome-keyring-pam-auth-prompt-password.patch bnc466732 bgo560488 vuntz@novell.com -- Make the pam module prompt the password in auth, so we can use pam-config. This is a workaround until bnc#477488 is implemented.
Patch5:         gnome-keyring-pam-auth-prompt-password.patch
BuildRequires:  ca-certificates
BuildRequires:  desktop-file-utils
BuildRequires:  fdupes
BuildRequires:  intltool
BuildRequires:  libcap-ng-devel
BuildRequires:  libgcrypt-devel
BuildRequires:  libselinux-devel
BuildRequires:  pam-devel
BuildRequires:  translation-update-upstream
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(dbus-1) >= 1.1.1
BuildRequires:  pkgconfig(gck-1) >= 3.3.4
BuildRequires:  pkgconfig(gcr-3) >= 3.5.3
BuildRequires:  pkgconfig(glib-2.0) >= 2.32.0
BuildRequires:  pkgconfig(libtasn1)
%if 0%{?BUILD_FROM_VCS}
BuildRequires:  gnome-common
BuildRequires:  gtk-doc
%endif
Requires:       libgck-modules-gnome-keyring = %{version}
Recommends:     %{name}-lang
Recommends:     %{name}-pam
# bug437293
%ifarch ppc64
Obsoletes:      gnome-keyring-64bit
%endif
#
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%glib2_gsettings_schema_requires

%description
The GNOME Keyring is a daemon in the session, similar to ssh-agent,
and other applications can use it to store passwords and other
sensitive information.

The program can manage several keyrings, each with its own master
password, and there is also a session keyring which is never stored to
disk, but forgotten when the session ends.

%package -n libgck-modules-gnome-keyring
Summary:        Glib wrapper library for PKCS#11 - Modules
Group:          System/GUI/GNOME
# libgck-X-Y has a Provides for gck, just to help us with this Requires
Requires:       gck
# libgp11 used to be the library providing all this. It turns out the
# modules are, as of 2.91.3, installed in the same place
Obsoletes:      libgp11-modules < %{version}
# starting with 3.3, libgck got split from gnome-keyring and so we can't use a
# generic name like libgck-modules anymore.
Obsoletes:      libgck-modules < %{version}

%description -n libgck-modules-gnome-keyring
GCK is a wrapper based on GLib implementing the PKCS#11 (Cryptoki)
interface.

This package contains various PKCS#11 modules, to expose keys and
certificates from different sources.

%package pam
Summary:        GNOME Keyring - PAM module
Group:          System/GUI/GNOME
Requires:       %{name} = %{version}
PreReq:         pam-config >= 0.72
PreReq:         sed
# Package was present in OpenSUSE 10.2 and 10.3:
Provides:       pam_keyring = 0.0.8
Obsoletes:      pam_keyring < 0.0.8

%description pam
The GNOME Keyring is a daemon in the session, similar to ssh-agent,
and other applications can use it to store passwords and other
sensitive information.

The program can manage several keyrings, each with its own master
password, and there is also a session keyring which is never stored to
disk, but forgotten when the session ends.

The PAM module can be used to unlock the keyring on login.

%lang_package
%prep
%setup -q
translation-update-upstream
%patch4 -p1
%patch5 -p1

%build
%configure\
        --enable-pam \
        --with-pam-dir=/%{_lib}/security
make %{?jobs:-j%jobs} V=1

%install
%makeinstall
find %{buildroot} -type f -name "*.la" -delete -print
# XFCE team wants gnome-keyring to work by default.
for i in %{buildroot}%{_sysconfdir}/xdg/autostart/*.desktop ; do
 desktop-file-install --dir=%{buildroot}%{_sysconfdir}/xdg/autostart --add-only-show-in=XFCE $i
done
%find_lang %{name}
%suse_update_desktop_file gnome-keyring-gpg
%suse_update_desktop_file gnome-keyring-pkcs11
%suse_update_desktop_file gnome-keyring-secrets
%suse_update_desktop_file gnome-keyring-ssh
%fdupes %{buildroot}

%clean
rm -rf %{buildroot}

%post
%glib2_gsettings_schema_post
%desktop_database_post

%postun
%glib2_gsettings_schema_postun
%desktop_database_postun

###
# WARNING: when changing the pam-config calls in the scriptlets, please also
# update them in baselibs.conf.
# pam-config checks if the pam module is available for 32bit too if pam-32bit
# is installed, so the call here might fail until gnome-keyring-pam-32bit gets
# installed (see bnc#728586).
###

%post pam
%{_sbindir}/pam-config -a --gnome_keyring --gnome_keyring-auto_start --gnome_keyring-only_if=gdm,gdm-password,lxdm,lightdm || true
# Remove leftover from the old way, before we used pam-config. We start
# cleaning up in 11.2, so this can be removed in 12.2.
# Note: this can safely be done after pam-config, since pam-config doesn't
# touch /etc/pam.d/gdm
if test -f etc/pam.d/gdm; then
if grep -F -q pam_gnome_keyring.so etc/pam.d/gdm ; then
  sed -i '/ pam_gnome_keyring\.so/d' etc/pam.d/gdm
fi
fi

%postun pam
if [ "$1" == "0" ]; then
  %{_sbindir}/pam-config -d --gnome_keyring || true
fi

%files
%defattr (-, root, root)
%doc AUTHORS ChangeLog COPYING NEWS README
%{_bindir}/gnome-keyring
%{_bindir}/gnome-keyring-3
%{_bindir}/gnome-keyring-daemon
%dir %{_libdir}/pkcs11
%{_libdir}/pkcs11/gnome-keyring-pkcs11.so
%{_datadir}/dbus-1/services/org.freedesktop.secrets.service
%{_datadir}/dbus-1/services/org.gnome.keyring.service
# Own the directory since we can't depend on gconf providing them
%dir %{_datadir}/GConf
%dir %{_datadir}/GConf/gsettings
%{_datadir}/GConf/gsettings/org.gnome.crypto.cache.convert
%{_datadir}/glib-2.0/schemas/org.gnome.crypto.cache.gschema.xml
%dir %{_datadir}/p11-kit
%dir %{_datadir}/p11-kit/modules
%{_datadir}/p11-kit/modules/gnome-keyring.module
%{_sysconfdir}/xdg/autostart/*.desktop

%files lang -f %{name}.lang

%files -n libgck-modules-gnome-keyring
%defattr (-, root, root)
# Note: if modules move to %%{_libdir}/pkcs11, then we should remove
# the libgp11-modules Obsoletes tag.
%dir %{_libdir}/gnome-keyring
%dir %{_libdir}/gnome-keyring/devel
%{_libdir}/gnome-keyring/devel/gkm-gnome2-store-standalone.so
%{_libdir}/gnome-keyring/devel/gkm-secret-store-standalone.so
%{_libdir}/gnome-keyring/devel/gkm-ssh-store-standalone.so
%{_libdir}/gnome-keyring/devel/gkm-xdg-store-standalone.so

%files pam
%defattr (-, root, root)
%attr(555,root,root) /%{_lib}/security/*.so

%changelog
openSUSE Build Service is sponsored by