aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Spil <brnrd@FreeBSD.org>2016-06-21 06:14:41 +0000
committerBernard Spil <brnrd@FreeBSD.org>2016-06-21 06:14:41 +0000
commit0917233fb0167d994e02c7680123ccb553302945 (patch)
tree69c7f2eca4cc6682b400747016a71e16532829a6
parent7cc668a9261b93ea87223e69823c9d0a762d6edd (diff)
downloadports-0917233fb0167d994e02c7680123ccb553302945.tar.gz
ports-0917233fb0167d994e02c7680123ccb553302945.zip
mail/fetchmail: Fix build without SSLv3
- Fix build with OpenSSL 1.1 and LibreSSL - Stop using pkg-install/pkg-deinstall scripts - Use pkg-plist keywords - Use GSSAPI ports framework - Change X11, POP2 options to use options framework PR: 210130 Submitted by: freebsd-ports@charlieroot.de Reviewed by: Corey Halpin <chalpin@cs.wisc.edu> (maintainer) Approved by: Corey Halpin <chalpin@cs.wisc.edu> (maintainer)
Notes
Notes: svn path=/head/; revision=417187
-rw-r--r--mail/fetchmail/Makefile77
-rw-r--r--mail/fetchmail/files/patch-fetchmail.c26
-rw-r--r--mail/fetchmail/files/patch-socket.c24
-rw-r--r--mail/fetchmail/files/pkg-deinstall.in13
-rw-r--r--mail/fetchmail/files/pkg-install.in13
-rw-r--r--mail/fetchmail/pkg-plist5
6 files changed, 82 insertions, 76 deletions
diff --git a/mail/fetchmail/Makefile b/mail/fetchmail/Makefile
index 372104fdf925..962fcb7d4992 100644
--- a/mail/fetchmail/Makefile
+++ b/mail/fetchmail/Makefile
@@ -3,7 +3,7 @@
PORTNAME= fetchmail
PORTVERSION= 6.3.26
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= mail ipv6
MASTER_SITES= SF/${PORTNAME}/branch_6.3/ \
http://mandree.home.pages.de/${PORTNAME}/
@@ -16,7 +16,6 @@ LICENSE_COMB= dual
RUN_DEPENDS= ${LOCALBASE}/share/certs/ca-root-nss.crt:security/ca_root_nss
-# Note USERS can only contain a single word as parts below rely on that.
USERS= ${PORTNAME}
GROUPS= ${USERS}
@@ -24,8 +23,7 @@ USES= cpe gmake shebangfix tar:xz
SHEBANG_FILES= fetchmailconf.py
USE_RC_SUBR= fetchmail
-SUB_FILES= pkg-message pkg-install pkg-deinstall
-SUB_LIST+= USERS=${USERS} GROUPS=${GROUPS} PORTNAME=${PORTNAME}
+SUB_FILES= pkg-message
GNU_CONFIGURE= yes
USE_OPENSSL= yes
@@ -36,60 +34,42 @@ CONFIGURE_ENV= ac_cv_have_decl_SSLv2_client_method=no
LDFLAGS+= -L${LOCALBASE}/lib
-OPTIONS_DEFINE= X11 NLS NTLM GSSAPI POP2 DOCS
-OPTIONS_DEFAULT= GSSAPI
+OPTIONS_DEFINE= X11 NLS NTLM POP2 DOCS
+OPTIONS_SINGLE= GSSAPI
+OPTIONS_SINGLE_GSSAPI= GSSAPI_BASE GSSAPI_HEIMDAL GSSAPI_MIT GSSAPI_NONE
+OPTIONS_DEFAULT= GSSAPI_BASE
OPTIONS_SUB= yes
+
+GSSAPI_BASE_USES= gssapi
+GSSAPI_BASE_CONFIGURE_ON= --with-gssapi=${GSSAPIBASEDIR} ${GSSAPI_CONFIGURE_ARGS}
+GSSAPI_HEIMDAL_USES= gssapi:heimdal
+GSSAPI_HEIMDAL_CONFIGURE_ON= --with-gssapi=${GSSAPIBASEDIR} ${GSSAPI_CONFIGURE_ARGS}
+GSSAPI_MIT_USES= gssapi:mit
+GSSAPI_MIT_CONFIGURE_ON= --with-gssapi=${GSSAPIBASEDIR} ${GSSAPI_CONFIGURE_ARGS}
+GSSAPI_NONE_CONFIGURE_ON= --without-gssapi
+
X11_DESC= Python/Tkinter dependencies for ``fetchmailconf''
POP2_DESC= POP2 Protocol support[obsolete]
NLS_USES= gettext
NLS_CONFIGURE_ENABLE= nls
-NLS_CONFIGURE_ON= --enable-nls
-NLS_CONFIGURE_OFF= --disable-nls
-
-PORTDOCS= FAQ FEATURES NEWS NOTES README README.SSL \
- design-notes.html fetchmail-FAQ.html fetchmail-features.html \
- esrs-design-notes.html
-.include <bsd.port.options.mk>
+NTLM_CONFIGURE_ENABLE= NTLM
+NTLM_PORTDOCS= README.NTLM
-# Pop2 is obsolete
-.if ${PORT_OPTIONS:MPOP2}
-CONFIGURE_ARGS+= --enable-POP2
-.endif
+# POP2 is obsolete
+POP2_CONFIGURE_ENABLE= POP2
-.if ${PORT_OPTIONS:MX11}
-USES+= python
-RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}tkinter>=0:x11-toolkits/py-tkinter
-PLIST_SUB+= NOX11="@comment "
-.else
-CONFIGURE_ARGS+= PYTHON=:
-SUB_FILES+= fetchmailconf
-PLIST_SUB+= NOX11=""
-.endif
+X11_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}tkinter>=0:x11-toolkits/py-tkinter
+X11_USES= python
+X11_CONFIGURE_OFF= PYTHON=:
+X11_SUB_FILES_OFF= fetchmailconf
-.if ${PORT_OPTIONS:MGSSAPI}
-.if !defined(KRB5_HOME)
-.if exists(${LOCALBASE}/lib/libkrb5.a)
-KRB5_HOME= ${LOCALBASE}
-.elif exists(/usr/lib/libkrb5.a)
-KRB5_HOME= /usr
-.endif
-.endif
-
-.if defined(KRB5_HOME) && !exists(${KRB5_HOME}/lib/libkrb5.a)
-BROKEN= KRB5_HOME is set but doesn\'t provide lib/libkrb5.a
-.endif
-
-.if defined(KRB5_HOME) && exists(${KRB5_HOME}/lib/libkrb5.a)
-CONFIGURE_ARGS+= --with-gssapi=${KRB5_HOME}
-.endif
-.endif
+PORTDOCS= FAQ FEATURES NEWS NOTES README README.SSL \
+ design-notes.html fetchmail-FAQ.html fetchmail-features.html \
+ esrs-design-notes.html
-.if ${PORT_OPTIONS:MNTLM}
-CONFIGURE_ARGS+= --enable-NTLM
-PORTDOCS+= README.NTLM
-.endif
+#.include <bsd.port.options.mk>
post-patch:
.if !exists(/usr/lib/libcom_err.so)
@@ -99,7 +79,8 @@ post-patch:
post-build:
@${MAKE_CMD} -C ${WRKSRC} check
-post-install:
+post-stage:
+ ${INSTALL} -d ${STAGEDIR}/var/run/fetchmail
${INSTALL_DATA} ${FILESDIR}/fetchmailrc.sample \
${STAGEDIR}${PREFIX}/etc/fetchmailrc.sample
diff --git a/mail/fetchmail/files/patch-fetchmail.c b/mail/fetchmail/files/patch-fetchmail.c
new file mode 100644
index 000000000000..03e505d44120
--- /dev/null
+++ b/mail/fetchmail/files/patch-fetchmail.c
@@ -0,0 +1,26 @@
+--- fetchmail.c.orig 2013-04-23 20:00:45 UTC
++++ fetchmail.c
+@@ -50,6 +50,10 @@
+ #include <arpa/nameser.h>
+ #include <resolv.h>
+
++#ifdef SSL_ENABLE
++#include <openssl/ssl.h>
++#endif
++
+ #ifndef ENETUNREACH
+ #define ENETUNREACH 128 /* Interactive doesn't know this */
+ #endif /* ENETUNREACH */
+@@ -263,6 +267,12 @@ int main(int argc, char **argv)
+ #ifdef SSL_ENABLE
+ "+SSL"
+ #endif
++#ifdef OPENSSL_NO_SSL2
++ "-SSLv2"
++#endif
++#ifdef OPENSSL_NO_SSL3_METHOD
++ "-SSLv3"
++#endif
+ #ifdef OPIE_ENABLE
+ "+OPIE"
+ #endif /* OPIE_ENABLE */
diff --git a/mail/fetchmail/files/patch-socket.c b/mail/fetchmail/files/patch-socket.c
new file mode 100644
index 000000000000..28a0b99caf23
--- /dev/null
+++ b/mail/fetchmail/files/patch-socket.c
@@ -0,0 +1,24 @@
+--- socket.c.orig 2013-04-23 20:00:45 UTC
++++ socket.c
+@@ -907,14 +907,19 @@ int SSLOpen(int sock, char *mycert, char
+ _ssl_context[sock] = NULL;
+ if(myproto) {
+ if(!strcasecmp("ssl2",myproto)) {
+-#if HAVE_DECL_SSLV2_CLIENT_METHOD + 0 > 0
++#ifndef OPENSSL_NO_SSL2
+ _ctx[sock] = SSL_CTX_new(SSLv2_client_method());
+ #else
+- report(stderr, GT_("Your operating system does not support SSLv2.\n"));
++ report(stderr, GT_("Your OpenSSL version does not support SSLv2.\n"));
+ return -1;
+ #endif
+ } else if(!strcasecmp("ssl3",myproto)) {
++#ifndef OPENSSL_NO_SSL3_METHOD
+ _ctx[sock] = SSL_CTX_new(SSLv3_client_method());
++#else
++ report(stderr, GT_("Your OpenSSL version does not support SSLv3.\n"));
++ return -1;
++#endif
+ } else if(!strcasecmp("tls1",myproto)) {
+ _ctx[sock] = SSL_CTX_new(TLSv1_client_method());
+ } else if (!strcasecmp("ssl23",myproto)) {
diff --git a/mail/fetchmail/files/pkg-deinstall.in b/mail/fetchmail/files/pkg-deinstall.in
deleted file mode 100644
index b5db8a91f305..000000000000
--- a/mail/fetchmail/files/pkg-deinstall.in
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-if [ x$2 != xPOST-DEINSTALL ]; then
- exit
-fi
-
-if [ -f /var/run/%%PORTNAME%%/fetchmail.pid ] ; then
- /bin/rm -f /var/run/%%PORTNAME%%/fetchmail.pid
-fi
-
-/bin/rmdir /var/run/%%PORTNAME%%
-
-exit
diff --git a/mail/fetchmail/files/pkg-install.in b/mail/fetchmail/files/pkg-install.in
deleted file mode 100644
index 2ff500203772..000000000000
--- a/mail/fetchmail/files/pkg-install.in
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-if [ x$2 != xPOST-INSTALL ]; then
- exit
-fi
-
-/bin/mkdir -m 0755 -p /var/run/%%PORTNAME%%
-/usr/sbin/chown "%%USERS%%:%%GROUPS%%" /var/run/%%PORTNAME%%
-/usr/sbin/chown "%%USERS%%:%%GROUPS%%" %%PREFIX%%/etc/fetchmailrc*
-/bin/chmod 0600 %%PREFIX%%/etc/fetchmailrc
-/bin/chmod 0644 %%PREFIX%%/etc/fetchmailrc.sample
-
-exit
diff --git a/mail/fetchmail/pkg-plist b/mail/fetchmail/pkg-plist
index 92ee28a7619b..1a5fb7d3dba0 100644
--- a/mail/fetchmail/pkg-plist
+++ b/mail/fetchmail/pkg-plist
@@ -2,7 +2,7 @@ bin/fetchmail
bin/fetchmailconf
man/man1/fetchmail.1.gz
man/man1/fetchmailconf.1.gz
-%%NOX11%%libexec/fetchmailconf.py
+%%X11%%libexec/fetchmailconf.py
%%NLS%%share/locale/ca/LC_MESSAGES/fetchmail.mo
%%NLS%%share/locale/cs/LC_MESSAGES/fetchmail.mo
%%NLS%%share/locale/da/LC_MESSAGES/fetchmail.mo
@@ -30,4 +30,5 @@ man/man1/fetchmailconf.1.gz
%%X11%%%%PYTHON_SITELIBDIR%%/fetchmailconf.py
%%X11%%%%PYTHON_SITELIBDIR%%/fetchmailconf.pyc
%%X11%%%%PYTHON_SITELIBDIR%%/fetchmailconf.pyo
-@sample etc/fetchmailrc.sample
+@sample(fetchmail,fetchmail,600) etc/fetchmailrc.sample
+@dir(fetchmail,fetchmail,755) /var/run/fetchmail