An initial version of the package that controls "gpg" and "gpgv"
executable symlinks.  I have also moved the "gpg2" and "gpgv2"
compatibility symlinks here for consistency.  Manpages aren't altered
at the time, since only app-crypt/gnupg and app-crypt/freepg provide
them, and both block each other.

Closes: https://bugs.gentoo.org/963829
Signed-off-by: Michał Górny <[email protected]>
---
 app-alternatives/gpg/gpg-0.ebuild | 27 +++++++++++++++++++++++++++
 app-alternatives/gpg/metadata.xml | 17 +++++++++++++++++
 2 files changed, 44 insertions(+)
 create mode 100644 app-alternatives/gpg/gpg-0.ebuild
 create mode 100644 app-alternatives/gpg/metadata.xml

diff --git a/app-alternatives/gpg/gpg-0.ebuild 
b/app-alternatives/gpg/gpg-0.ebuild
new file mode 100644
index 0000000000000..8715c060be65a
--- /dev/null
+++ b/app-alternatives/gpg/gpg-0.ebuild
@@ -0,0 +1,27 @@
+# Copyright 2022-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ALTERNATIVES=(
+       "reference:app-crypt/gnupg[alternatives(-)]"
+)
+
+inherit app-alternatives
+
+DESCRIPTION="gpg symlink"
+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"
+
+RDEPEND="
+       !app-crypt/gnupg[-alternatives(-)]
+"
+
+src_install() {
+       local alt=$(get_alternative)
+
+       dodir /usr/bin
+       dosym "gpg-${alt}" /usr/bin/gpg
+       dosym "gpgv-${alt}" /usr/bin/gpgv
+       dosym gpg /usr/bin/gpg2
+       dosym gpgv /usr/bin/gpgv2
+}
diff --git a/app-alternatives/gpg/metadata.xml 
b/app-alternatives/gpg/metadata.xml
new file mode 100644
index 0000000000000..eab5ebd805632
--- /dev/null
+++ b/app-alternatives/gpg/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="project">
+               <email>[email protected]</email>
+               <name>Gentoo Base System</name>
+       </maintainer>
+       <maintainer type="person">
+               <email>[email protected]</email>
+               <name>Michał Górny</name>
+       </maintainer>
+       <use>
+               <flag name="reference">
+                       Symlink to <pkg>app-crypt/gnupg</pkg>.
+               </flag>
+       </use>
+</pkgmetadata>

Reply via email to