1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-18 19:49:40 +00:00
freebsd-ports/security/putty/Makefile
Matthias Andree aeada4ef18 security/putty: permanently remove GSSAPI_DYNAMIC
While it seems a nice idea to load the GSS provider library at run-time,
the existing search code hardwires library versions and only works
with krb5 (MIT Kerberos), and does not attempt to control library paths.

This sort of defeats the purpose, and we do not need a brittle
alternative for a robust GSSAPI_MIT.

So, drop the commented-out GSSAPI_DYNAMIC stuff from the Makefile.
2022-09-18 15:01:37 +02:00

116 lines
3.5 KiB
Makefile

PORTNAME= putty
DISTVERSION= 0.78~pre20220916.e1b73f0
PORTREVISION= 3
CATEGORIES= security
#MASTER_SITES= http://the.earth.li/~sgtatham/putty/${PORTVERSION}/ \
# ftp://ftp.chiark.greenend.org.uk/users/sgtatham/putty-latest/
MASTER_SITES= https://tartarus.org/~simon/putty-prerel-snapshots/
EXTRA_PATCHES+= ${FILESDIR}/0001-Unix-GSSAPI-support-krb5-config-as-well-as-pkg-confi.patch
EXTRA_PATCHES+= ${FILESDIR}/0002-Unix-static-GSSAPI-fix-an-uninitialised-structure-fi.patch
EXTRA_PATCHES+= ${FILESDIR}/0003-Unix-GSSAPI-support-static-linking-against-Heimdal.patch
EXTRA_PATCHES+= ${FILESDIR}/0004-GSSAPI-fix-don-t-pass-GSS_C_NO_NAME-to-inquire_cred_.patch
PATCH_STRIP= -p1
MAINTAINER= mandree@FreeBSD.org
COMMENT= Secure shell and telnet client including xterm emulator
WWW= https://www.chiark.greenend.org.uk/~sgtatham/putty/
# test plan: test ALL 4 GSSAPI_* options, GTK3 yes/no, WITH_DEBUG=yes build.
LICENSE= MIT
LICENSE_FILE= ${PATCH_WRKSRC}/LICENCE
USES= cmake cpe perl5 pkgconfig
USE_PERL5= build
CONFLICTS_INSTALL?= pssh* putty-nogtk*
PLIST_FILES= bin/pageant \
bin/plink \
bin/pscp \
bin/psftp \
bin/psusan \
bin/puttygen \
share/man/man1/pageant.1.gz \
share/man/man1/plink.1.gz \
share/man/man1/pscp.1.gz \
share/man/man1/psftp.1.gz \
share/man/man1/psusan.1.gz \
share/man/man1/puttygen.1.gz
OPTIONS_DEFINE= GTK3
OPTIONS_DEFAULT= GSSAPI_BASE GTK3
OPTIONS_SINGLE= GSSAPI_SELECT
OPTIONS_SINGLE_GSSAPI_SELECT= GSSAPI_BASE \
GSSAPI_HEIMDAL \
GSSAPI_MIT \
GSSAPI_NONE
.include <bsd.port.options.mk>
LDFLAGS+= -Wl,--as-needed
# XXX FIXME this is simplified on these assumptions:
# - we only support GTK3 in FreeBSD
# (Putty would support EOL GTK2 and GTK1 as well)
# - Putty 0.77 cannot have X11 without the gdk/gdkx.h header i. e. GTK.
.if ${PORT_OPTIONS:MGTK3} && !defined(WITHOUT_X11)
USES+= xorg
USE_XORG= x11
USES+= gnome
USE_GNOME= cairo gdkpixbuf2 gtk30
CMAKE_ARGS+= -DPUTTY_GTK_VERSION:STRING=3
PLIST_FILES+= bin/pterm \
bin/putty \
share/man/man1/pterm.1.gz \
share/man/man1/putty.1.gz \
share/pixmaps/putty.ico
DESKTOP_ENTRIES= "PuTTY" \
"${COMMENT}" \
"${PREFIX}/share/pixmaps/${PORTNAME}.ico" \
"${PORTNAME}" \
"" \
false
.else
# XXX FIXME HACK ALERT
# PUTTY_GTK_VERSION=OFF is not a valid choice, but manages to
# skip all version comparisons for GTK in cmake/gtk.cmake:
CMAKE_ARGS+= -DPUTTY_GTK_VERSION:STRING=OFF
# this is standard stuff:
CMAKE_ARGS+= -DCMAKE_DISABLE_FIND_PACKAGE_X11:BOOL=TRUE
.endif
.if ${PORT_OPTIONS:MGSSAPI_BASE} # Heimdal-like in base system
USES+= gssapi:base,flags
CMAKE_ARGS+= -DPUTTY_GSSAPI:STRING=STATIC -DKRB5_CONFIG:PATH=${KRB5CONFIG}
.elif ${PORT_OPTIONS:MGSSAPI_HEIMDAL}
USES+= gssapi:heimdal,flags
CMAKE_ARGS+= -DPUTTY_GSSAPI:STRING=STATIC -DKRB5_CONFIG:PATH=${KRB5CONFIG}
.elif ${PORT_OPTIONS:MGSSAPI_MIT}
USES+= gssapi:mit,flags
CMAKE_ARGS+= -DPUTTY_GSSAPI:STRING=STATIC -DKRB5_CONFIG:PATH=${KRB5CONFIG}
.else
CMAKE_ARGS+= -DPUTTY_GSSAPI:STRING=OFF
.endif
post-patch:
# we don't want to inherit FreeBSD commits
# as PUTTY Git commit revisions,
# so pretend we do not have Git:
${REINPLACE_CMD} '/FindGit/d' \
${WRKSRC}/cmake/setup.cmake \
${WRKSRC}/doc/CMakeLists.txt
# nuke pkg-config detection of GSSAPI/Kerberos libs,
# it interferes with FreeBSD's krb5-config approach
${REINPLACE_CMD} '/pkg_check_modules(KRB5 krb5-gssapi)/d' \
${WRKSRC}/cmake/platforms/unix.cmake
post-install:
.if ${PORT_OPTIONS:MGTK3}
@${MKDIR} ${STAGEDIR}${PREFIX}/share/pixmaps
${INSTALL_DATA} ${WRKSRC}/windows/putty.ico \
${STAGEDIR}${PREFIX}/share/pixmaps/
.endif
.include <bsd.port.mk>