Bug 187721 - mail/dovecot2 fix to use security/heimdal port
Summary: mail/dovecot2 fix to use security/heimdal port
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Adam Weinberger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-19 06:30 UTC by dewayne
Modified: 2014-07-01 16:06 UTC (History)
1 user (show)

See Also:


Attachments
Adds GSSAPI support (1.57 KB, patch)
2014-07-01 15:30 UTC, Adam Weinberger
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description dewayne 2014-03-19 06:30:00 UTC
Building dovecot2 on FreeBSD 9.2 using security/heimdal port results in configure returning 

/usr/bin/ld: cannot find -lgssapi_krb5

which is correct, because libgssapi_krb5 isn't built by the security/heimdal port.
The security/heimdal port builds libgssapi to contain the calls that lower versions of heimdal use in libgssapi_krb5.

Fix: 

.if defined(HEIMDAL_HOME)
BUILD_DEPENDS+=  ${HEIMDAL_HOME}/lib/libgssapi.so:${PORTSDIR}/security/heimdal
RUN_DEPENDS+=  ${HEIMDAL_HOME}/lib/libgssapi.so:${PORTSDIR}/security/heimdal
.else
LDFLAGS+=       -lgssapi_krb5
.endif

or for a minimal solution

.if !defined(HEIMDAL_HOME)
LDFLAGS+=       -lgssapi_krb5
.endif

It is common practice to use HEIMDAL_HOME as both the trigger for recognition of use of the security/heimdal port as well as the location of the libs and headers.
How-To-Repeat: rm /usr/lib/libgssap* 
# In my case I don't build these, via src.conf WITHOUT_KERBEROS
cd /usr/ports/security/heimdal && make install package
cd /usr/ports/mail/dovecot2 && make install package
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-03-19 06:30:03 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2014-03-19 06:30:03 UTC
Maintainer of mail/dovecot2,

Please note that PR ports/187721 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/187721

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 John Marino freebsd_committer freebsd_triage 2014-06-29 15:26:50 UTC
This is the third timeout out of 4 attempts by maintainer.
Unless I hear something immediately why I shouldn't, I'm going to reset the maintainer to ports@.
Comment 4 John Marino freebsd_committer freebsd_triage 2014-06-29 15:37:00 UTC
*** Bug 189133 has been marked as a duplicate of this bug. ***
Comment 5 John Marino freebsd_committer freebsd_triage 2014-06-29 15:48:42 UTC
Actually I found a few more unanswered PRs so I am going to reset the port now.

Dewayne, it seems like HEIMDAL support has been removed completely (dovecot now on 2.2.13).  Can you indicate if this PR is still valid and if it is, can you submit a proper patch?
Comment 6 John Marino freebsd_committer freebsd_triage 2014-06-30 12:25:53 UTC
Adam has taken over the port, so I'll assign the PR to him.

Adam, dewayne is planning on responding in a couple of days.  I'll leave myself on CC for now.
Comment 7 Adam Weinberger freebsd_committer freebsd_triage 2014-06-30 13:37:55 UTC
It looks like GSSAPI support is still in there... it's still listed in configure.ac anyway.

dewayne, this strikes me as a job for the new USES=gssapi:heimdal feature (http://svnweb.freebsd.org/ports/head/Mk/Uses/gssapi.mk?view=markup). Thoughts?
Comment 8 dewayne 2014-07-01 03:05:56 UTC
Thanks for looking into this, and making me review the Uses/gssapi.mk file.  It looks like that addresses the issue nicely.  So, I'm guessing, with a USES=gssapi I should be able to remove the patch for dovecot2(below) :)

===================================================================
--- Makefile    (revision 359521)
+++ Makefile    (working copy)
@@ -60,7 +60,13 @@
 OPTIONS_SUB=           yes
 DOCS_CONFIGURE_WITH=   docs
 GSSAPI_CONFIGURE_WITH= gssapi
+.if defined(HEIMDAL_HOME)
+BUILD_DEPENDS+= ${HEIMDAL_HOME}/lib/libgssapi.so:${PORTSDIR}/security/heimdal
+RUN_DEPENDS+= ${HEIMDAL_HOME}/lib/libgssapi.so:${PORTSDIR}/security/heimdal
+GSSAPI_LDFLAGS=                -lgssapi
+.else
 GSSAPI_LDFLAGS=                -lgssapi_krb5
+.endif

I have a minor concern that gssapi.mk sets the PREFIX though simple testing indicates that it should be ok (eg Remote our patch, insert USES=gssapi and 

# unsetenv HEIMDAL_HOME ; make __MAKE_CONF=/dev/null -VPREFIX -VHEIMDAL_HOME -VUSES
/usr/local
/usr
gssapi iconv

The concern was that the ports PREFIX was altered (to match $HEIMDAL_HOME).  

Unfortunately I'm unable to test, as we had a successful rebuild of all ports on 2014-06-28 so the systems are frozen during functional testing.

I should mention that our /etc/src.conf contains 
WITHOUT_GSSAPI=yes
WITHOUT_KERBEROS=yes
WITHOUT_KERBEROS_SUPPORT=yes
Comment 9 Adam Weinberger freebsd_committer freebsd_triage 2014-07-01 15:30:36 UTC
Created attachment 144316 [details]
Adds GSSAPI support

This patch is essentially straight out of the Uses/gssapi.mk description.
Comment 10 commit-hook freebsd_committer freebsd_triage 2014-07-01 16:04:20 UTC
A commit references this bug:

Author: adamw
Date: Tue Jul  1 16:04:14 UTC 2014
New revision: 360050
URL: http://svnweb.freebsd.org/changeset/ports/360050

Log:
  Enable support for GSSAPI from ports using USES=gssapi magic. PORTREVISION
  bump for this.

  PR:		ports/187721
  Submitted by:	dewayne@heuristicsystems.com.au

  While we're here:
  - More general cleanups
  - Improve COMMENT and pkg-descr

Changes:
  head/mail/dovecot2/Makefile
  head/mail/dovecot2/pkg-descr
Comment 11 Adam Weinberger freebsd_committer freebsd_triage 2014-07-01 16:06:03 UTC
Thanks, dewayne. I've committed the GSSAPI patch in r360050. Please let me know if you encounter any trouble with this in the future... I don't use kerberos so I'll rely on you for this! :-)