From 56029a8e884d39eafa98d4562b38385c70a1b49b Mon Sep 17 00:00:00 2001
From: Jan Beich <jbeich@FreeBSD.org>
Date: Wed, 13 Apr 2016 10:46:01 +0000
Subject: security/clambc: convert to CONFIGURE_OUTSOURCE

Approved by:	portmgr blanket
Differential Revision:	https://reviews.freebsd.org/D5895
---
 security/clambc/Makefile                                 | 16 +++++++---------
 .../clambc/files/patch-clang_lib_Driver_ToolChains.cpp   |  6 +++---
 .../patch-clang_lib_Frontend_CompilerInvocation.cpp      |  4 ++--
 .../clambc/files/patch-clang_lib_Headers_CMakeLists.txt  |  4 ++--
 security/clambc/files/patch-clang_lib_Headers_Makefile   |  4 ++--
 security/clambc/files/patch-clang_lib_Runtime_Makefile   |  4 ++--
 .../clambc/files/patch-clang_tools_CIndex_CIndexer.cpp   |  4 ++--
 security/clambc/files/patch-docs_user_building.tex       |  4 ++--
 .../clambc/files/patch-docs_user_html_clambc-user.html   |  4 ++--
 9 files changed, 24 insertions(+), 26 deletions(-)

diff --git a/security/clambc/Makefile b/security/clambc/Makefile
index 8ded81f94e0f..959e492c9805 100644
--- a/security/clambc/Makefile
+++ b/security/clambc/Makefile
@@ -14,27 +14,25 @@ LICENSE=	GPLv2
 USES=		gmake libtool perl5
 ALL_TARGET=	clambc-only
 GNU_CONFIGURE=	yes
+CONFIGURE_OUTSOURCE=	yes
 USE_GCC=	any
 USE_LDCONFIG=	yes
 USE_PERL5=	build
-CONFIGURE_SCRIPT=../llvm/configure
+CONFIGURE_SCRIPT=llvm/configure
 CONFIGURE_ARGS=	--enable-optimized --enable-targets=host-only \
 		--disable-bindings --enable-bindings=none
 
-WRKSRC=		${WRKDIR}/clamav-bytecode-compiler-${DISTNAME}/obj
+WRKSRC=		${WRKDIR}/clamav-bytecode-compiler-${DISTNAME}
 
 MAKE_JOBS_UNSAFE=	yes
 
-post-extract:
-	@${MKDIR} ${WRKSRC}
-
 do-install:
 	@${MKDIR} ${STAGEDIR}${DATADIR}/include/
-	@${RM} ${WRKSRC}/../clang/lib/Headers/CMakeLists.txt \
-		${WRKSRC}/../clang/lib/Headers/Makefile
-	(cd ${WRKSRC}/../clang/lib/Headers/ && ${COPYTREE_SHARE} . \
+	@${RM} ${WRKSRC}/clang/lib/Headers/CMakeLists.txt \
+		${WRKSRC}/clang/lib/Headers/Makefile
+	(cd ${WRKSRC}/clang/lib/Headers/ && ${COPYTREE_SHARE} . \
 		${STAGEDIR}${DATADIR}/include/)
-	${INSTALL_PROGRAM} ${WRKSRC}/Release/bin/clambc-compiler \
+	${INSTALL_PROGRAM} ${INSTALL_WRKSRC}/Release/bin/clambc-compiler \
 		${STAGEDIR}${PREFIX}/bin/
 
 .include <bsd.port.mk>
diff --git a/security/clambc/files/patch-clang_lib_Driver_ToolChains.cpp b/security/clambc/files/patch-clang_lib_Driver_ToolChains.cpp
index e4270300748b..9aac0d7c3f9e 100644
--- a/security/clambc/files/patch-clang_lib_Driver_ToolChains.cpp
+++ b/security/clambc/files/patch-clang_lib_Driver_ToolChains.cpp
@@ -1,6 +1,6 @@
---- ../clang/lib/Driver/ToolChains.cpp~	2014-11-10 13:04:47.000000000 -0500
-+++ ../clang/lib/Driver/ToolChains.cpp	2014-11-18 12:24:07.772342155 -0500
-@@ -895,7 +895,7 @@
+--- clang/lib/Driver/ToolChains.cpp.orig	2014-11-10 18:04:47 UTC
++++ clang/lib/Driver/ToolChains.cpp
+@@ -895,7 +895,7 @@ Tool &AuroraUX::SelectTool(const Compila
  
  Linux::Linux(const HostInfo &Host, const llvm::Triple& Triple)
    : Generic_GCC(Host, Triple) {
diff --git a/security/clambc/files/patch-clang_lib_Frontend_CompilerInvocation.cpp b/security/clambc/files/patch-clang_lib_Frontend_CompilerInvocation.cpp
index bb6123baabb2..6e1dbfa85c82 100644
--- a/security/clambc/files/patch-clang_lib_Frontend_CompilerInvocation.cpp
+++ b/security/clambc/files/patch-clang_lib_Frontend_CompilerInvocation.cpp
@@ -1,5 +1,5 @@
---- ../clang/lib/Frontend/CompilerInvocation.cpp.orig
-+++ ../clang/lib/Frontend/CompilerInvocation.cpp
+--- clang/lib/Frontend/CompilerInvocation.cpp.orig	2014-11-10 18:04:47 UTC
++++ clang/lib/Frontend/CompilerInvocation.cpp
 @@ -993,9 +993,8 @@ std::string CompilerInvocation::GetResourcesPath(const char *Argv0,
      P.eraseComponent();  // Remove /bin   from foo/bin
  
diff --git a/security/clambc/files/patch-clang_lib_Headers_CMakeLists.txt b/security/clambc/files/patch-clang_lib_Headers_CMakeLists.txt
index a122a914ac5e..fedd33c13121 100644
--- a/security/clambc/files/patch-clang_lib_Headers_CMakeLists.txt
+++ b/security/clambc/files/patch-clang_lib_Headers_CMakeLists.txt
@@ -1,5 +1,5 @@
---- ../clang/lib/Headers/CMakeLists.txt.orig
-+++ ../clang/lib/Headers/CMakeLists.txt
+--- clang/lib/Headers/CMakeLists.txt.orig	2014-11-10 18:04:47 UTC
++++ clang/lib/Headers/CMakeLists.txt
 @@ -17,7 +17,7 @@ set(files
  if (MSVC_IDE OR XCODE)
    set(output_dir ${LLVM_BINARY_DIR}/bin/lib/clang/${CLANG_VERSION}/include)
diff --git a/security/clambc/files/patch-clang_lib_Headers_Makefile b/security/clambc/files/patch-clang_lib_Headers_Makefile
index f004a3a6fa0d..7947f673f196 100644
--- a/security/clambc/files/patch-clang_lib_Headers_Makefile
+++ b/security/clambc/files/patch-clang_lib_Headers_Makefile
@@ -1,5 +1,5 @@
---- ../clang/lib/Headers/Makefile.orig
-+++ ../clang/lib/Headers/Makefile
+--- clang/lib/Headers/Makefile.orig	2014-11-10 18:04:47 UTC
++++ clang/lib/Headers/Makefile
 @@ -12,7 +12,7 @@ include $(LEVEL)/Makefile.common
  
  CLANG_VERSION := $(shell cat $(PROJ_SRC_DIR)/../../VER)
diff --git a/security/clambc/files/patch-clang_lib_Runtime_Makefile b/security/clambc/files/patch-clang_lib_Runtime_Makefile
index baeb53e7fe37..3f5fe559e68b 100644
--- a/security/clambc/files/patch-clang_lib_Runtime_Makefile
+++ b/security/clambc/files/patch-clang_lib_Runtime_Makefile
@@ -1,5 +1,5 @@
---- ../clang/lib/Runtime/Makefile.orig
-+++ ../clang/lib/Runtime/Makefile
+--- clang/lib/Runtime/Makefile.orig	2014-11-10 18:04:47 UTC
++++ clang/lib/Runtime/Makefile
 @@ -17,8 +17,8 @@ LEVEL = ../../../..
  include $(LEVEL)/Makefile.common
  
diff --git a/security/clambc/files/patch-clang_tools_CIndex_CIndexer.cpp b/security/clambc/files/patch-clang_tools_CIndex_CIndexer.cpp
index 588ea38e4cc9..9bee7ff31d2a 100644
--- a/security/clambc/files/patch-clang_tools_CIndex_CIndexer.cpp
+++ b/security/clambc/files/patch-clang_tools_CIndex_CIndexer.cpp
@@ -1,5 +1,5 @@
---- ../clang/tools/CIndex/CIndexer.cpp.orig
-+++ ../clang/tools/CIndex/CIndexer.cpp
+--- clang/tools/CIndex/CIndexer.cpp.orig	2014-11-10 18:04:47 UTC
++++ clang/tools/CIndex/CIndexer.cpp
 @@ -87,9 +87,8 @@ std::string CIndexer::getClangResourcesPath() {
      P.eraseComponent();  // Remove /bin   from foo/bin
  
diff --git a/security/clambc/files/patch-docs_user_building.tex b/security/clambc/files/patch-docs_user_building.tex
index cda24777cdc1..a4910b66b94a 100644
--- a/security/clambc/files/patch-docs_user_building.tex
+++ b/security/clambc/files/patch-docs_user_building.tex
@@ -1,5 +1,5 @@
---- ../docs/user/building.tex.orig
-+++ ../docs/user/building.tex
+--- docs/user/building.tex.orig	2014-11-10 18:04:47 UTC
++++ docs/user/building.tex
 @@ -96,7 +96,7 @@ $ make install-clambc -j8
  \verb+$PREFIX/bin/clambc-compiler+
  \item  ClamAV bytecode header files:
diff --git a/security/clambc/files/patch-docs_user_html_clambc-user.html b/security/clambc/files/patch-docs_user_html_clambc-user.html
index fa9828c8d563..2ac586504795 100644
--- a/security/clambc/files/patch-docs_user_html_clambc-user.html
+++ b/security/clambc/files/patch-docs_user_html_clambc-user.html
@@ -1,5 +1,5 @@
---- ../docs/user/html/clambc-user.html.orig
-+++ ../docs/user/html/clambc-user.html
+--- docs/user/html/clambc-user.html.orig	2014-11-10 18:04:47 UTC
++++ docs/user/html/clambc-user.html
 @@ -233,7 +233,7 @@ class="ec-lmtt-10">$PREFIX/bin/clambc-compiler</span></span></span>
  
                                                                                  
-- 
cgit debian/1.2.3+git2.25.1-1-2-gaceb0