[packages] openssh: remove ssh and scp symlinks to dropbear when openssh-client is
authortripolar <tripolar@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Tue, 19 Nov 2013 01:35:08 +0000 (01:35 +0000)
committertripolar <tripolar@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Tue, 19 Nov 2013 01:35:08 +0000 (01:35 +0000)
installed and create them again when openssh-client is removed and dropbear is installed

Signed-off-by: Peter Wagner <tripolar@gmx.at>
git-svn-id: svn://svn.openwrt.org/openwrt/packages@38864 3c298f89-4303-0410-b956-a3cf2f4a3e73

net/openssh/Makefile

index 069c3cc..7bccef6 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openssh
 PKG_VERSION:=6.4p1
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/ \
@@ -181,6 +181,24 @@ define Build/Compile
                all install
 endef
 
+define Package/openssh-client/preinst
+#!/bin/sh
+if [ -L $${IPKG_INSTROOT}/usr/bin/ssh ] && [ -L $${IPKG_INSTROOT}/usr/bin/scp ]; then
+  rm -f $${IPKG_INSTROOT}/usr/bin/ssh $${IPKG_INSTROOT}/usr/bin/scp;
+fi
+exit 0
+endef
+
+define Package/openssh-client/postrm
+#!/bin/sh
+rm -f $${IPKG_INSTROOT}/usr/bin/ssh $${IPKG_INSTROOT}/usr/bin/scp;
+if [ -x $${IPKG_INSTROOT}/usr/sbin/dropbear ] ; then
+  ln -s /usr/sbin/dropbear $${IPKG_INSTROOT}/usr/bin/ssh;
+  ln -s /usr/sbin/dropbear $${IPKG_INSTROOT}/usr/bin/scp;
+fi
+exit 0
+endef
+
 define Package/openssh-moduli/install
        $(INSTALL_DIR) $(1)/etc/ssh
        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/ssh/moduli $(1)/etc/ssh/