1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils flag-o-matic toolchain-funcs
9 DESCRIPTION="The GNU Privacy Guard, a GPL pgp replacement"
10 HOMEPAGE="http://www.gnupg.org/"
11 SRC_URI="mirror://gnupg/gnupg/${P}.tar.bz2"
12 # SRC_URI="ftp://ftp.gnupg.org/gcrypt/${PN}/${P}.tar.bz2"
16 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
17 IUSE="bzip2 doc ldap nls mta readline static selinux smartcard tools usb"
20 >=dev-libs/libassuan-2
21 >=dev-libs/libgcrypt-1.5:0=
22 >=dev-libs/libgpg-error-1.19
23 >=dev-libs/libksba-1.0.7
27 bzip2? ( app-arch/bzip2 )
28 readline? ( sys-libs/readline )
29 smartcard? ( usb? ( virtual/libusb:0 ) )
30 ldap? ( net-nds/openldap )"
31 COMMON_DEPEND_BINS="app-crypt/pinentry"
33 # Existence of executables is checked during configuration.
34 DEPEND="${COMMON_DEPEND_LIBS}
37 >=dev-libs/libassuan-2[static-libs]
38 >=dev-libs/libgcrypt-1.4:0=[static-libs]
39 >=dev-libs/libgpg-error-1.11[static-libs]
40 >=dev-libs/libksba-1.0.7[static-libs]
41 >=dev-libs/pth-1.3.7[static-libs]
42 >=net-misc/curl-7.10[static-libs]
43 sys-libs/zlib[static-libs]
44 bzip2? ( app-arch/bzip2[static-libs] )
46 nls? ( sys-devel/gettext )
47 doc? ( sys-apps/texinfo )"
49 RDEPEND="!static? ( ${COMMON_DEPEND_LIBS} )
52 !<=app-crypt/gnupg-2.0.1
53 selinux? ( sec-policy/selinux-gpg )
54 nls? ( virtual/libintl )"
56 REQUIRED_USE="smartcard? ( !static )"
59 epatch "${FILESDIR}/${PN}-2.0.17-gpgsm-gencert.patch"
66 # 'USE=static' support was requested:
69 use static && append-ldflags -static
71 if use smartcard; then
74 $(use_enable usb ccid-driver)
77 myconf+=( --disable-scdaemon )
80 if use elibc_SunOS || use elibc_AIX; then
81 myconf+=( --disable-symcryptrun )
83 myconf+=( --enable-symcryptrun )
86 # glib fails and picks up clang's internal stdint.h causing weird errors
87 [[ ${CC} == *clang ]] && \
88 export gl_cv_absolute_stdint_h=/usr/include/stdint.h
91 --docdir="${EPREFIX}/usr/share/doc/${PF}" \
95 --enable-large-secmem \
100 $(use_enable mta mailto) \
102 $(use_with readline) \
103 CC_FOR_BUILD="$(tc-getBUILD_CC)"
118 use tools && dobin tools/{convert-from-106,gpg-check-pattern} \
119 tools/{gpg-zip,gpgconf,gpgsplit,lspgpot,mail-signed-keys,make-dns-cert}
121 emake DESTDIR="${D}" -f doc/Makefile uninstall-nobase_dist_docDATA
122 # The help*txt files are read from the datadir by GnuPG directly.
123 # They do not work if compressed or moved!
124 #rm "${ED}"/usr/share/gnupg/help* || die
126 dodoc ChangeLog NEWS README THANKS TODO VERSION doc/FAQ doc/DETAILS \
127 doc/HACKING doc/TRANSLATE doc/OpenPGP doc/KEYSERVER doc/help*
129 dosym gpg2 /usr/bin/gpg
130 dosym gpgv2 /usr/bin/gpgv
131 dosym gpg2keys_hkp /usr/libexec/gpgkeys_hkp
132 dosym gpg2keys_finger /usr/libexec/gpgkeys_finger
133 dosym gpg2keys_curl /usr/libexec/gpgkeys_curl
135 dosym gpg2keys_ldap /usr/libexec/gpgkeys_ldap
137 echo ".so man1/gpg2.1" > "${ED}"/usr/share/man/man1/gpg.1
138 echo ".so man1/gpgv2.1" > "${ED}"/usr/share/man/man1/gpgv.1
141 echo "CONFIG_PROTECT=/usr/share/gnupg/qualified.txt" >> "${ED}"/etc/env.d/30gnupg
144 dohtml doc/gnupg.html/* doc/*.png
149 elog "If you wish to view images emerge:"
150 elog "media-gfx/xloadimage, media-gfx/xli or any other viewer"
151 elog "Remember to use photo-viewer option in configuration file to activate"
152 elog "the right viewer."
155 if use smartcard; then
156 elog "To use your OpenPGP smartcard (or token) with GnuPG you need one of"
157 use usb && elog " - a CCID-compatible reader, used directly through libusb;"
158 elog " - sys-apps/pcsc-lite and a compatible reader device;"
159 elog " - dev-libs/openct and a compatible reader device;"
160 elog " - a reader device and drivers exporting either PC/SC or CT-API interfaces."
162 elog "General hint: you probably want to try installing sys-apps/pcsc-lite and"
163 elog "app-crypt/ccid first."
166 ewarn "Please remember to restart gpg-agent if a different version"
167 ewarn "of the agent is currently used. If you are unsure of the gpg"
168 ewarn "agent you are using please run 'killall gpg-agent',"
169 ewarn "and to start a fresh daemon just run 'gpg-agent --daemon'."