Bug 165775 - mail/dma FTBFS
Summary: mail/dma FTBFS
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: Chris Rees
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-06 14:30 UTC by Gordon Shumway
Modified: 2012-04-14 16:51 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gordon Shumway 2012-03-06 14:30:15 UTC
cc -O2 -pipe -fno-omit-frame-pointer -I/usr/local/include -DCONF_PATH='"/usr/local/etc/dma"' -DDMA_ROOT_USER='"mailnull"' -DDMA_GROUP='"mail"' -fno-strict-aliasing -fno-omit-frame-pointer  -I/usr/ports/mail/dma/work/corecode-dma-db9a42b/dma -I/usr/ports/mail/dma/work/corecode-dma-db9a42b/dma/.. -DHAVE_REALLOCF -DHAVE_STRLCPY -DHAVE_GETPROGNAME -DLIBEXEC_PATH='"/usr/local/libexec"' -DDMA_VERSION='"v0.7"' -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wno-pointer-sign -c /usr/ports/mail/dma/work/corecode-dma-db9a42b/dma/..//crypto.c

cc1: warnings being treated as errors
/usr/ports/mail/dma/work/corecode-dma-db9a42b/dma/..//crypto.c: In function 'smtp_init_crypto':
/usr/ports/mail/dma/work/corecode-dma-db9a42b/dma/..//crypto.c:92: warning: assignment discards qualifiers from pointer target type

this is actually caused by files/patch-crypto.c which is plain wrong for openssl v1.0 (port version), but is correct for openssl 0.9 (base version). according to Mk/bsd.openssl.mk, the port build will prefer the ports-installed version, rendering the patch unusable for anyone having security/openssl installed.

Fix: 

files/patch-crypto.c should be made conditional based upon OPENSSL_VERSION_NUMBER (or something similar).
How-To-Repeat: - have security/openssl installed
- try installing mail/dma
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-03-06 14:30:29 UTC
Responsible Changed
From-To: freebsd-ports-bugs->bz

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Bjoern A. Zeeb freebsd_committer freebsd_triage 2012-03-06 16:07:16 UTC
On Tue, 6 Mar 2012, edwin@FreeBSD.org wrote:

Thanks for the report.

Yeah, ideally the code would just DTRT dependent on openssl version.
I'll look into that.  Would adding

WITH_OPENSSL_BASE=

to the makefile work for you in the meantime?  It's not that it'll
usually do a lot of SSL traffic so performance differences between
port and base system should be negligible.

-- 
Bjoern A. Zeeb                                 You have to have visions!
          Stop bit received. Insert coin for new address family.
Comment 3 Gordon Shumway 2012-03-06 18:51:56 UTC
It would seem to be the case that WITH_OPENSSL_BASE= won't work, see Mk/bsd.openssl.mk:67

 67 .if exists(${LOCALBASE}/lib/libcrypto.so)
 68 check-depends::
 69         @${ECHO_CMD} "Dependency error: this port wants the OpenSSL library from the FreeBSD"
 70         @${ECHO_CMD} "base system. You can't build against it, while a newer"
 71         @${ECHO_CMD} "version is installed by a port."
 72         @${ECHO_CMD} "Please deinstall the port or undefine WITH_OPENSSL_BASE."
 73         @${FALSE}
 74 .endif

localhost:/usr/ports/mail/dma$ sudo make install
Dependency error: this port wants the OpenSSL library from the FreeBSD
base system. You can't build against it, while a newer
version is installed by a port.
Please deinstall the port or undefine WITH_OPENSSL_BASE.
*** Error code 1

Stop in /usr/ports/mail/dma.
Comment 4 Bjoern A. Zeeb freebsd_committer freebsd_triage 2012-03-07 00:07:34 UTC
On 6. Mar 2012, at 19:10 , Holle Anyo wrote:

So this should be fine as much as I could test. I'll try to find the =
exact OPENSSL_VERSION_NUMBER tomorrow if possible.   Can you confirm =
that this works for you?

/bz

Index: mail/dma/files/patch-crypto.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: =
/mirror/cvs/FreeBSD/r/pcvs/ports/mail/dma/files/patch-crypto.c,v
retrieving revision 1.1
diff -u -p -r1.1 patch-crypto.c
--- mail/dma/files/patch-crypto.c	4 Mar 2012 23:01:08 -0000	=
1.1
+++ mail/dma/files/patch-crypto.c	7 Mar 2012 00:04:58 -0000
@@ -1,11 +1,14 @@
---- ./crypto.c.orig	2012-01-03 13:54:05.000000000 +0000
-+++ ./crypto.c	2012-01-24 22:57:41.000000000 +0000
-@@ -80,7 +80,7 @@
+--- crypto.c.orig	2012-01-03 13:54:05.000000000 +0000
++++ crypto.c	2012-03-06 23:50:42.000000000 +0000
+@@ -80,7 +80,11 @@ int
  smtp_init_crypto(int fd, int feature)
  {
  	SSL_CTX *ctx =3D NULL;
--	const SSL_METHOD *meth =3D NULL;
++#if (OPENSSL_VERSION_NUMBER >=3D 0x01000000L)
+ 	const SSL_METHOD *meth =3D NULL;
++#else
 +	SSL_METHOD *meth =3D NULL;
++#endif
  	X509 *cert;
  	int error;

--=20
Bjoern A. Zeeb                                 You have to have visions!
   It does not matter how good you are. It matters what good you do!
Comment 5 Gordon Shumway 2012-03-07 01:14:35 UTC
--- On Wed, 3/7/12, Bjoern A. Zeeb <bz@FreeBSD.org> wrote:=0A=0A> So this s=
hould be fine as much as I could test. I'll try to=0A> find the exact OPENS=
SL_VERSION_NUMBER tomorrow if=0A> possible.=A0=A0=A0Can you confirm that th=
is works=0A> for you?=0A=0AIt would appear so.=0A=0AThanks!
Comment 6 Bjoern A. Zeeb freebsd_committer freebsd_triage 2012-03-07 20:36:27 UTC
On Tue, 6 Mar 2012, Holle Anyo wrote:

Ok, I have the official patch here and will re-assign the PR:
http://people.freebsd.org/~bz/20120307-01-mail-dma.diff

-- 
Bjoern A. Zeeb                                 You have to have visions!
          Stop bit received. Insert coin for new address family.
Comment 7 dfilter service freebsd_committer freebsd_triage 2012-04-14 16:49:55 UTC
crees       2012-04-14 15:49:42 UTC

  FreeBSD ports repository

  Modified files:
    mail/dma             Makefile 
    mail/dma/files       patch-crypto.c 
  Added files:
    mail/dma/files       patch-alias_scan.l patch-get-version.sh 
  Log:
  Fix a couple of issues:
   - Make compile with old and new openssl
   - Do not try to call git to get the version number
   - Fix compile on FreeBSD 8.1
   - Change maintainer email address
  
  PR:             ports/165775
  Submitted by:   bz
  
  Revision  Changes    Path
  1.12      +2 -1      ports/mail/dma/Makefile
  1.1       +15 -0     ports/mail/dma/files/patch-alias_scan.l (new)
  1.2       +7 -4      ports/mail/dma/files/patch-crypto.c
  1.1       +12 -0     ports/mail/dma/files/patch-get-version.sh (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 8 Chris Rees freebsd_committer freebsd_triage 2012-04-14 16:50:00 UTC
State Changed
From-To: open->closed

Committed. Thanks! 


Comment 9 Chris Rees freebsd_committer freebsd_triage 2012-04-14 16:50:00 UTC
Responsible Changed
From-To: bz->crees

It's my fault if it breaks anything