openssh-keygen: Make ssh-keygen as an alternative to dropbearkey 22861/head
authorSergey Ponomarev <stokito@gmail.com>
Sun, 3 Dec 2023 16:14:42 +0000 (18:14 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Mon, 6 May 2024 11:44:08 +0000 (13:44 +0200)
The DropBear's dropbearkey tool is compatible with OpenSSH
ssh-keygen.
It was set by default as the /usr/bin/ssh-keygen program since
the PR https://github.com/openwrt/openwrt/pull/14174
Now if a user need for a full ssh-keygen the openssh-keygen package
should substitute it gracefully as an alternative.

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
Link: https://github.com/openwrt/packages/pull/22861
[ wrap to 80 columns ]
Link: https://github.com/openwrt/packages/pull/22861
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
net/openssh/Makefile

index 450ab5ff853781634ebf1493f368a73aff06534f..dd5c1793927d5fd214d1be6c0763b52e1b683183 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openssh
 PKG_VERSION:=9.7p1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/ \
@@ -81,6 +81,7 @@ define Package/openssh-keygen
        $(call Package/openssh/Default)
        DEPENDS+= +libopenssl +zlib
        TITLE+= keygen
+       ALTERNATIVES:=200:/usr/bin/ssh-keygen:/usr/libexec/ssh-keygen-openssh
 endef
 
 define Package/openssh-keygen/description
@@ -221,8 +222,8 @@ define Package/openssh-client-utils/install
 endef
 
 define Package/openssh-keygen/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ssh-keygen $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/libexec
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ssh-keygen $(1)/usr/libexec/ssh-keygen-openssh
 endef
 
 define Package/openssh-server/install