aboutsummaryrefslogtreecommitdiff
path: root/security/openssh/Makefile
diff options
context:
space:
mode:
authorDirk Meyer <dinoex@FreeBSD.org>2002-06-24 21:13:06 +0000
committerDirk Meyer <dinoex@FreeBSD.org>2002-06-24 21:13:06 +0000
commit499707792a06b5da6a172581a313c3a0ef69806b (patch)
treef60b30dcf7200e30ccb95bca2e280b78e0e243c8 /security/openssh/Makefile
parent962d4b2483d300de811dc0b0334e2008d3659c3d (diff)
downloadports-499707792a06b5da6a172581a313c3a0ef69806b.tar.gz
ports-499707792a06b5da6a172581a313c3a0ef69806b.zip
Notes
Diffstat (limited to 'security/openssh/Makefile')
-rw-r--r--security/openssh/Makefile61
1 files changed, 39 insertions, 22 deletions
diff --git a/security/openssh/Makefile b/security/openssh/Makefile
index c6040f36f702..1243e9ef86ce 100644
--- a/security/openssh/Makefile
+++ b/security/openssh/Makefile
@@ -7,6 +7,7 @@
PORTNAME= openssh
PORTVERSION= 3.3
+PORTREVISION= 1
CATEGORIES= security
MASTER_SITES= ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/ \
ftp://ftp.usa.openbsd.org/pub/OpenBSD/OpenSSH/ \
@@ -28,6 +29,10 @@ MODIFY= ssh.h sshd_config sshd.sh pathnames.h
FIXME= lib/Makefile scp/Makefile sftp/Makefile sftp-server/Makefile \
ssh/Makefile ssh-add/Makefile ssh-agent/Makefile \
ssh-keygen/Makefile ssh-keyscan/Makefile sshd/Makefile
+PRECIOUS= ssh_config sshd_config \
+ ssh_host_key ssh_host_key.pub \
+ ssh_host_rsa_key ssh_host_rsa_key.pub \
+ ssh_host_dsa_key ssh_host_dsa_key.pub
.include <bsd.port.pre.mk>
@@ -59,6 +64,8 @@ MAKE_ENV+= PAM=${PAM}
.if defined(SKEY) && ${SKEY} == YES
MAKE_ENV+= SKEY=yes
.endif
+ETCOLD= ${PREFIX}/etc
+ETCSSH= ${PREFIX}/etc/ssh
WRKSRC= ${WRKDIR}/ssh
post-extract:
@@ -72,17 +79,18 @@ post-extract:
.endif
post-patch:
- @${MV} ${WRKSRC}/sshd_config ${WRKSRC}/sshd_config.sed
- ${SED} -e "s=/etc/ssh=${PREFIX}/etc/ssh=" \
+.for i in ${MODIFY:S/pathnames.h//} ${MAN1:S/slogin.1//} ${MAN5} ${MAN8}
+ @${MV} ${WRKSRC}/${i} ${WRKSRC}/${i}.sed
+ ${SED} -e "s=/etc/ssh=${ETCSSH}/ssh=" \
-e "s=/usr/libex=${PREFIX}/libex=" \
- ${WRKSRC}/sshd_config.sed > ${WRKSRC}/sshd_config
-.for i in ${MODIFY}
+ -e 's:__PREFIX__:${PREFIX}:g' \
+ ${WRKSRC}/${i}.sed >${WRKSRC}/${i}
+.endfor
+.for i in pathnames.h
@${MV} ${WRKSRC}/${i} ${WRKSRC}/${i}.sed
- ${SED} -e 's:__PREFIX__:${PREFIX}:g' ${WRKSRC}/${i}.sed >${WRKSRC}/${i}
+ ${SED} -e 's:__PREFIX__:${PREFIX}:g' \
+ ${WRKSRC}/${i}.sed >${WRKSRC}/${i}
.endfor
- @${PERL5} -pi -e 's:__PREFIX__:${PREFIX}:g' ${WRKSRC}/ssh.h \
- ${WRKSRC}/sshd_config ${WRKSRC}/sshd.sh \
- ${WRKSRC}/pathnames.h
.if ${OSVERSION} < 430000
post-configure:
@@ -99,34 +107,43 @@ post-configure:
pre-install:
${MKDIR} ${PREFIX}/libdata/ssh
+ ${MKDIR} ${PREFIX}/empty
+ ${MKDIR} ${ETCSSH}
+.for i in ${PRECIOUS}
+.if exists(${PREFIX}/etc/${i})
+ @${ECHO_MSG} ">> Linking ${ETCSSH}/${i} from old layout."
+ @${LN} ${ETCOLD}/${i} ${ETCSSH}/${i}
+.endif
+.endfor
post-install:
.if !defined(BATCH)
-.if !exists(${PREFIX}/etc/ssh_host_key)
+.if !exists(${ETCSSH}/ssh_host_key) && !exists(${ETCOLD}/ssh_host_key)
@${ECHO_MSG} ">> Generating an RSA1 secret host key."
- ${PREFIX}/bin/ssh-keygen -t rsa1 -N "" -f ${PREFIX}/etc/ssh_host_key
+ ${PREFIX}/bin/ssh-keygen -t rsa1 -N "" -f ${ETCSSH}/ssh_host_key
.endif
-.if !exists(${PREFIX}/etc/ssh_host_rsa_key)
+.if !exists(${ETCSSH}/ssh_host_rsa_key) && !exists(${ETCOLD}/ssh_host_rsa_key)
@${ECHO_MSG} ">> Generating a RSA secret host key."
- ${PREFIX}/bin/ssh-keygen -t rsa -N "" -f ${PREFIX}/etc/ssh_host_rsa_key
+ ${PREFIX}/bin/ssh-keygen -t rsa -N "" -f ${ETCSSH}/ssh_host_rsa_key
.endif
-.if !exists(${PREFIX}/etc/ssh_host_dsa_key)
+.if !exists(${ETCSSH}/ssh_host_dsa_key) && !exists(${ETCOLD}/ssh_host_dsa_key)
@${ECHO_MSG} ">> Generating a DSA secret host key."
- ${PREFIX}/bin/ssh-keygen -t dsa -N "" -f ${PREFIX}/etc/ssh_host_dsa_key
+ ${PREFIX}/bin/ssh-keygen -t dsa -N "" -f ${ETCSSH}/ssh_host_dsa_key
.endif
.endif
-.if !exists(${PREFIX}/etc/moduli)
+.if !exists(${ETCSSH}/moduli) && !exists(${ETCOLD}/moduli)
@${ECHO_MSG} ">> Installing moduli."
- ${INSTALL_DATA} -c ${FILESDIR}/moduli ${PREFIX}/etc/moduli
+ ${INSTALL_DATA} -c ${FILESDIR}/moduli ${ETCSSH}/moduli
.endif
${INSTALL_SCRIPT} ${WRKSRC}/sshd.sh ${PREFIX}/etc/rc.d/sshd.sh.sample
- ${INSTALL_DATA} -c ${WRKSRC}/ssh_config ${PREFIX}/etc/ssh_config-dist
- ${INSTALL_DATA} -c ${WRKSRC}/sshd_config ${PREFIX}/etc/sshd_config-dist
-.if !exists(${PREFIX}/etc/ssh_config) && !exists(${PREFIX}/etc/sshd_config)
- ${INSTALL_DATA} -c ${WRKSRC}/ssh_config ${PREFIX}/etc/ssh_config
- ${INSTALL_DATA} -c ${WRKSRC}/sshd_config ${PREFIX}/etc/sshd_config
+ ${INSTALL_DATA} -c ${WRKSRC}/ssh_config ${ETCSSH}/ssh_config-dist
+ ${INSTALL_DATA} -c ${WRKSRC}/sshd_config ${ETCSSH}/sshd_config-dist
+.if !exists(${ETCSSH}/ssh_config) && !exists(${ETCSSH}/sshd_config) \
+ && !exists(${ETCOLD}/ssh_config) && !exists(${ETCOLD}/sshd_config)
+ ${INSTALL_DATA} -c ${WRKSRC}/ssh_config ${ETCSSH}/ssh_config
+ ${INSTALL_DATA} -c ${WRKSRC}/sshd_config ${ETCSSH}/sshd_config
.else
- @${ECHO_MSG} ">> ${PREFIX}/etc/ssh{,d}_config exists, not being replaced!"
+ @${ECHO_MSG} ">> ${ETCSSH}/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