gnupg-2.5.20-r1.ebuild (5561B)
1 # Copyright 1999-2026 Gentoo Authors 2 # Distributed under the terms of the GNU General Public License v2 3 4 EAPI=8 5 6 # Maintainers should: 7 # 1. Join the "Gentoo" project at https://dev.gnupg.org/project/view/27/ 8 # 2. Subscribe to release tasks like https://dev.gnupg.org/T6159 9 # (find the one for the current release then subscribe to it + 10 # any subsequent ones linked within so you're covered for a while.) 11 12 VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/gnupg.asc 13 # in-source builds are not supported: https://dev.gnupg.org/T6313#166339 14 inherit flag-o-matic out-of-source multiprocessing systemd toolchain-funcs verify-sig 15 16 MY_P="${P/_/-}" 17 18 DESCRIPTION="The GNU Privacy Guard, a GPL OpenPGP implementation" 19 HOMEPAGE="https://gnupg.org/" 20 SRC_URI="mirror://gnupg/gnupg/${MY_P}.tar.bz2" 21 SRC_URI+=" verify-sig? ( mirror://gnupg/gnupg/${P}.tar.bz2.sig )" 22 S="${WORKDIR}/${MY_P}" 23 24 LICENSE="GPL-3+" 25 SLOT="0" 26 KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~arm64-macos ~x64-macos ~x64-solaris" 27 IUSE="+alternatives bzip2 doc ldap nls readline selinux +smartcard ssl test +tofu tpm tools usb user-socket wks-server" 28 RESTRICT="!test? ( test )" 29 REQUIRED_USE="test? ( tofu )" 30 31 # Existence of executables is checked during configuration 32 DEPEND=" 33 >=dev-libs/libassuan-3.0.0-r1:= 34 >=dev-libs/libgcrypt-1.11.0:= 35 >=dev-libs/libgpg-error-1.56 36 >=dev-libs/libksba-1.6.3 37 >=dev-libs/npth-1.2 38 virtual/zlib:= 39 bzip2? ( app-arch/bzip2 ) 40 ldap? ( net-nds/openldap:= ) 41 readline? ( sys-libs/readline:0= ) 42 smartcard? ( usb? ( virtual/libusb:1 ) ) 43 tofu? ( >=dev-db/sqlite-3.27 ) 44 tpm? ( >=app-crypt/tpm2-tss-2.4.0:= ) 45 ssl? ( >=net-libs/gnutls-3.2:0= ) 46 " 47 RDEPEND=" 48 ${DEPEND} 49 nls? ( virtual/libintl ) 50 selinux? ( sec-policy/selinux-gpg ) 51 wks-server? ( virtual/mta ) 52 " 53 PDEPEND=" 54 || ( 55 app-crypt/pinentry 56 app-crypt/pinentry-dmenu 57 ) 58 alternatives? ( 59 app-alternatives/gpg[-freepg(-)] 60 ) 61 " 62 BDEPEND=" 63 virtual/pkgconfig 64 doc? ( sys-apps/texinfo ) 65 nls? ( sys-devel/gettext ) 66 verify-sig? ( sec-keys/openpgp-keys-gnupg ) 67 " 68 69 DOCS=( 70 ChangeLog NEWS README THANKS TODO VERSION 71 doc/FAQ doc/DETAILS doc/HACKING doc/TRANSLATE doc/OpenPGP doc/KEYSERVER 72 ) 73 74 PATCHES=( 75 "${FILESDIR}"/${PN}-2.1.20-gpgscm-Use-shorter-socket-path-lengts-to-improve-tes.patch 76 "${FILESDIR}"/0002-Fix-stub-functions-to-avoid-LTO-linking-bugs-followup.patch 77 "${FILESDIR}"/${PN}-2.5.20-gpgme-poppler-expire.patch 78 ) 79 80 my_src_configure() { 81 local myconf=( 82 $(use_enable bzip2) 83 $(use_enable nls) 84 $(use_enable smartcard scdaemon) 85 $(use_enable ssl gnutls) 86 $(use_enable test all-tests) 87 $(use_enable test tests) 88 $(use_enable tofu) 89 $(use_enable tofu keyboxd) 90 $(use_enable tofu sqlite) 91 $(usex tpm '--with-tss=intel' '--disable-tpm2d') 92 $(use smartcard && use_enable usb ccid-driver || echo '--disable-ccid-driver') 93 $(use_enable wks-server wks-tools) 94 $(use_with ldap) 95 $(use_with readline) 96 97 # Hardcode mailprog to /usr/libexec/sendmail even if it does not exist. 98 # As of GnuPG 2.3, the mailprog substitution is used for the binary called 99 # by wks-client & wks-server; and if it's autodetected but not not exist at 100 # build time, then then 'gpg-wks-client --send' functionality will not 101 # work. This has an unwanted side-effect in stage3 builds: there was a 102 # [R]DEPEND on virtual/mta, which also brought in virtual/logger, bloating 103 # the build where the install guide previously make the user chose the 104 # logger & mta early in the install. 105 --with-mailprog=/usr/libexec/sendmail 106 107 --disable-ntbtls 108 --enable-gpgsm 109 --enable-large-secmem 110 111 CC_FOR_BUILD="$(tc-getBUILD_CC)" 112 GPGRT_CONFIG="${ESYSROOT}/usr/bin/${CHOST}-gpgrt-config" 113 114 $("${S}/configure" --help | grep -o -- '--without-.*-prefix') 115 ) 116 117 if use prefix && use usb; then 118 # bug #649598 119 append-cppflags -I"${ESYSROOT}/usr/include/libusb-1.0" 120 fi 121 122 if [[ ${CHOST} == *-solaris* ]] ; then 123 # these somehow are treated as fatal, but Solaris has different 124 # types for getpeername with socket_t 125 append-flags -Wno-incompatible-pointer-types 126 append-flags -Wno-unused-label 127 fi 128 129 # bug #663142 130 if use user-socket; then 131 myconf+=( --enable-run-gnupg-user-socket ) 132 fi 133 134 # glib fails and picks up clang's internal stdint.h causing weird errors 135 tc-is-clang && export gl_cv_absolute_stdint_h="${ESYSROOT}"/usr/include/stdint.h 136 137 econf "${myconf[@]}" 138 } 139 140 my_src_compile() { 141 default 142 143 use doc && emake -C doc html 144 } 145 146 my_src_test() { 147 export TESTFLAGS="--parallel=$(get_makeopts_jobs)" 148 149 default 150 } 151 152 my_src_install() { 153 emake DESTDIR="${D}" install 154 155 use tools && dobin tools/{gpgconf,gpgsplit,gpg-check-pattern} tools/make-dns-cert 156 157 if use alternatives; then 158 # rename for app-alternatives/gpg 159 mv "${ED}"/usr/bin/gpg{,-reference} || die 160 mv "${ED}"/usr/bin/gpgv{,-reference} || die 161 mv "${ED}"/usr/share/man/man1/gpg{,-reference}.1 || die 162 mv "${ED}"/usr/share/man/man1/gpgv{,-reference}.1 || die 163 else 164 dosym gpg /usr/bin/gpg2 165 dosym gpgv /usr/bin/gpgv2 166 echo ".so man1/gpg.1" > "${ED}"/usr/share/man/man1/gpg2.1 || die 167 echo ".so man1/gpgv.1" > "${ED}"/usr/share/man/man1/gpgv2.1 || die 168 fi 169 170 use doc && dodoc doc/gnupg.html/* 171 } 172 173 my_src_install_all() { 174 einstalldocs 175 176 use tools && dobin tools/{convert-from-106,mail-signed-keys,lspgpot} 177 use doc && dodoc doc/*.png 178 } 179 180 pkg_postinst() { 181 # If /usr/bin/gpg and /usr/bin/gpgv do not exist, provide them. 182 if [[ ! -e ${EROOT}/usr/bin/gpg ]]; then 183 ln -sf -- gpg-reference "${EROOT}"/usr/bin/gpg || die 184 fi 185 186 if [[ ! -e ${EROOT}/usr/bin/gpgv ]]; then 187 ln -sf -- gpgv-reference "${EROOT}"/usr/bin/gpgv || die 188 fi 189 }