1999-11-08 06:20:54 +00:00
|
|
|
# New ports collection makefile for: OpenSSH
|
|
|
|
# Version required: 19991107
|
|
|
|
# Date created: 7 October 1999
|
|
|
|
# Whom: green
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
1999-11-13 05:55:42 +00:00
|
|
|
DISTNAME= src/usr.bin/ssh
|
|
|
|
PKGNAME= OpenSSH-1.2
|
|
|
|
CATEGORIES= security net
|
1999-11-18 01:46:43 +00:00
|
|
|
MASTER_SITES= # See ${CVS_SITES}
|
1999-11-08 06:20:54 +00:00
|
|
|
|
|
|
|
MAINTAINER= green@FreeBSD.org
|
|
|
|
|
1999-11-09 11:43:11 +00:00
|
|
|
LIB_DEPENDS= crypto.1:${PORTSDIR}/security/openssl
|
1999-11-08 06:20:54 +00:00
|
|
|
|
1999-11-11 14:33:23 +00:00
|
|
|
RESTRICTED= "Links with cryptographic code."
|
|
|
|
|
1999-11-13 05:55:42 +00:00
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
CAT?= /bin/cat
|
|
|
|
DISTFILES!= ${CAT} ${FILESDIR}/distfiles
|
|
|
|
|
|
|
|
CVS_CMD?= cvs -z3
|
1999-11-17 20:12:35 +00:00
|
|
|
CVS_DATE= Wed Nov 17 14:09:01 EST 1999
|
1999-11-18 01:46:43 +00:00
|
|
|
CVS_SITES= anoncvs@anoncvs1.ca.openbsd.org:/cvs \
|
|
|
|
:pserver:anoncvs@anoncvs1.usa.openbsd.org:/cvs
|
1999-11-13 05:55:42 +00:00
|
|
|
CRYPTOLIBS= -L${PREFIX}/lib -lcrypto
|
1999-11-08 06:20:54 +00:00
|
|
|
.if defined(USA_RESIDENT) && ${USA_RESIDENT} == YES
|
1999-11-13 05:55:42 +00:00
|
|
|
CRYPTOLIBS+= -lRSAglue -lrsaref
|
1999-11-08 06:20:54 +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}"
|
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
|
|
|
|
.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 \
|
|
|
|
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-17 20:12:35 +00:00
|
|
|
cd ${DISTDIR}/${PKGNAME} || exit; \
|
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 \
|
|
|
|
${ECHO} -n ${CVS_DATE} > ${STAMPFILE}; \
|
|
|
|
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"; \
|
|
|
|
${ECHO_MSG} ">> this port manually into ${_DISTDIR} 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
|
|
|
|
|
|
|
do-extract:
|
1999-11-13 05:55:42 +00:00
|
|
|
@${MKDIR} ${WRKDIR}
|
|
|
|
@${CP} -r ${DISTDIR}/${PKGNAME}/${DISTNAME} ${WRKDIR}
|
1999-11-11 14:33:23 +00:00
|
|
|
@${CP} ${FILESDIR}/strlcpy.c ${WRKSRC}/lib/
|
|
|
|
|
1999-11-13 05:55:42 +00:00
|
|
|
post-patch:
|
1999-11-17 17:19:28 +00:00
|
|
|
@${PERL} -pi.orig -e 's:(_PATH_STDPATH):$$1 "${PREFIX}/bin":g' \
|
1999-11-18 01:46:43 +00:00
|
|
|
${WRKSRC}/sshd.c
|
1999-11-13 05:55:42 +00:00
|
|
|
@${PERL} -pi.orig -e 's:__PREFIX__:${PREFIX}:g' ${WRKSRC}/ssh.h
|
|
|
|
@${PERL} -pi.orig -e 's:__PREFIX__:${PREFIX}:g' ${WRKSRC}/sshd_config
|
1999-11-17 17:19:28 +00:00
|
|
|
@${PERL} -pi.openssl -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-08 06:20:54 +00:00
|
|
|
pre-install:
|
1999-11-17 20:12:35 +00:00
|
|
|
@if [ ! -f ${PREFIX}/etc/sshd_config ]; then \
|
|
|
|
cd ${WRKSRC} && ${MAKE} DESTDIR=${PREFIX} distribution; \
|
|
|
|
else \
|
1999-11-18 01:46:43 +00:00
|
|
|
${ECHO_MSG} ">> ${PREFIX}/etc/sshd_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."; \
|
1999-11-17 20:12:35 +00:00
|
|
|
fi
|
1999-11-08 06:20:54 +00:00
|
|
|
|
1999-11-13 05:55:42 +00:00
|
|
|
post-install:
|
|
|
|
@if [ ! -f ${PREFIX}/etc/rc.d/sshd.sh ]; then \
|
1999-11-18 01:46:43 +00:00
|
|
|
${ECHO_MSG} ">> Installing ${PREFIX}/etc/rc.d/sshd.sh startup file."; \
|
|
|
|
${MKDIR} ${PREFIX}/etc/rc.d; \
|
|
|
|
${INSTALL_SCRIPT} ${FILESDIR}/sshd.sh \
|
|
|
|
${PREFIX}/etc/rc.d; \
|
|
|
|
${PERL} -pi -e 's:__PREFIX__:${PREFIX}:g' \
|
|
|
|
${PREFIX}/etc/rc.d/sshd.sh; \
|
1999-11-13 05:55:42 +00:00
|
|
|
fi
|
1999-11-18 01:46:43 +00:00
|
|
|
@if [ ! -f ${PREFIX}/etc/ssh_host_key ]; then \
|
|
|
|
${ECHO_MSG} "Generating a secret host key..."; \
|
|
|
|
${PREFIX}/bin/ssh-keygen -N "" -f ${PREFIX}/etc/ssh_host_key; \
|
|
|
|
fi
|
|
|
|
|
1999-11-13 05:55:42 +00:00
|
|
|
|
1999-11-08 06:20:54 +00:00
|
|
|
.include <bsd.port.mk>
|