add _beta783
[portage-overlay.git] / app-crypt / gnupg / gnupg-2.1.0_beta783.ebuild
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-crypt/gnupg/gnupg-2.1.0_beta751.ebuild,v 1.2 2014/07/25 03:53:22 zx2c4 Exp $
4
5 EAPI="5"
6
7 inherit eutils flag-o-matic toolchain-funcs
8
9 DESCRIPTION="The GNU Privacy Guard, a GPL pgp replacement"
10 HOMEPAGE="http://www.gnupg.org/"
11 MY_P="${P/_/-}"
12 SRC_URI="mirror://gnupg/gnupg/unstable/${MY_P}.tar.bz2"
13
14 LICENSE="GPL-3"
15 SLOT="0"
16 KEYWORDS=""
17 IUSE="adns bzip2 doc nls readline static selinux smartcard usb"
18
19 COMMON_DEPEND_LIBS="
20         dev-libs/npth
21         >=dev-libs/libassuan-2
22         >=dev-libs/libgcrypt-1.6.1
23         >=dev-libs/libgpg-error-1.13
24         >=dev-libs/libksba-1.0.7
25         >=net-misc/curl-7.10
26         sys-libs/zlib
27         net-nds/openldap
28         adns? ( >=net-libs/adns-1.4 )
29         bzip2? ( app-arch/bzip2 )
30         readline? ( sys-libs/readline )
31         smartcard? ( usb? ( virtual/libusb:0 ) )
32         "
33 COMMON_DEPEND_BINS="|| ( app-crypt/pinentry app-crypt/pinentry-qt )"
34
35 # Existence of executables is checked during configuration.
36 DEPEND="${COMMON_DEPEND_LIBS}
37         ${COMMON_DEPEND_BINS}
38         static? (
39                 >=dev-libs/libassuan-2[static-libs]
40                 >=dev-libs/libgcrypt-1.4[static-libs]
41                 >=dev-libs/libgpg-error-1.7[static-libs]
42                 >=dev-libs/libksba-1.0.7[static-libs]
43                 >=dev-libs/pth-1.3.7[static-libs]
44                 >=net-misc/curl-7.10[static-libs]
45                 sys-libs/zlib[static-libs]
46                 bzip2? ( app-arch/bzip2[static-libs] )
47         )
48         nls? ( sys-devel/gettext )
49         doc? ( sys-apps/texinfo )"
50
51 RDEPEND="!static? ( ${COMMON_DEPEND_LIBS} )
52         ${COMMON_DEPEND_BINS}
53         !<=app-crypt/gnupg-2.0.1
54         selinux? ( sec-policy/selinux-gpg )
55         nls? ( virtual/libintl )"
56
57 REQUIRED_USE="smartcard? ( !static )"
58
59 S="${WORKDIR}/${MY_P}"
60
61 src_prepare() {
62         epatch "${FILESDIR}/${PN}-2.0.17-gpgsm-gencert.patch"
63         epatch_user
64 }
65
66 src_configure() {
67         local myconf=()
68
69         # 'USE=static' support was requested:
70         # gnupg1: bug #29299
71         # gnupg2: bug #159623
72         use static && append-ldflags -static
73
74         if use smartcard; then
75                 myconf+=(
76                         --enable-scdaemon
77                         $(use_enable usb ccid-driver)
78                 )
79         else
80                 myconf+=( --disable-scdaemon )
81         fi
82
83         if use elibc_SunOS || use elibc_AIX; then
84                 myconf+=( --disable-symcryptrun )
85         else
86                 myconf+=( --enable-symcryptrun )
87         fi
88
89         econf \
90                 --docdir="${EPREFIX}/usr/share/doc/${PF}" \
91                 --enable-gpg \
92                 --enable-gpgsm \
93                 --enable-agent \
94                 "${myconf[@]}" \
95                 $(use_with adns) \
96                 $(use_enable bzip2) \
97                 $(use_enable nls) \
98                 $(use_with readline) \
99                 CC_FOR_BUILD="$(tc-getBUILD_CC)"
100 }
101
102 src_compile() {
103         default
104
105         if use doc; then
106                 cd doc
107                 emake html
108         fi
109 }
110
111 src_install() {
112         default
113
114         # bug#192151
115         dobin tools/gpgsplit tools/gpg-zip
116
117         emake DESTDIR="${D}" -f doc/Makefile uninstall-nobase_dist_docDATA
118         rm "${ED}"/usr/share/gnupg/help* || die
119
120         dodoc ChangeLog NEWS README THANKS TODO VERSION doc/FAQ doc/DETAILS \
121                 doc/HACKING doc/TRANSLATE doc/OpenPGP doc/KEYSERVER doc/help*
122
123         dosym gpg2 /usr/bin/gpg
124         dosym gpgv2 /usr/bin/gpgv
125         dosym gpg2keys_hkp /usr/libexec/gpgkeys_hkp
126         dosym gpg2keys_finger /usr/libexec/gpgkeys_finger
127         dosym gpg2keys_curl /usr/libexec/gpgkeys_curl
128         echo ".so man1/gpg2.1" > "${ED}"/usr/share/man/man1/gpg.1
129         echo ".so man1/gpgv2.1" > "${ED}"/usr/share/man/man1/gpgv.1
130
131         dodir /etc/env.d
132         echo "CONFIG_PROTECT=/usr/share/gnupg/qualified.txt" >> "${ED}"/etc/env.d/30gnupg
133
134         if use doc; then
135                 dohtml doc/gnupg.html/* doc/*.png
136         fi
137 }
138
139 pkg_postinst() {
140         elog "If you wish to view images emerge:"
141         elog "media-gfx/xloadimage, media-gfx/xli or any other viewer"
142         elog "Remember to use photo-viewer option in configuration file to activate"
143         elog "the right viewer."
144         elog
145
146         if use smartcard; then
147                 elog "To use your OpenPGP smartcard (or token) with GnuPG you need one of"
148                 use usb && elog " - a CCID-compatible reader, used directly through libusb;"
149                 elog " - sys-apps/pcsc-lite and a compatible reader device;"
150                 elog " - dev-libs/openct and a compatible reader device;"
151                 elog " - a reader device and drivers exporting either PC/SC or CT-API interfaces."
152                 elog ""
153                 elog "General hint: you probably want to try installing sys-apps/pcsc-lite and"
154                 elog "app-crypt/ccid first."
155         fi
156
157         ewarn "Please remember to restart gpg-agent if a different version"
158         ewarn "of the agent is currently used. If you are unsure of the gpg"
159         ewarn "agent you are using please run 'killall gpg-agent',"
160         ewarn "and to start a fresh daemon just run 'gpg-agent --daemon'."
161 }