Signed-off-by: Michał Górny <[email protected]>
---
 app-alternatives/gpg/gpg-1.ebuild | 35 +++++++++++++++++++++++++++++++
 app-alternatives/gpg/metadata.xml |  6 ++++++
 2 files changed, 41 insertions(+)
 create mode 100644 app-alternatives/gpg/gpg-1.ebuild

diff --git a/app-alternatives/gpg/gpg-1.ebuild 
b/app-alternatives/gpg/gpg-1.ebuild
new file mode 100644
index 0000000000000..7a8c283099212
--- /dev/null
+++ b/app-alternatives/gpg/gpg-1.ebuild
@@ -0,0 +1,35 @@
+# Copyright 2022-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ALTERNATIVES=(
+       "reference:app-crypt/gnupg[alternatives(-)]"
+       "freepg:app-crypt/freepg"
+       "sequoia:app-crypt/sequoia-chameleon-gnupg"
+)
+
+inherit app-alternatives
+
+DESCRIPTION="gpg symlink"
+KEYWORDS="~amd64"
+
+RDEPEND="
+       !app-crypt/gnupg[-alternatives(-)]
+"
+
+src_install() {
+       local alt=$(get_alternative)
+
+       case ${alt} in
+               sequoia)
+                       alt=sq
+                       ;;
+       esac
+
+       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
index eab5ebd805632..ce786f5cc557c 100644
--- a/app-alternatives/gpg/metadata.xml
+++ b/app-alternatives/gpg/metadata.xml
@@ -10,8 +10,14 @@
                <name>Michał Górny</name>
        </maintainer>
        <use>
+               <flag name="freepg">
+                       Symlink to <pkg>app-crypt/freepg</pkg>.
+               </flag>
                <flag name="reference">
                        Symlink to <pkg>app-crypt/gnupg</pkg>.
                </flag>
+               <flag name="sequoia">
+                       Symlink to <pkg>app-crypt/sequoia-chameleon-gnupg</pkg>.
+               </flag>
        </use>
 </pkgmetadata>

Reply via email to