From 4a4f6ae101f609e0e486e483656cc4701d421b24 Mon Sep 17 00:00:00 2001 From: green Date: Mon, 22 Nov 1999 22:45:47 +0000 Subject: Clean up some shell scripting and replace it with proper Makefile syntax. Run ssh-keygen for ssh_host_key on port install, not just package install. --- security/openssh/Makefile | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'security/openssh') diff --git a/security/openssh/Makefile b/security/openssh/Makefile index 2f2ab5a32a7c..43468970732f 100644 --- a/security/openssh/Makefile +++ b/security/openssh/Makefile @@ -117,18 +117,22 @@ post-patch: ${WRKSRC}/*.[ch] post-install: - @if [ ! -f ${PREFIX}/etc/ssh_config -a \ - ! -f ${PREFIX}/etc/sshd_config ]; then \ - cd ${WRKSRC} && ${MAKE} DESTDIR=${PREFIX} distribution; \ - else \ - ${ECHO_MSG} ">> ${PREFIX}/etc/ssh{,d}_config exists, not being replaced!"; \ - ${ECHO_MSG} ">> If this is left over from another version of SSH, you will"; \ - ${ECHO_MSG} ">> need to update it to work with OpenSSH."; \ - fi +.if !exists(${PREFIX}/etc/ssh_host_key) + @${ECHO_MSG} ">> Generating a secret host key." + ${PREFIX}/bin/ssh-keygen -N "" ${PREFIX}/etc/ssh_host_key +.endif .if !exists(${PREFIX}/etc/rc.d/sshd.sh) @${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/sshd.sh @${ECHO} "[ -x ${PREFIX}/sbin/sshd ] && ${PREFIX}/sbin/sshd && echo -n ' sshd'" >> ${PREFIX}/etc/rc.d/sshd.sh @${CHMOD} 0555 ${PREFIX}/etc/rc.d/sshd.sh .endif +.if !exists(${PREFIX}/etc/ssh_config) && !exists(${PREFIX}/etc/sshd_config) + @cd ${WRKSRC}; \ + ${MAKE} DESTDIR=${PREFIX} distribution +.else + @${ECHO_MSG} ">> ${PREFIX}/etc/ssh{,d}_config exists, not being replaced!" + @${ECHO_MSG} ">> If this is left over from another version of SSH, you will" + @${ECHO_MSG} ">> need to update it to work with OpenSSH." +.endif .include -- cgit