app-crypt/gpgme: cleanup old
[gentoo.git] / app-crypt / monkeysphere / monkeysphere-0.36-r2.ebuild
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5 inherit eutils user
6
7 DESCRIPTION="Leverage the OpenPGP web of trust for OpenSSH and Web authentication"
8 HOMEPAGE="http://web.monkeysphere.info/"
9
10 LICENSE="GPL-3"
11 SLOT="0"
12 IUSE=""
13 SRC_URI="mirror://debian/pool/monkeysphere/m/monkeysphere/monkeysphere_${PV}.orig.tar.gz"
14 KEYWORDS="~amd64 ~arm ~x86"
15
16 DOCS=( README Changelog )
17
18 # Tests fail upstream for SSH connection. Issue has been reported.
19 RESTRICT="test"
20
21 DEPEND="app-crypt/gnupg
22         net-misc/socat
23         dev-perl/Crypt-OpenSSL-RSA
24         dev-perl/Digest-SHA1
25         app-misc/lockfile-progs"
26
27 RDEPEND="${DEPEND}"
28
29 pkg_setup()
30 {
31         einfo "Creating named group and user"
32         enewgroup monkeysphere
33         enewuser monkeysphere -1 -1 /var/lib/monkeysphere monkeysphere
34         # Using fperms and fowner in src_install leave unusable config with error
35         # Authentication refused: bad ownership or modes for directory /var/lib/monkeysphere
36         chown root:monkeysphere /var/lib/monkeysphere
37         chmod 751 /var/lib/monkeysphere
38 }
39
40 src_prepare()
41 {
42         epatch "${FILESDIR}/${P}_default_shell.patch"\
43                "${FILESDIR}/${P}_non_default_port.patch"\
44                "${FILESDIR}/${P}_userid_empty_line.patch"\
45                "${FILESDIR}/${P}_openpgp2ssh_sanity_check.patch"\
46                "${FILESDIR}/${P}_hd_od.patch"
47
48         sed -i "s#share/doc/monkeysphere#share/doc/${PF}#" Makefile || die
49
50         # Output format of gpg --check-sigs differ between 1.4 and 2.0 so test
51         # needs to be updated if 2.0 is used
52         if has_version '>=app-crypt/gnupg-2.0.0:0'; then
53                 epatch "${FILESDIR}/${P}_tests_gnupg2.patch"
54         fi;
55 }
56
57 src_install()
58 {
59         default
60         dodir /var/lib/monkeysphere
61 }
62
63 pkg_postinst()
64 {
65         #This function is idempotent, make sure it is run at least once.
66         monkeysphere-authentication setup || die
67 }