1999-11-08 06:20:54 +00:00
|
|
|
# New ports collection makefile for: OpenSSH
|
1999-11-24 03:36:23 +00:00
|
|
|
# Version required: 1.2
|
1999-11-08 06:20:54 +00:00
|
|
|
# Date created: 7 October 1999
|
|
|
|
# Whom: green
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
1999-11-13 05:55:42 +00:00
|
|
|
DISTNAME= src/usr.bin/ssh
|
2000-02-01 08:12:06 +00:00
|
|
|
PKGNAME= OpenSSH-1.2.2
|
2000-01-18 11:18:25 +00:00
|
|
|
CATEGORIES= security net ipv6
|
1999-11-21 16:42:44 +00:00
|
|
|
# ${MASTER_SITES} is only for if CVS won't work, period.
|
1999-11-21 23:10:48 +00:00
|
|
|
MASTER_SITES= ftp://internat.FreeBSD.org/pub/Crypto/OpenSSH/
|
1999-11-08 06:20:54 +00:00
|
|
|
|
|
|
|
MAINTAINER= green@FreeBSD.org
|
|
|
|
|
2000-02-12 23:55:48 +00:00
|
|
|
USE_OPENSSL= RSA
|
1999-11-08 06:20:54 +00:00
|
|
|
|
1999-11-13 05:55:42 +00:00
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
CAT?= /bin/cat
|
2000-02-01 08:12:06 +00:00
|
|
|
SED?= /usr/bin/sed
|
|
|
|
DISTFILES!= ${SED} 's:^\(.*\)$$:${PKGNAME}/\1:g' ${FILESDIR}/distfiles
|
|
|
|
IGNOREFILES!= ${SED} 's:^\(.*\)$$:${PKGNAME}/\1:g' ${FILESDIR}/ignorefiles
|
2000-01-26 11:34:28 +00:00
|
|
|
DISTFILES+= ${IGNOREFILES}
|
1999-11-13 05:55:42 +00:00
|
|
|
|
|
|
|
CVS_CMD?= cvs -z3
|
2000-02-01 08:12:06 +00:00
|
|
|
CVS_DATE= Tue Feb 1 02:19:07 EST 2000
|
1999-11-21 16:42:44 +00:00
|
|
|
SED?= /usr/bin/sed
|
1999-12-08 04:06:38 +00:00
|
|
|
CVS_DATE_!= ${ECHO} -n "${CVS_DATE}" | ${SED} 's/[ \t:]/_/g'
|
1999-11-18 01:46:43 +00:00
|
|
|
CVS_SITES= anoncvs@anoncvs1.ca.openbsd.org:/cvs \
|
|
|
|
:pserver:anoncvs@anoncvs1.usa.openbsd.org:/cvs
|
2000-02-12 23:55:48 +00:00
|
|
|
CRYPTOLIBS= -L${OPENSSLLIB} -lcrypto
|
|
|
|
.if defined(OPENSSL_RSAREF)
|
|
|
|
CRYPTOLIBS+= -lRSAglue -L${LOCALBASE}/lib -lrsaref
|
2000-02-10 12:23:49 +00:00
|
|
|
.endif
|
1999-11-13 05:55:42 +00:00
|
|
|
# Here, MANDIR is concetenated to DESTDIR which all forms the man install dir...
|
|
|
|
MAKE_ENV= DESTDIR=${PREFIX} MANDIR=/man/man CRYPTOLIBS="${CRYPTOLIBS}"
|
2000-01-18 11:18:25 +00:00
|
|
|
.if ${OSVERSION} < 400014
|
|
|
|
MAKE_ENV+= COMPAT_GETADDRINFO=yes
|
2000-02-01 17:04:02 +00:00
|
|
|
.else
|
2000-02-09 03:28:48 +00:00
|
|
|
MAKE_ENV+= INET6FLAGS=-DINET6
|
2000-01-18 11:18:25 +00:00
|
|
|
.endif
|
1999-11-11 14:33:23 +00:00
|
|
|
.if !exists(/usr/include/tcpd.h)
|
1999-11-15 06:18:46 +00:00
|
|
|
MAKE_ENV+= TCP_WRAPPERS=no
|
|
|
|
.endif
|
|
|
|
.if defined(AFS) && ${AFS} == YES
|
|
|
|
MAKE_ENV+= AFS=yes
|
|
|
|
.endif
|
|
|
|
.if defined(KERBEROS) && ${KERBEROS} == YES
|
|
|
|
MAKE_ENV+= KERBEROS=yes
|
|
|
|
.endif
|
1999-11-29 07:09:45 +00:00
|
|
|
.if exists(/usr/include/security/pam_modules.h)
|
|
|
|
PAM?= yes
|
|
|
|
.else
|
|
|
|
PAM= no
|
|
|
|
.endif
|
|
|
|
MAKE_ENV+= PAM=${PAM}
|
1999-11-15 06:18:46 +00:00
|
|
|
.if defined(SKEY) && ${SKEY} == YES
|
|
|
|
MAKE_ENV+= SKEY=yes
|
1999-11-11 14:33:23 +00:00
|
|
|
.endif
|
1999-11-13 05:55:42 +00:00
|
|
|
STAMPFILE= ${DISTDIR}/${PKGNAME}/.stamp
|
1999-11-08 06:20:54 +00:00
|
|
|
WRKSRC= ${WRKDIR}/ssh
|
|
|
|
|
1999-11-11 14:33:23 +00:00
|
|
|
do-fetch:
|
1999-11-13 05:55:42 +00:00
|
|
|
@if [ ! -e ${STAMPFILE} ] || \
|
|
|
|
[ "X${CVS_DATE}" != "X$$(${CAT} ${STAMPFILE})" ]; then \
|
1999-11-21 16:42:44 +00:00
|
|
|
if [ -e ${DISTDIR}/${PKGNAME}.${CVS_DATE_}.tar.gz ]; then \
|
|
|
|
cd ${DISTDIR}; \
|
|
|
|
${TAR} xfz ${PKGNAME}.${CVS_DATE_}.tar.gz \
|
|
|
|
${DISTFILES}; \
|
1999-12-08 04:06:38 +00:00
|
|
|
${ECHO} -n "${CVS_DATE}" > ${STAMPFILE}; \
|
1999-11-21 16:42:44 +00:00
|
|
|
exit; \
|
|
|
|
fi; \
|
1999-11-13 05:55:42 +00:00
|
|
|
unset CVS_RSH CVS_SERVER || ${TRUE}; \
|
1999-11-15 06:48:02 +00:00
|
|
|
if [ -n "${PORTS_CVS_RSH}" ]; then \
|
|
|
|
export CVS_RSH="${PORTS_CVS_RSH}"; \
|
|
|
|
fi; \
|
1999-11-13 05:55:42 +00:00
|
|
|
${MKDIR} ${DISTDIR}/${PKGNAME} && \
|
1999-11-20 01:52:21 +00:00
|
|
|
cd ${DISTDIR}/${PKGNAME}; \
|
1999-11-18 01:46:43 +00:00
|
|
|
for CVS_SITE in ${CVS_SITES}; do \
|
|
|
|
${ECHO_MSG} ">> Attempting to CVS checkout from $${CVS_SITE}."; \
|
|
|
|
if ${CVS_CMD} -d $${CVS_SITE} co -D "${CVS_DATE}" \
|
|
|
|
${DISTNAME}; then \
|
2000-02-01 08:12:06 +00:00
|
|
|
${ECHO} -n "${CVS_DATE}" > ${STAMPFILE}; \
|
1999-11-18 01:46:43 +00:00
|
|
|
exit; \
|
|
|
|
fi \
|
1999-11-17 20:12:35 +00:00
|
|
|
done; \
|
1999-11-18 01:46:43 +00:00
|
|
|
${ECHO_MSG} ">> Couldn't CVS checkout ${PKGNAME}. Please try to retrieve"; \
|
1999-11-21 16:42:44 +00:00
|
|
|
${ECHO_MSG} ">> a snapshot with \"make fetchsrctarball\" and try again."; \
|
1999-11-17 20:12:35 +00:00
|
|
|
exit 1; \
|
1999-11-11 20:49:44 +00:00
|
|
|
fi
|
1999-11-11 14:33:23 +00:00
|
|
|
|
1999-11-21 16:42:44 +00:00
|
|
|
makesrctarball: fetch
|
|
|
|
@cd ${DISTDIR}; \
|
|
|
|
${ECHO_MSG} ">> Creating source tarball in ${DISTDIR}"; \
|
|
|
|
${ECHO_MSG} ">> \"${PKGNAME}.${CVS_DATE_}.tar.gz\"."; \
|
|
|
|
${TAR} cfz ${PKGNAME}.${CVS_DATE_}.tar.gz ${PKGNAME}
|
|
|
|
|
|
|
|
fetchsrctarball:
|
|
|
|
@cd ${DISTDIR}; \
|
|
|
|
file=${PKGNAME}.${CVS_DATE_}.tar.gz; \
|
|
|
|
if [ -e $$file ]; then \
|
|
|
|
exit; \
|
|
|
|
fi; \
|
|
|
|
${ECHO_MSG} ">> $$file doesn't seem to exist on this system."; \
|
|
|
|
for site in ${MASTER_SITES}; do \
|
|
|
|
${ECHO_MSG} ">> Attempting to fetch from $${site}."; \
|
|
|
|
if ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} \
|
|
|
|
$${site}$${file}; then \
|
|
|
|
exit; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
|
|
|
${ECHO_MSG} ">> Couldn't fetch $$file."; \
|
|
|
|
${ECHO_MSG} ">> Please try to retrieve this file manually into"; \
|
2000-01-18 11:18:25 +00:00
|
|
|
${ECHO_MSG} ">> ${_DISTDIR} and try again."; \
|
1999-11-21 16:42:44 +00:00
|
|
|
exit 1
|
|
|
|
|
1999-11-11 14:33:23 +00:00
|
|
|
do-extract:
|
1999-11-13 05:55:42 +00:00
|
|
|
@${MKDIR} ${WRKDIR}
|
|
|
|
@${CP} -r ${DISTDIR}/${PKGNAME}/${DISTNAME} ${WRKDIR}
|
1999-11-24 03:36:23 +00:00
|
|
|
@${CP} ${FILESDIR}/strlcat.c ${FILESDIR}/strlcpy.c ${WRKSRC}/lib/
|
2000-01-18 11:18:25 +00:00
|
|
|
.if ${OSVERSION} < 400014
|
2000-01-13 23:22:17 +00:00
|
|
|
@${CP} ${FILESDIR}/getaddrinfo.c ${FILESDIR}/name6.c ${WRKSRC}/lib/
|
|
|
|
@${CP} ${FILESDIR}/bindresvport.c ${FILESDIR}/rcmd.c ${WRKSRC}/lib/
|
2000-01-18 11:18:25 +00:00
|
|
|
@${CP} ${FILESDIR}/getnameinfo.c ${WRKSRC}/lib/
|
2000-01-13 23:22:17 +00:00
|
|
|
@${CP} ${FILESDIR}/netdb.h ${WRKSRC}/
|
|
|
|
.endif
|
1999-11-29 07:09:45 +00:00
|
|
|
@${MKDIR} ${WRKSRC}/pam_ssh
|
|
|
|
@${CP} ${FILESDIR}/pam_ssh_Makefile ${WRKSRC}/pam_ssh/Makefile
|
|
|
|
@${CP} ${FILESDIR}/pam_ssh.c ${WRKSRC}/pam_ssh/
|
1999-11-11 14:33:23 +00:00
|
|
|
|
1999-11-13 05:55:42 +00:00
|
|
|
post-patch:
|
In the meantime (while things are being worked and decided on on the
OpenBSD OpenSSH front), add ConnectionsPerPeriod to prevent DoS via
running the system out of resources. In reality, this wouldn't
be a full DoS, but would make a system slower, but this is a better
thing to do than let the system get loaded down.
So here we are, rate-limiting. The default settings are now:
Five connections are allowed to authenticate (and not be rejected) in
a period of ten seconds.
One minute is given for login grace time.
More work in this area is being done by alfred@FreeBSD.org and
markus@OpenBSD.org, at the very least. This is, essentially, a
stopgap solution; however, it is a properly implemented and documented
one, and has an easily modifiable framework.
1999-12-06 06:32:22 +00:00
|
|
|
@${PERL} -pi -e 's:__PREFIX__:${PREFIX}:g' ${WRKSRC}/ssh.h \
|
1999-11-29 07:09:45 +00:00
|
|
|
${WRKSRC}/sshd_config ${WRKSRC}/pam_ssh/pam_ssh.c
|
In the meantime (while things are being worked and decided on on the
OpenBSD OpenSSH front), add ConnectionsPerPeriod to prevent DoS via
running the system out of resources. In reality, this wouldn't
be a full DoS, but would make a system slower, but this is a better
thing to do than let the system get loaded down.
So here we are, rate-limiting. The default settings are now:
Five connections are allowed to authenticate (and not be rejected) in
a period of ten seconds.
One minute is given for login grace time.
More work in this area is being done by alfred@FreeBSD.org and
markus@OpenBSD.org, at the very least. This is, essentially, a
stopgap solution; however, it is a properly implemented and documented
one, and has an easily modifiable framework.
1999-12-06 06:32:22 +00:00
|
|
|
@${PERL} -pi -e \
|
1999-11-18 01:46:43 +00:00
|
|
|
's:^(\s*#\s*include\s+<)ssl(/\w+\.h>\s*)$$:$$1openssl$$2:g' \
|
|
|
|
${WRKSRC}/*.[ch]
|
1999-11-13 05:55:42 +00:00
|
|
|
|
1999-11-29 07:09:45 +00:00
|
|
|
.if ${PAM} == yes
|
|
|
|
PLIST= ${WRKDIR}/PLIST
|
|
|
|
|
|
|
|
do-configure:
|
|
|
|
@${CP} ${PKGDIR}/PLIST ${PLIST}
|
|
|
|
@${ECHO} "@cwd /usr" >> ${PLIST}
|
|
|
|
@${ECHO} "lib/pam_ssh.so" >> ${PLIST}
|
|
|
|
.endif
|
|
|
|
|
1999-11-20 03:42:05 +00:00
|
|
|
post-install:
|
1999-11-22 22:45:47 +00:00
|
|
|
.if !exists(${PREFIX}/etc/ssh_host_key)
|
|
|
|
@${ECHO_MSG} ">> Generating a secret host key."
|
1999-11-23 03:04:05 +00:00
|
|
|
${PREFIX}/bin/ssh-keygen -N "" -f ${PREFIX}/etc/ssh_host_key
|
1999-11-22 22:45:47 +00:00
|
|
|
.endif
|
1999-11-20 03:42:05 +00:00
|
|
|
.if !exists(${PREFIX}/etc/rc.d/sshd.sh)
|
|
|
|
@${ECHO} "#!/bin/sh" > ${PREFIX}/etc/rc.d/sshd.sh
|
1999-11-20 03:55:29 +00:00
|
|
|
@${ECHO} "[ -x ${PREFIX}/sbin/sshd ] && ${PREFIX}/sbin/sshd && echo -n ' sshd'" >> ${PREFIX}/etc/rc.d/sshd.sh
|
1999-11-20 03:42:05 +00:00
|
|
|
@${CHMOD} 0555 ${PREFIX}/etc/rc.d/sshd.sh
|
|
|
|
.endif
|
1999-11-22 22:45:47 +00:00
|
|
|
.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
|
1999-11-13 05:55:42 +00:00
|
|
|
|
2000-01-07 16:40:17 +00:00
|
|
|
.include <bsd.port.post.mk>
|