Bug 178465 - [PATCH] www/sarg: fix configure bugs and missing libiconv linkage
Summary: [PATCH] www/sarg: fix configure bugs and missing libiconv linkage
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: Renato Botelho
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-09 21:20 UTC by John Marino
Modified: 2013-05-31 14:20 UTC (History)
0 users

See Also:


Attachments
file.diff (4.33 KB, patch)
2013-05-09 21:20 UTC, John Marino
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Marino 2013-05-09 21:20:01 UTC
The www/sarg configure script is geared for bash (I guess) as it uses "==" for string equality.  This causes all the LDFLAGS and CFLAGS determinations to fail, among other things.

A second problem is that libiconv needs to be linked into binary (if iconv option selected which is default) and this causes sarg to break using modern binutils that don't indirect link by default.

Two fixes are provided:
The diff needs for the port makefile (below) and a the contents of "patch-configure.in" (attached).

https://raw.github.com/jrmarino/DeltaPorts/c2dde3dfdb6201d9e205ca121326977d9ed76bfa/ports/www/sarg/dragonfly/patch-configure.in (attached)

https://raw.github.com/jrmarino/DeltaPorts/c2dde3dfdb6201d9e205ca121326977d9ed76bfa/ports/www/sarg/diffs/Makefile.diff (below)

--- Makefile.orig	2013-05-09 19:20:43.860789000 +0000
+++ Makefile
@@ -34,6 +34,7 @@ MAN1=		sarg.1
 .if ${PORT_OPTIONS:MNLS}
 PLIST_SUB+=	NLS=""
 USES+=		gettext
+RPL1=		-lintl
 .else
 PLIST_SUB+=	NLS="@comment "
 CONFIGURE_ARGS+=--disable-nls
@@ -71,6 +72,7 @@ CONFIGURE_ARGS+=--without-ldap
 .if ${PORT_OPTIONS:MICONV}
 CONFIGURE_ARGS+=--with-iconv
 USES+=	iconv
+RPL2=	-liconv
 .else
 CONFIGURE_ARGS+=--without-iconv
 .endif
@@ -80,8 +82,8 @@ post-extract:
 	@${CHMOD} 0755 ${WRKSRC}/configure
 
 post-patch:
-.if ${PORT_OPTIONS:MNLS}
-	@${REINPLACE_CMD} -e '/^LIBS/ s/$$/ -lintl/' ${WRKSRC}/Makefile.in
+.if ${PORT_OPTIONS:MNLS} || ${PORT_OPTIONS:MICONV}
+	@${REINPLACE_CMD} -e '/^LIBS/ s/$$/ ${RPL1} ${RPL2}/' ${WRKSRC}/Makefile.in
 .endif
 
 pre-configure:

Fix: Patch attached with submission follows:
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-05-09 21:20:22 UTC
Responsible Changed
From-To: freebsd-ports-bugs->garga

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer freebsd_triage 2013-05-31 14:17:53 UTC
Author: garga
Date: Fri May 31 13:17:41 2013
New Revision: 319490
URL: http://svnweb.freebsd.org/changeset/ports/319490

Log:
  - Remove bashisms from configure.in
  - Fix libinconv and libintl linking
  - Bump PORTREVISION
  
  PR:		ports/178465 (based on)
  Submitted by:	John Marino <draco@marino.st>

Modified:
  head/www/sarg/Makefile

Modified: head/www/sarg/Makefile
==============================================================================
--- head/www/sarg/Makefile	Fri May 31 12:36:02 2013	(r319489)
+++ head/www/sarg/Makefile	Fri May 31 13:17:41 2013	(r319490)
@@ -3,6 +3,7 @@
 
 PORTNAME=	sarg
 PORTVERSION=	2.3.6
+PORTREVISION=	1
 CATEGORIES=	www
 MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}
 
@@ -34,6 +35,7 @@ MAN1=		sarg.1
 .if ${PORT_OPTIONS:MNLS}
 PLIST_SUB+=	NLS=""
 USES+=		gettext
+EXTRA_LDFLAGS=	-lintl
 .else
 PLIST_SUB+=	NLS="@comment "
 CONFIGURE_ARGS+=--disable-nls
@@ -71,6 +73,7 @@ CONFIGURE_ARGS+=--without-ldap
 .if ${PORT_OPTIONS:MICONV}
 CONFIGURE_ARGS+=--with-iconv
 USES+=	iconv
+EXTRA_LDFLAGS+=	-liconv
 .else
 CONFIGURE_ARGS+=--without-iconv
 .endif
@@ -80,8 +83,11 @@ post-extract:
 	@${CHMOD} 0755 ${WRKSRC}/configure
 
 post-patch:
-.if ${PORT_OPTIONS:MNLS}
-	@${REINPLACE_CMD} -e '/^LIBS/ s/$$/ -lintl/' ${WRKSRC}/Makefile.in
+	@${REINPLACE_CMD} -e '/test .*==/ s/==/=/' \
+		${WRKSRC}/configure.in
+.if ${PORT_OPTIONS:MNLS} || ${PORT_OPTIONS:MICONV}
+	@${REINPLACE_CMD} -e '/^LIBS/ s/$$/ ${EXTRA_LDFLAGS}/' \
+		${WRKSRC}/Makefile.in
 .endif
 
 pre-configure:
_______________________________________________
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 3 Renato Botelho freebsd_committer freebsd_triage 2013-05-31 14:19:13 UTC
State Changed
From-To: open->closed

Committed. Thanks!