1999-11-08 07:20:54 +01:00
|
|
|
# New ports collection makefile for: OpenSSH
|
|
|
|
# Date created: 7 October 1999
|
|
|
|
# Whom: green
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
2001-10-03 15:15:16 +02:00
|
|
|
PORTNAME= openssh
|
2003-04-02 06:25:48 +02:00
|
|
|
PORTVERSION= 3.6.1
|
2006-06-09 23:54:03 +02:00
|
|
|
PORTREVISION= 6
|
2006-12-22 09:03:27 +01:00
|
|
|
CATEGORIES= security ipv6
|
2000-05-13 19:11:01 +02:00
|
|
|
MASTER_SITES= ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/ \
|
|
|
|
ftp://ftp.usa.openbsd.org/pub/OpenBSD/OpenSSH/ \
|
|
|
|
ftp://ftp1.se.openbsd.org/pub/OpenBSD/OpenSSH/
|
2004-03-26 20:56:41 +01:00
|
|
|
PKGNAMESUFFIX?= ${SKEY_SUFFIX}${PKGNAMESUFFIX2}
|
2000-06-27 23:30:39 +02:00
|
|
|
DISTNAME= openssh-${PORTVERSION}
|
2001-11-18 16:28:27 +01:00
|
|
|
EXTRACT_SUFX= .tgz
|
|
|
|
|
2001-12-01 21:20:28 +01:00
|
|
|
PATCH_SITES= ${MASTER_SITES}
|
2002-05-31 09:28:46 +02:00
|
|
|
PATCHFILES= openbsd28_${PORTVERSION}.patch
|
1999-11-08 07:20:54 +01:00
|
|
|
|
2004-10-14 07:25:50 +02:00
|
|
|
MAINTAINER= ports@FreeBSD.org
|
2003-02-20 19:26:42 +01:00
|
|
|
COMMENT= OpenBSD's secure shell client and server (remote login program)
|
1999-11-08 07:20:54 +01:00
|
|
|
|
2003-10-13 06:05:54 +02:00
|
|
|
CONFLICTS?= openssh-portable-* openssh-gssapi-* ssh-1.* ssh2-3.*
|
2003-08-28 17:38:18 +02:00
|
|
|
USE_OPENSSL= yes
|
|
|
|
WRKSRC= ${WRKDIR}/ssh
|
|
|
|
|
2006-06-09 23:54:03 +02:00
|
|
|
USE_RC_SUBR= sshd
|
|
|
|
|
|
|
|
OPTIONS= AFS "With AFC Support" off \
|
|
|
|
KERBEROS "With Kerberos Support" off \
|
|
|
|
SKEY "With SKEY Support" off
|
|
|
|
|
2001-06-11 22:14:15 +02:00
|
|
|
MAN1= scp.1 slogin.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh.1 \
|
|
|
|
ssh-keyscan.1 sftp.1
|
2002-06-22 14:31:18 +02:00
|
|
|
MAN5= ssh_config.5 sshd_config.5
|
|
|
|
MAN8= sshd.8 sftp-server.8 ssh-keysign.8
|
2001-04-02 12:28:59 +02:00
|
|
|
MANCOMPRESSED= yes
|
2003-08-28 17:38:18 +02:00
|
|
|
|
2006-06-09 23:54:03 +02:00
|
|
|
MODIFY= ssh.h sshd_config pathnames.h
|
2001-06-12 09:49:52 +02:00
|
|
|
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
|
2002-06-28 06:50:31 +02:00
|
|
|
ADDME+= auth-pam.c auth-pam.h auth2-pam.c
|
2002-06-25 00:57:13 +02:00
|
|
|
ADDLIB+= strlcat.c strlcpy.c \
|
|
|
|
getaddrinfo.c name6.c bindresvport.c rcmd.c getnameinfo.c
|
2002-06-24 23:13:06 +02:00
|
|
|
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
|
2002-07-04 20:27:59 +02:00
|
|
|
# PAM ist broken, use openssh-portable instead.
|
2002-06-25 00:57:13 +02:00
|
|
|
PAM=no
|
2001-06-10 13:15:04 +02:00
|
|
|
|
1999-11-13 06:55:42 +01:00
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
2000-02-13 00:55:48 +01:00
|
|
|
CRYPTOLIBS= -L${OPENSSLLIB} -lcrypto
|
1999-11-13 06:55:42 +01:00
|
|
|
# Here, MANDIR is concetenated to DESTDIR which all forms the man install dir...
|
2006-08-05 12:10:34 +02:00
|
|
|
MAKE_ENV+= LIBDATADIR=${PREFIX}/libdata MANDIR=${MANPREFIX}/man/man CRYPTOLIBS="${CRYPTOLIBS}"
|
2003-08-28 17:38:18 +02:00
|
|
|
|
1999-11-11 15:33:23 +01:00
|
|
|
.if !exists(/usr/include/tcpd.h)
|
1999-11-15 07:18:46 +01:00
|
|
|
MAKE_ENV+= TCP_WRAPPERS=no
|
|
|
|
.endif
|
2003-08-28 17:38:18 +02:00
|
|
|
|
2006-06-09 23:54:03 +02:00
|
|
|
.ifdef(WITH_AFS)
|
1999-11-15 07:18:46 +01:00
|
|
|
MAKE_ENV+= AFS=yes
|
|
|
|
.endif
|
2003-08-28 17:38:18 +02:00
|
|
|
|
2006-06-09 23:54:03 +02:00
|
|
|
.ifdef(WITH_KERBEROS)
|
1999-11-15 07:18:46 +01:00
|
|
|
MAKE_ENV+= KERBEROS=yes
|
|
|
|
.endif
|
2003-08-28 17:38:18 +02:00
|
|
|
|
1999-11-29 08:09:45 +01:00
|
|
|
.if exists(/usr/include/security/pam_modules.h)
|
|
|
|
PAM?= yes
|
|
|
|
.else
|
|
|
|
PAM= no
|
|
|
|
.endif
|
|
|
|
MAKE_ENV+= PAM=${PAM}
|
2003-08-28 17:38:18 +02:00
|
|
|
|
2006-06-09 23:54:03 +02:00
|
|
|
.ifdef(WITH_SKEY)
|
2004-03-26 20:56:41 +01:00
|
|
|
SKEY_SUFFIX= -skey
|
1999-11-15 07:18:46 +01:00
|
|
|
MAKE_ENV+= SKEY=yes
|
1999-11-11 15:33:23 +01:00
|
|
|
.endif
|
2003-08-28 17:38:18 +02:00
|
|
|
|
2002-06-26 06:01:02 +02:00
|
|
|
EMPTYDIR= ${PREFIX}/empty
|
2002-06-24 23:13:06 +02:00
|
|
|
ETCOLD= ${PREFIX}/etc
|
|
|
|
ETCSSH= ${PREFIX}/etc/ssh
|
2002-06-26 06:01:02 +02:00
|
|
|
PLIST_SUB+= EMPTYDIR=${EMPTYDIR}
|
1999-11-08 07:20:54 +01:00
|
|
|
|
2000-05-13 19:11:01 +02:00
|
|
|
post-extract:
|
2002-06-25 00:57:13 +02:00
|
|
|
.for i in ${ADDLIB}
|
|
|
|
@${CP} ${FILESDIR}/${i} ${WRKSRC}/lib/
|
|
|
|
.endfor
|
|
|
|
.for i in ${ADDME}
|
|
|
|
@${CP} ${FILESDIR}/${i} ${WRKSRC}/
|
|
|
|
.endfor
|
1999-11-11 15:33:23 +01:00
|
|
|
|
2006-08-05 12:10:34 +02:00
|
|
|
post-patch:
|
|
|
|
.for i in scp sftp ssh ssh-add ssh-agent ssh-keygen ssh-keyscan
|
|
|
|
@${REINPLACE_CMD} "s|BINDIR= /bin|BINDIR= ${PREFIX}/bin|" ${WRKSRC}/${i}/Makefile
|
|
|
|
.endfor
|
|
|
|
.for i in sftp-server ssh-keysign
|
|
|
|
@${REINPLACE_CMD} "s|BINDIR= /libexec|BINDIR= ${PREFIX}/libexec|" ${WRKSRC}/${i}/Makefile
|
|
|
|
.endfor
|
|
|
|
@${REINPLACE_CMD} "s|BINDIR= /sbin|BINDIR= ${PREFIX}/sbin|" ${WRKSRC}/sshd/Makefile
|
|
|
|
@${REINPLACE_CMD} "s|DATADIR= /libdata/ssh|DATADIR= ${PREFIX}/libdata/ssh|" ${WRKSRC}/scard/Makefile
|
|
|
|
|
2002-07-07 20:53:06 +02:00
|
|
|
pre-configure:
|
2002-06-24 23:13:06 +02:00
|
|
|
.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=" \
|
2002-06-16 17:03:10 +02:00
|
|
|
-e "s=/usr/libex=${PREFIX}/libex=" \
|
2002-06-24 23:13:06 +02:00
|
|
|
-e 's:__PREFIX__:${PREFIX}:g' \
|
|
|
|
${WRKSRC}/${i}.sed >${WRKSRC}/${i}
|
|
|
|
.endfor
|
|
|
|
.for i in pathnames.h
|
2002-06-16 17:03:10 +02:00
|
|
|
@${MV} ${WRKSRC}/${i} ${WRKSRC}/${i}.sed
|
2002-06-24 23:13:06 +02:00
|
|
|
${SED} -e 's:__PREFIX__:${PREFIX}:g' \
|
|
|
|
${WRKSRC}/${i}.sed >${WRKSRC}/${i}
|
2002-06-16 17:03:10 +02:00
|
|
|
.endfor
|
1999-11-29 08:09:45 +01:00
|
|
|
|
2001-10-03 15:15:16 +02:00
|
|
|
pre-install:
|
2002-06-26 06:01:02 +02:00
|
|
|
-${MKDIR} ${EMPTYDIR}
|
2002-06-25 00:57:13 +02:00
|
|
|
if ! pw groupshow sshd; then pw groupadd sshd -g 22; fi
|
|
|
|
if ! pw usershow sshd; then pw useradd sshd -g sshd -u 22 \
|
2002-06-26 06:01:02 +02:00
|
|
|
-h - -d ${EMPTYDIR} -s /nonexistent -c "sshd privilege separation"; fi
|
2001-10-03 15:15:16 +02:00
|
|
|
${MKDIR} ${PREFIX}/libdata/ssh
|
2002-06-26 06:01:02 +02:00
|
|
|
-@[ ! -d ${ETCSSH} ] && ${MKDIR} ${ETCSSH}
|
2002-06-24 23:13:06 +02:00
|
|
|
.for i in ${PRECIOUS}
|
2002-06-26 06:01:02 +02:00
|
|
|
-@[ -f ${ETCOLD}/${i} ] && [ ! -f ${ETCSSH}/${i} ] && \
|
|
|
|
${ECHO_MSG} ">> Linking ${ETCSSH}/${i} from old layout." && \
|
|
|
|
${LN} ${ETCOLD}/${i} ${ETCSSH}/${i}
|
2002-06-24 23:13:06 +02:00
|
|
|
.endfor
|
2001-10-03 15:15:16 +02:00
|
|
|
|
1999-11-20 04:42:05 +01:00
|
|
|
post-install:
|
2001-06-11 22:14:15 +02:00
|
|
|
.if !defined(BATCH)
|
2002-06-24 23:13:06 +02:00
|
|
|
.if !exists(${ETCSSH}/ssh_host_key) && !exists(${ETCOLD}/ssh_host_key)
|
2001-12-01 21:12:14 +01:00
|
|
|
@${ECHO_MSG} ">> Generating an RSA1 secret host key."
|
2002-06-24 23:13:06 +02:00
|
|
|
${PREFIX}/bin/ssh-keygen -t rsa1 -N "" -f ${ETCSSH}/ssh_host_key
|
1999-11-22 23:45:47 +01:00
|
|
|
.endif
|
2002-06-24 23:13:06 +02:00
|
|
|
.if !exists(${ETCSSH}/ssh_host_rsa_key) && !exists(${ETCOLD}/ssh_host_rsa_key)
|
2001-12-01 21:12:14 +01:00
|
|
|
@${ECHO_MSG} ">> Generating a RSA secret host key."
|
2002-06-24 23:13:06 +02:00
|
|
|
${PREFIX}/bin/ssh-keygen -t rsa -N "" -f ${ETCSSH}/ssh_host_rsa_key
|
2001-12-01 21:12:14 +01:00
|
|
|
.endif
|
2002-06-24 23:13:06 +02:00
|
|
|
.if !exists(${ETCSSH}/ssh_host_dsa_key) && !exists(${ETCOLD}/ssh_host_dsa_key)
|
2000-05-13 19:11:01 +02:00
|
|
|
@${ECHO_MSG} ">> Generating a DSA secret host key."
|
2002-06-24 23:13:06 +02:00
|
|
|
${PREFIX}/bin/ssh-keygen -t dsa -N "" -f ${ETCSSH}/ssh_host_dsa_key
|
2000-05-13 19:11:01 +02:00
|
|
|
.endif
|
2001-06-11 22:14:15 +02:00
|
|
|
.endif
|
2002-09-10 10:57:37 +02:00
|
|
|
.if !exists(${ETCSSH}/moduli)
|
2002-03-11 16:16:48 +01:00
|
|
|
@${ECHO_MSG} ">> Installing moduli."
|
2002-06-24 23:13:06 +02:00
|
|
|
${INSTALL_DATA} -c ${FILESDIR}/moduli ${ETCSSH}/moduli
|
2002-03-11 16:16:48 +01:00
|
|
|
.endif
|
2002-06-24 23:13:06 +02:00
|
|
|
${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
|
1999-11-22 23:45:47 +01:00
|
|
|
.else
|
2002-06-24 23:13:06 +02:00
|
|
|
@${ECHO_MSG} ">> ${ETCSSH}/ssh{,d}_config exists, not being replaced!"
|
1999-11-22 23:45:47 +01:00
|
|
|
@${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
|
2002-07-10 23:56:29 +02:00
|
|
|
@${CAT} ${PKGMESSAGE}
|
1999-11-13 06:55:42 +01:00
|
|
|
|
2000-01-07 17:40:17 +01:00
|
|
|
.include <bsd.port.post.mk>
|