Skip to content

Commit

Permalink
net-misc/gnome-ssh-askpass: new package, add 9.1_p1
Browse files Browse the repository at this point in the history
Signed-off-by: Tony Olagbaiye <bqv@fron.io>
  • Loading branch information
bqv committed Jan 3, 2023
1 parent a845424 commit f1c6442
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net-misc/gnome-ssh-askpass/Manifest
@@ -0,0 +1,2 @@
DIST openssh-9.1p1.tar.gz 1838747 BLAKE2B 287b6b1cc4858b27af88f4a4674670afff1fb5b99461892083393c53ef3747c5a0fcd90cba95d2c27465a919e00f7f42732c93af4f306665ba0393bbb7a534f5 SHA512 a1f02c407f6b621b1d0817d1a0c9a6839b67e416c84f3b76c63003b119035b24c19a1564b22691d1152e1d2d55f4dc7eb1af2d2318751e431a99c4efa77edc70
DIST openssh-9.1p1.tar.gz.asc 833 BLAKE2B 83efe3c705f6a02c25a9fc9bac2a4efd77470598d9e0fcb86dff2d265c58cffec1afecad3621769b2bd78ac25884f0ee20ae9b311e895db93e3bb552dffd6e74 SHA512 47dc7295f9694250bcbb86d7ca0830a47da4f3df7795bb05ebaf1590284ccce5317022c536bea1b09bd2fa4d8013295cc0de287ebe3f9dc605582077e9f11ddd
64 changes: 64 additions & 0 deletions net-misc/gnome-ssh-askpass/gnome-ssh-askpass-9.1_p1.ebuild
@@ -0,0 +1,64 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit toolchain-funcs verify-sig

PARCH=openssh-9.1p1

DESCRIPTION="GTK-based passphrase dialog for use with OpenSSH"
HOMEPAGE="https://www.openssh.com/"
SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
verify-sig? ( mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz.asc )
"
VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/openssh.org.asc
S="${WORKDIR}/${PARCH}"

LICENSE="BSD GPL-2"
SLOT="0"
IUSE="gtk2 +gtk3 verify-sig"
REQUIRED_USE="|| ( gtk2 gtk3 )"

RESTRICT="test"

DEPEND="

This comment has been minimized.

Copy link
@thesamesam

thesamesam Jan 3, 2023

Member

I bet these need to be in RDEPEND too.

gtk2? ( x11-libs/gtk+:2 )
gtk3? ( x11-libs/gtk+:3 )
"
BDEPEND="
virtual/pkgconfig
verify-sig? ( sec-keys/openpgp-keys-openssh )
"

src_unpack() {
default

# We don't have signatures for HPN, X509, so we have to write this ourselves
use verify-sig && verify-sig_verify_detached "${DISTDIR}"/${PARCH}.tar.gz{,.asc}
}

src_configure() {
true
}

src_compile() {
pushd contrib

This comment has been minimized.

Copy link
@thesamesam

thesamesam Jan 3, 2023

Member

We always use || die on external commands to make sure we pick up when they fail.

This comment has been minimized.

Copy link
@bqv

bqv Jan 3, 2023

Author Contributor

somehow didn't occur to me that push/popd could fail


use gtk2 && emake gnome-ssh-askpass2
use gtk3 && emake gnome-ssh-askpass3

popd
}

src_install() {
use gtk2 && ( dobin contrib/gnome-ssh-askpass2; \
echo "export SSH_ASKPASS='${EPREFIX}/usr/bin/gnome-ssh-askpass2'" > "${T}/99gnome_ssh_askpass" \
|| die "envd file creation failed" )

use gtk3 && ( dobin contrib/gnome-ssh-askpass3; \
echo "export SSH_ASKPASS='${EPREFIX}/usr/bin/gnome-ssh-askpass3'" > "${T}/99gnome_ssh_askpass" \

This comment has been minimized.

Copy link
@thesamesam

thesamesam Jan 3, 2023

Member

This is okay, but maybe trying too hard to keep things in one line?

I'd instead do something like:

if use gtk2 ; then
    dobin ...
fi

if use gtk3 ; then
    dobin ...
fi

newenvd - 99gnome_ssh_askpass <<-EOF
export SSH_ASKPASS='${EPREFIX}/usr/bin/gnome-ssh-askpass$(usex gtk3 3 2)'
EOF
|| die "envd file creation failed" )

doenvd "${T}"/99gnome_ssh_askpass
}

0 comments on commit f1c6442

Please sign in to comment.