Bug 185439 - security/openvpn-auth-radius: Fix build with clang
security/openvpn-auth-radius: Fix build with clang
Status: Closed FIXED
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s)
Latest
Any Any
: Normal Affects Only Me
Assigned To: John Marino
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-03 11:00 UTC by jako.andras
Modified: 2014-02-02 19:13 UTC (History)
0 users

See Also:


Attachments
file.diff (554 bytes, patch)
2014-01-03 11:00 UTC, jako.andras
no flags Details | Diff
openvpn-auth-radius.txt (1.81 KB, text/plain; charset=US-ASCII)
2014-01-03 14:06 UTC, m.tsatsenko
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description jako.andras 2014-01-03 11:00:00 UTC
security/openvpn-auth-radius doesn't build with clang:

gmake[1]: Entering directory `/usr/ports/security/openvpn-auth-radius.orig/work/radiusplugin'
OBJ: RadiusClass/RadiusAttribute.o
OBJ: RadiusClass/RadiusPacket.o
OBJ: RadiusClass/RadiusConfig.o
gmake[1]: g++: Command not found
..

Fix: Fix hardcoded CC=g++ in Makefile.bsd so that it can be built with clang.

Patch attached with submission follows:
How-To-Repeat: make
Comment 1 Edwin Groothuis freebsd_committer 2014-01-03 11:00:07 UTC
Maintainer of security/openvpn-auth-radius,

Please note that PR ports/185439 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/185439

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer 2014-01-03 11:00:08 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 m.tsatsenko 2014-01-03 14:06:52 UTC
Thanks for your work.

Updated patch attached:
- Fix build on 10.x and later
- Pet portlint
- Enable staging

-- 
Mikhail
Comment 4 John Marino freebsd_committer 2014-01-19 14:51:08 UTC
State Changed
From-To: feedback->open

Maintainer has fixed.
Comment 5 John Marino freebsd_committer 2014-01-25 14:05:35 UTC
Responsible Changed
From-To: freebsd-ports-bugs->marino

I'll take it.
Comment 6 freebsd.contact 2014-01-25 14:42:22 UTC
Unfortunately, with this patch, openvpn-auth-radius fails to build in a
clean environment on *every* platform:

https://redports.org/buildarchive/20140125142700-22184/

Please prove a fixed version - maybe its a missing dependency causing
it.  In any case, I recommend building the next fix in poudriere or
tinderbox or something like that to very it builds in a clean jail.

John
Comment 7 John Marino freebsd_committer 2014-01-25 14:50:06 UTC
State Changed
From-To: open->feedback

Ask for submitter fix.
Comment 8 m.tsatsenko 2014-01-25 16:03:38 UTC
It is not my fault. As you can see openvpn itself can not be build not
openvpn-auth-radius. Furthermore it fails to build regardless of that
is the patch applied or not.
You need to skip openvpn tests in its Makefile (just remove
corresponding lines).  With tests disabled both ports builds fine,
see: http://www.freshports.org/security/openvpn-auth-radius

-- 
Mikhail
Comment 9 m.tsatsenko 2014-01-25 16:04:55 UTC
> see: http://www.freshports.org/security/openvpn-auth-radius
Sorry, correct link is https://redports.org/buildarchive/20140125155623-27581/



-- 
Mikhail
Comment 10 dfilter freebsd_committer 2014-01-27 19:00:16 UTC
Author: mandree
Date: Mon Jan 27 19:00:07 2014
New Revision: 341442
URL: http://svnweb.freebsd.org/changeset/ports/341442
QAT: https://qat.redports.org/buildarchive/r341442/

Log:
  Fix self-tests and their non-fatal auto-skip on RedPorts.
  
  Add patch-tests__t_cltsrv.sh to properly skip self-tests when no
  inet/inet6 addresses are available, and to properly use udp6 when only
  inet6 is available (for instance, on RedPorts).
  
  Drop patch-src__openvpn__syshead.h, had already been integrated upstream.
  
  PR:		ports/185439 (related)

Added:
  head/security/openvpn/files/patch-tests__t_cltsrv.sh   (contents, props changed)
Deleted:
  head/security/openvpn/files/patch-src__openvpn__syshead.h

Added: head/security/openvpn/files/patch-tests__t_cltsrv.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/openvpn/files/patch-tests__t_cltsrv.sh	Mon Jan 27 19:00:07 2014	(r341442)
@@ -0,0 +1,65 @@
+--- ./tests/t_cltsrv.sh.orig	2013-05-31 14:00:07.000000000 +0200
++++ ./tests/t_cltsrv.sh	2014-01-27 18:51:13.000000000 +0100
+@@ -1,7 +1,7 @@
+ #! /bin/sh
+ #
+ # t_cltsrv.sh - script to test OpenVPN's crypto loopback
+-# Copyright (C) 2005, 2006, 2008  Matthias Andree
++# Copyright (C) 2005 - 2014  Matthias Andree
+ #
+ # This program is free software; you can redistribute it and/or
+ # modify it under the terms of the GNU General Public License
+@@ -22,8 +22,9 @@
+ srcdir="${srcdir:-.}"
+ top_srcdir="${top_srcdir:-..}"
+ top_builddir="${top_builddir:-..}"
+-trap "rm -f log.$$ log.$$.signal ; trap 0 ; exit 77" 1 2 15
+-trap "rm -f log.$$ log.$$.signal ; exit 1" 0 3
++root="${top_srcdir}/sample"
++trap "rm -f ${root}/sample-config-files/loopback-*.test log.$$ log.$$.signal ; trap 0 ; exit 77" 1 2 15
++trap "a=\$? ; rm -f ${root}/sample-config-files/loopback-*.test log.$$ log.$$.signal ; test \$a = 0 && exit 1 || exit \$a" 0 3
+ addopts=
+ case `uname -s` in
+     FreeBSD)
+@@ -45,18 +46,38 @@
+ # make sure that the --down script is executable -- fail (rather than
+ # skip) test if it isn't.
+ downscript="../tests/t_cltsrv-down.sh"
+-root="${top_srcdir}/sample"
+ test -x "${root}/${downscript}" || chmod +x "${root}/${downscript}" || { echo >&2 "${root}/${downscript} is not executable, failing." ; exit 1 ; }
+ echo "The following test will take about two minutes." >&2
+ echo "If the addresses are in use, this test will retry up to two times." >&2
+ 
++set -- $(ifconfig lo0 | grep -E '\<inet' | head -n1)
++add=
++if [ "x$1$2" = "x" ] ; then
++    echo >&2 "### NO ADDRESSES ON LOOPBACK INTERFACE lo0, SKIPPING TEST ###"
++    exit 77
++fi
++if [ "inet6" = "$1" ] ; then
++    add='proto udp6'
++fi
++for i in server client ; do
++    sed -e "s/localhost/$2/" -e "/^remote/a\\
++$add" ${root}/sample-config-files/loopback-$i \
++    >${root}/sample-config-files/loopback-$i.test
++done
++
+ # go
+ success=0
+ for i in 1 2 3 ; do
+   set +e
+   (
+-  "${top_builddir}/src/openvpn/openvpn" --script-security 2 --cd "${root}" ${addopts} --setenv role srv --down "${downscript}" --tls-exit --ping-exit 180 --config "sample-config-files/loopback-server" &
+-  "${top_builddir}/src/openvpn/openvpn" --script-security 2 --cd "${top_srcdir}/sample" ${addopts} --setenv role clt --down "${downscript}" --tls-exit --ping-exit 180 --config "sample-config-files/loopback-client"
++  "${top_builddir}/src/openvpn/openvpn" --script-security 2 \
++      --cd "${root}" ${addopts} --setenv role srv \
++      --down "${downscript}" --tls-exit --ping-exit 180 \
++      --config "sample-config-files/loopback-server.test" &
++  "${top_builddir}/src/openvpn/openvpn" --script-security 2 \
++      --cd "${top_srcdir}/sample" ${addopts} --setenv role clt \
++      --down "${downscript}" --tls-exit --ping-exit 180 \
++      --config "sample-config-files/loopback-client.test"
+   ) 3>log.$$.signal >log.$$ 2>&1
+   e1=$?
+   wait $!
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 11 freebsd.contact 2014-01-30 09:28:43 UTC
Without changing anything in Redports, openvpn-auth-radius now builds
cleanly after the openvpn fix:
https://redports.org/buildarchive/20140130084345-84807/

I don't get back home until Sunday so I'll commit the fix then.
John
Comment 12 dfilter freebsd_committer 2014-02-02 19:06:43 UTC
Author: marino
Date: Sun Feb  2 19:06:30 2014
New Revision: 342361
URL: http://svnweb.freebsd.org/changeset/ports/342361
QAT: https://qat.redports.org/buildarchive/r342361/

Log:
  security/openvpn-auth-radius: Fix build on FreeBSD 10+
  
  In addition to PR, convert USE_GMAKE and use new library callouts.
  
  PR:		ports/185439
  Submitted by:	Andras JAKO
  Fixed by:	maintainer (Mikhail Tsatsenko)

Added:
  head/security/openvpn-auth-radius/files/
  head/security/openvpn-auth-radius/files/patch-Makefile.bsd   (contents, props changed)
Modified:
  head/security/openvpn-auth-radius/Makefile

Modified: head/security/openvpn-auth-radius/Makefile
==============================================================================
--- head/security/openvpn-auth-radius/Makefile	Sun Feb  2 19:04:21 2014	(r342360)
+++ head/security/openvpn-auth-radius/Makefile	Sun Feb  2 19:06:30 2014	(r342361)
@@ -12,12 +12,12 @@ DISTNAME=	radiusplugin_v${PORTVERSION}
 MAINTAINER=	m.tsatsenko@gmail.com
 COMMENT=	RADIUS authentication plugin for OpenVPN
 
-RUN_DEPENDS=	openvpn:${PORTSDIR}/security/openvpn
-LIB_DEPENDS=	gcrypt:${PORTSDIR}/security/libgcrypt
-
 LICENSE=	GPLv2
 
-USE_GMAKE=	yes
+RUN_DEPENDS=	${LOCALBASE}/sbin/openvpn:${PORTSDIR}/security/openvpn
+LIB_DEPENDS=	libgcrypt.so:${PORTSDIR}/security/libgcrypt
+
+USES=		gmake
 MAKEFILE=	Makefile.bsd
 WRKSRC=		${WRKDIR}/radiusplugin
 
@@ -25,20 +25,19 @@ PORTDOCS=	README
 PORTEXAMPLES=	radiusplugin.cnf
 PLIST_FILES=	lib/radiusplugin.so
 
-NO_STAGE=	yes
 .include <bsd.port.pre.mk>
 
 do-install:
-	${INSTALL_LIB} ${WRKSRC}/radiusplugin.so ${LOCALBASE}/lib
+	${INSTALL_LIB} ${WRKSRC}/radiusplugin.so ${STAGEDIR}${LOCALBASE}/lib
 
 post-install:
-.if !defined(NOPORTDOCS)
-	${MKDIR} ${DOCSDIR}
-	${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
+.if ${PORT_OPTIONS:MDOCS}
+	${MKDIR} ${STAGEDIR}${DOCSDIR}
+	${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR}
 .endif
-.if !defined(NOPORTEXAMPLES)
-	${MKDIR} ${EXAMPLESDIR}
-	${INSTALL_DATA} ${WRKSRC}/radiusplugin.cnf ${EXAMPLESDIR}
+.if ${PORT_OPTIONS:MEXAMPLES}
+	${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
+	${INSTALL_DATA} ${WRKSRC}/radiusplugin.cnf ${STAGEDIR}${EXAMPLESDIR}
 .endif
 
 .include <bsd.port.post.mk>

Added: head/security/openvpn-auth-radius/files/patch-Makefile.bsd
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/openvpn-auth-radius/files/patch-Makefile.bsd	Sun Feb  2 19:06:30 2014	(r342361)
@@ -0,0 +1,9 @@
+--- ./Makefile.bsd.orig	2010-04-06 19:07:33.000000000 +0200
++++ ./Makefile.bsd	2014-01-03 11:29:36.000000000 +0100
+@@ -1,4 +1,4 @@
+-CC=g++
++CC?=g++
+ INCL=-I/usr/local/include
+ LDFLAGS=-L/usr/local/lib
+ LIBS=-lgcrypt -lgpg-error -lstdc++ -lm -lpthread
+
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 13 John Marino freebsd_committer 2014-02-02 19:13:09 UTC
State Changed
From-To: feedback->closed

Committed, with minor changes. Thanks!