app-crypt/monkeysphere: Start fixing tests
[portage-overlay.git] / app-crypt / monkeysphere / monkeysphere-0.36-r2.ebuild
1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI=5
6 inherit eutils user
7
8 DESCRIPTION="Leverage the OpenPGP web of trust for OpenSSH and Web authentication"
9 HOMEPAGE="http://web.monkeysphere.info/"
10
11 LICENSE="GPL-3"
12 SLOT="0"
13 IUSE=""
14 SRC_URI="mirror://debian/pool/monkeysphere/m/monkeysphere/monkeysphere_${PV}.orig.tar.gz"
15 KEYWORDS="~amd64 ~x86"
16
17 DOCS=( README Changelog )
18
19 DEPEND="app-crypt/gnupg:0=
20         net-misc/socat:0=
21         dev-perl/Crypt-OpenSSL-RSA:0=
22         dev-perl/Digest-SHA1:0=
23         app-misc/lockfile-progs:0="
24
25 RDEPEND="${DEPEND}"
26
27 pkg_setup()
28 {
29         einfo "Creating named group and user"
30         enewgroup monkeysphere
31         enewuser monkeysphere -1 -1 /var/lib/monkeysphere monkeysphere
32 }
33
34 src_prepare()
35 {
36         epatch "${FILESDIR}/${P}_default_shell.patch"\
37                "${FILESDIR}/${P}_non_default_port.patch"\
38                "${FILESDIR}/${P}_userid_empty_line.patch"\
39                "${FILESDIR}/${P}_openpgp2ssh_sanity_check.patch"\
40                "${FILESDIR}/${P}_hd_od.patch"
41
42         sed -i "s#share/doc/monkeysphere#share/doc/${PF}#" Makefile || die
43         
44         #Output format of gpg --check-sigs differ between 1.4 and 2.0 so test needs to be updated
45         if has_version '>=app-crypt/gnupg-2.0.0:0'; then
46                 epatch "${FILESDIR}/${P}_tests_gnupg2.patch"
47         fi;
48 }
49
50 src_install()
51 {
52         default
53         dodir /var/lib/monkeysphere
54         fowners root:monkeysphere /var/lib/monkeysphere
55         fperms 751 /var/lib/monkeysphere
56 }
57
58 pkg_postinst()
59 {
60         monkeysphere-authentication setup || die
61 }