7ac2c9823bcb48a4216e4a50abc1de207aa19579
[gentoo.git] / gnome-base / gnome-keyring / gnome-keyring-3.20.0.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 GNOME2_LA_PUNT="yes"
6 PYTHON_COMPAT=( python2_7 )
7
8 inherit fcaps gnome2 pam python-any-r1 versionator virtualx
9
10 DESCRIPTION="Password and keyring managing daemon"
11 HOMEPAGE="https://wiki.gnome.org/Projects/GnomeKeyring"
12
13 LICENSE="GPL-2+ LGPL-2+"
14 SLOT="0"
15 IUSE="+caps pam selinux +ssh-agent test"
16 KEYWORDS="alpha amd64 arm ~arm64 ia64 ~mips ppc ppc64 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~sparc-solaris ~x86-solaris"
17
18 # Replace gkd gpg-agent with pinentry[gnome-keyring] one, bug #547456
19 RDEPEND="
20         >=app-crypt/gcr-3.5.3:=[gtk]
21         >=dev-libs/glib-2.38:2
22         app-misc/ca-certificates
23         >=dev-libs/libgcrypt-1.2.2:0=
24         caps? ( sys-libs/libcap-ng )
25         pam? ( virtual/pam )
26         selinux? ( sec-policy/selinux-gnome )
27         >=app-crypt/gnupg-2.0.28:=
28 "
29 DEPEND="${RDEPEND}
30         >=app-eselect/eselect-pinentry-0.5
31         app-text/docbook-xml-dtd:4.3
32         dev-libs/libxslt
33         >=dev-util/intltool-0.35
34         sys-devel/gettext
35         virtual/pkgconfig
36         test? ( ${PYTHON_DEPS} )
37 "
38 PDEPEND="app-crypt/pinentry[gnome-keyring]" #570512
39
40 pkg_setup() {
41         use test && python-any-r1_pkg_setup
42 }
43
44 src_prepare() {
45         # Disable stupid CFLAGS with debug enabled
46         sed -e 's/CFLAGS="$CFLAGS -g"//' \
47                 -e 's/CFLAGS="$CFLAGS -O0"//' \
48                 -i configure.ac configure || die
49
50         gnome2_src_prepare
51 }
52
53 src_configure() {
54         gnome2_src_configure \
55                 $(use_with caps libcap-ng) \
56                 $(use_enable pam) \
57                 $(use_with pam pam-dir $(getpam_mod_dir)) \
58                 $(use_enable selinux) \
59                 $(use_enable ssh-agent) \
60                 --enable-doc
61 }
62
63 src_test() {
64          "${EROOT}${GLIB_COMPILE_SCHEMAS}" --allow-any-name "${S}/schema" || die
65          GSETTINGS_SCHEMA_DIR="${S}/schema" virtx emake check
66 }
67
68 pkg_postinst() {
69         # cap_ipc_lock only needed if building --with-libcap-ng
70         # Never install as suid root, this breaks dbus activation, see bug #513870
71         use caps && fcaps -m 755 cap_ipc_lock usr/bin/gnome-keyring-daemon
72         gnome2_pkg_postinst
73
74         if ! [[ $(eselect pinentry show | grep "pinentry-gnome3") ]] ; then
75                 ewarn "Please select pinentry-gnome3 as default pinentry provider:"
76                 ewarn " # eselect pinentry set pinentry-gnome3"
77         fi
78 }