gnupg-2.5.14.ebuild (5727B)
1 # Copyright 1999-2025 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 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-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 # Note: On each bump, update dep bounds on each version from configure.ac! 33 DEPEND=" 34 >=dev-libs/libassuan-3.0.0-r1:= 35 >=dev-libs/libgcrypt-1.11.0:= 36 >=dev-libs/libgpg-error-1.56 37 >=dev-libs/libksba-1.6.3 38 >=dev-libs/npth-1.2 39 virtual/zlib:= 40 bzip2? ( app-arch/bzip2 ) 41 ldap? ( net-nds/openldap:= ) 42 readline? ( sys-libs/readline:0= ) 43 smartcard? ( usb? ( virtual/libusb:1 ) ) 44 tofu? ( >=dev-db/sqlite-3.27 ) 45 tpm? ( >=app-crypt/tpm2-tss-2.4.0:= ) 46 ssl? ( >=net-libs/gnutls-3.2:0= ) 47 " 48 RDEPEND=" 49 ${DEPEND} 50 nls? ( virtual/libintl ) 51 selinux? ( sec-policy/selinux-gpg ) 52 wks-server? ( virtual/mta ) 53 " 54 PDEPEND=" 55 || ( 56 app-crypt/pinentry 57 app-crypt/pinentry-dmenu 58 ) 59 alternatives? ( 60 app-alternatives/gpg[-freepg(-)] 61 ) 62 " 63 BDEPEND=" 64 virtual/pkgconfig 65 doc? ( sys-apps/texinfo ) 66 nls? ( sys-devel/gettext ) 67 verify-sig? ( sec-keys/openpgp-keys-gnupg ) 68 " 69 70 DOCS=( 71 ChangeLog NEWS README THANKS TODO VERSION 72 doc/FAQ doc/DETAILS doc/HACKING doc/TRANSLATE doc/OpenPGP doc/KEYSERVER 73 ) 74 75 PATCHES=( 76 "${FILESDIR}"/${PN}-2.1.20-gpgscm-Use-shorter-socket-path-lengts-to-improve-tes.patch 77 ) 78 79 src_prepare() { 80 default 81 } 82 83 my_src_configure() { 84 # Upstream don't support LTO, bug #854222. 85 filter-lto 86 87 local myconf=( 88 $(use_enable bzip2) 89 $(use_enable nls) 90 $(use_enable smartcard scdaemon) 91 $(use_enable ssl gnutls) 92 $(use_enable test all-tests) 93 $(use_enable test tests) 94 $(use_enable tofu) 95 $(use_enable tofu keyboxd) 96 $(use_enable tofu sqlite) 97 $(usex tpm '--with-tss=intel' '--disable-tpm2d') 98 $(use smartcard && use_enable usb ccid-driver || echo '--disable-ccid-driver') 99 $(use_enable wks-server wks-tools) 100 $(use_with ldap) 101 $(use_with readline) 102 103 # Hardcode mailprog to /usr/libexec/sendmail even if it does not exist. 104 # As of GnuPG 2.3, the mailprog substitution is used for the binary called 105 # by wks-client & wks-server; and if it's autodetected but not not exist at 106 # build time, then then 'gpg-wks-client --send' functionality will not 107 # work. This has an unwanted side-effect in stage3 builds: there was a 108 # [R]DEPEND on virtual/mta, which also brought in virtual/logger, bloating 109 # the build where the install guide previously make the user chose the 110 # logger & mta early in the install. 111 --with-mailprog=/usr/libexec/sendmail 112 113 --disable-ntbtls 114 --enable-gpgsm 115 --enable-large-secmem 116 117 CC_FOR_BUILD="$(tc-getBUILD_CC)" 118 GPGRT_CONFIG="${ESYSROOT}/usr/bin/${CHOST}-gpgrt-config" 119 120 $("${S}/configure" --help | grep -o -- '--without-.*-prefix') 121 ) 122 123 if use prefix && use usb; then 124 # bug #649598 125 append-cppflags -I"${ESYSROOT}/usr/include/libusb-1.0" 126 fi 127 128 if [[ ${CHOST} == *-solaris* ]] ; then 129 # these somehow are treated as fatal, but Solaris has different 130 # types for getpeername with socket_t 131 append-flags -Wno-incompatible-pointer-types 132 append-flags -Wno-unused-label 133 fi 134 135 # bug #663142 136 if use user-socket; then 137 myconf+=( --enable-run-gnupg-user-socket ) 138 fi 139 140 # glib fails and picks up clang's internal stdint.h causing weird errors 141 tc-is-clang && export gl_cv_absolute_stdint_h="${ESYSROOT}"/usr/include/stdint.h 142 143 econf "${myconf[@]}" 144 } 145 146 my_src_compile() { 147 default 148 149 use doc && emake -C doc html 150 } 151 152 my_src_test() { 153 export TESTFLAGS="--parallel=$(makeopts_jobs)" 154 155 default 156 } 157 158 my_src_install() { 159 emake DESTDIR="${D}" install 160 161 use tools && dobin tools/{gpgconf,gpgsplit,gpg-check-pattern} tools/make-dns-cert 162 163 if use alternatives; then 164 # rename for app-alternatives/gpg 165 mv "${ED}"/usr/bin/gpg{,-reference} || die 166 mv "${ED}"/usr/bin/gpgv{,-reference} || die 167 mv "${ED}"/usr/share/man/man1/gpg{,-reference}.1 || die 168 mv "${ED}"/usr/share/man/man1/gpgv{,-reference}.1 || die 169 else 170 dosym gpg /usr/bin/gpg2 171 dosym gpgv /usr/bin/gpgv2 172 echo ".so man1/gpg.1" > "${ED}"/usr/share/man/man1/gpg2.1 || die 173 echo ".so man1/gpgv.1" > "${ED}"/usr/share/man/man1/gpgv2.1 || die 174 fi 175 176 dodir /etc/env.d 177 echo "CONFIG_PROTECT=/usr/share/gnupg/qualified.txt" >> "${ED}"/etc/env.d/30gnupg || die 178 179 use doc && dodoc doc/gnupg.html/* 180 } 181 182 my_src_install_all() { 183 einstalldocs 184 185 use tools && dobin tools/{convert-from-106,mail-signed-keys,lspgpot} 186 use doc && dodoc doc/*.png 187 } 188 189 pkg_postinst() { 190 # If /usr/bin/gpg and /usr/bin/gpgv do not exist, provide them. 191 if [[ ! -e ${EROOT}/usr/bin/gpg ]]; then 192 ln -sf -- gpg-reference "${EROOT}"/usr/bin/gpg || die 193 fi 194 195 if [[ ! -e ${EROOT}/usr/bin/gpgv ]]; then 196 ln -sf -- gpgv-reference "${EROOT}"/usr/bin/gpgv || die 197 fi 198 }