Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Dec 2013 02:47:34 +0900
From:      KATO Tsuguru <tkato432@yahoo.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/184849: devel/poslib: Fix build with clang
Message-ID:  <20131217024734.66842fd4abe109b7ee16a0cd@yahoo.com>
Resent-Message-ID: <201312161810.rBGIADSa016181@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         184849
>Category:       ports
>Synopsis:       devel/poslib: Fix build with clang
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 16 18:10:13 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     KATO Tsuguru
>Release:        FreeBSD 8.4-RELEASE-p4 i386
>Organization:
>Environment:
>Description:
- Fix build with clang
- Support CXXFLAGS properly
- Add LICENSE

New file:
files/patch-tools__fileclient.cpp
files/patch-tools__fileserver.cpp

>How-To-Repeat:
>Fix:

diff -urN /usr/ports/devel/poslib/Makefile devel/poslib/Makefile
--- /usr/ports/devel/poslib/Makefile	2013-11-06 21:51:17.000000000 +0900
+++ devel/poslib/Makefile	2013-12-17 00:00:00.000000000 +0900
@@ -3,29 +3,37 @@
 
 PORTNAME=	poslib
 PORTVERSION=	1.0.6
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	devel dns
 MASTER_SITES=	SF/posadis/${PORTNAME}/${PORTVERSION}
 
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Posadis C++ DNS library
 
+LICENSE=	GPLv2 # (or later)
+
+OPTIONS_DEFINE=	DOCS EXAMPLES
+
 USE_AUTOTOOLS=	libtool
-GNU_CONFIGURE=	yes
 USE_LDCONFIG=	yes
 
 PLIST_SUB=	VERSION="${PORTVERSION}"
 
-DOCS=		AUTHORS ChangeLog NEWS README TODO
-EXAMPLES=	examples/*.cpp
+.include <bsd.port.options.mk>
+
+post-patch:
+	@${REINPLACE_CMD} -e \
+		'/CXXFLAGS/s|-O0|$$CXXFLAGS| ; \
+		 /LIBS=/s|-lstdc++||' ${WRKSRC}/configure
 
-NO_STAGE=	yes
 post-install:
-	@${MKDIR} ${EXAMPLESDIR}
-	cd ${WRKSRC} && ${INSTALL_DATA} ${EXAMPLES} ${EXAMPLESDIR}
-.if !defined(NOPORTDOCS)
-	@${MKDIR} ${DOCSDIR}
-	cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}
-.endif
+	@${MKDIR} ${STAGEDIR}${DOCSDIR}
+.for i in AUTHORS ChangeLog NEWS README TODO
+	(cd ${WRKSRC} && ${INSTALL_DATA} ${i} \
+		${STAGEDIR}${DOCSDIR})
+.endfor
+	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
+	(cd ${WRKSRC}/examples && ${INSTALL_DATA} *.cpp \
+		${STAGEDIR}${EXAMPLESDIR})
 
 .include <bsd.port.mk>
diff -urN /usr/ports/devel/poslib/files/patch-tools__fileclient.cpp devel/poslib/files/patch-tools__fileclient.cpp
--- /usr/ports/devel/poslib/files/patch-tools__fileclient.cpp	1970-01-01 09:00:00.000000000 +0900
+++ devel/poslib/files/patch-tools__fileclient.cpp	2013-12-17 00:00:00.000000000 +0900
@@ -0,0 +1,11 @@
+--- tools/fileclient.cpp.orig
++++ tools/fileclient.cpp
+@@ -20,6 +20,8 @@
+ 
+ #include <poslib/poslib.h>
+ 
++#include <limits.h>
++
+ int main(int argc, char **argv) {
+   DnsMessage *q = NULL, *a = NULL;
+   char q3[PATH_MAX], *q2 = "", *query = q3, *ptr, *ptr2;
diff -urN /usr/ports/devel/poslib/files/patch-tools__fileserver.cpp devel/poslib/files/patch-tools__fileserver.cpp
--- /usr/ports/devel/poslib/files/patch-tools__fileserver.cpp	1970-01-01 09:00:00.000000000 +0900
+++ devel/poslib/files/patch-tools__fileserver.cpp	2013-12-17 00:00:00.000000000 +0900
@@ -0,0 +1,10 @@
+--- tools/fileserver.cpp.orig
++++ tools/fileserver.cpp
+@@ -32,6 +32,7 @@
+ #include <sys/types.h>
+ #include <dirent.h>
+ #include <errno.h>
++#include <limits.h>
+ 
+ DnsMessage *my_handle_query(pending_query *query);
+ 
diff -urN /usr/ports/devel/poslib/pkg-plist devel/poslib/pkg-plist
--- /usr/ports/devel/poslib/pkg-plist	2013-11-06 21:51:17.000000000 +0900
+++ devel/poslib/pkg-plist	2013-12-17 00:00:00.000000000 +0900
@@ -42,13 +42,13 @@
 %%PORTDOCS%%%%DOCSDIR%%/NEWS
 %%PORTDOCS%%%%DOCSDIR%%/README
 %%PORTDOCS%%%%DOCSDIR%%/TODO
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/dnstimeago.cpp
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/host.cpp
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/server.cpp
+%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%
 %%PORTDOCS%%@dirrm %%DOCSDIR%%
-%%EXAMPLESDIR%%/dnstimeago.cpp
-%%EXAMPLESDIR%%/host.cpp
-%%EXAMPLESDIR%%/server.cpp
-@dirrm %%EXAMPLESDIR%%
+@dirrm lib/poslib-%%VERSION%%/include
+@dirrm lib/poslib-%%VERSION%%
 @dirrm include/poslib-%%VERSION%%/poslib/server
 @dirrm include/poslib-%%VERSION%%/poslib
 @dirrm include/poslib-%%VERSION%%
-@dirrm lib/poslib-%%VERSION%%/include
-@dirrm lib/poslib-%%VERSION%%
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131217024734.66842fd4abe109b7ee16a0cd>