%global glib2_version 2.44.0
%global gcr_version 3.27.90
%global gcrypt_version 1.2.2

Name:          gnome-keyring
Version:       42.1
Release:       1
Summary:       A program that keep password and other secrets for users
License:       GPLv2+ and LGPLv2+
URL:           https://wiki.gnome.org/Projects/GnomeKeyring
Source0:       https://download.gnome.org/sources/%{name}/42/%{name}-%{version}.tar.xz

BuildRequires: gcc docbook-dtds docbook-style-xsl gettext intltool libcap-ng-devel libselinux-devel pam-devel
BuildRequires: openssh-clients libxslt make
BuildRequires: pkgconfig(p11-kit-1)
BuildRequires: pkgconfig(gcr-3) >= %{gcr_version}
BuildRequires: pkgconfig(glib-2.0) >= %{glib2_version}
BuildRequires: libgcrypt-devel >= %{gcrypt_version}

Requires:      openssh gcr

%description
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       pam
Summary:       Pam module for unlocking keyrings
License:       LGPLv2+
Requires:      %{name}%{?_isa} = %{version}-%{release} pam%{?_isa}

%description   pam
The gnome-keyring-pam package contains a pam module that can
automatically unlock the "login" keyring when the user logs in.

%package_help

%prep
%autosetup -p1

%build
%configure \
           --with-pam-dir=%{_libdir}/security \
           --enable-pam \
           --without-libcap-ng
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0 /g' libtool
%make_build

%install
%make_install
%find_lang gnome-keyring
%delete_la_and_a

%files -f gnome-keyring.lang
%license COPYING COPYING.LIB
%{_libdir}/pkcs11/*.so
%{_libdir}/gnome-keyring/devel/*.so
%{_bindir}/*
%{_datadir}/GConf/gsettings/*.convert
%{_datadir}/glib-2.0/schemas/*.gschema.xml
%{_datadir}/dbus-1/services/*.service
%{_datadir}/p11-kit/modules/gnome-keyring.module
%{_datadir}/xdg-desktop-portal/portals/gnome-keyring.portal
%{_sysconfdir}/xdg/autostart/*

%files pam
%{_libdir}/security/*.so

%files help
%doc AUTHORS NEWS README
%{_mandir}/man1/gnome-keyring.1*
%{_mandir}/man1/gnome-keyring-3.1*
%{_mandir}/man1/gnome-keyring-daemon.1*

%changelog
* Mon Jun 6 2022 lin zhang <lin.zhang@turbolinux.com.cn> - 42.1-1
- Update to 42.1

* Mon Mar 28 2022 lin zhang <lin.zhang@turbolinux.com.cn> - 40.0-1
- Update to 40.0

* Mon May 31 2021 weijin deng <weijin.deng@turbolinux.com.cn> - 3.36.0-1
- Upgrade to 3.36.0
- Update Version, Release, Source0, stage 'files'

* Tue May 18 2021 lin.zhang <lin.zhang@turbolinux.com.cn> - 3.28.2-4
- add BuildRequires openssh-clients

* Fri Oct 18 2019 Yiru Wang <wangyiru1@huawei.com> - 3.28.2-3
- Pakcage init
