Index: security/clambc/Makefile =================================================================== --- /dev/null +++ security/clambc/Makefile @@ -0,0 +1,42 @@ +# Created by: Ryan Steinmetz +# $FreeBSD$ + +PORTNAME= clambc +DISTVERSION= 0.98.5rc1 +CATEGORIES= security +MASTER_SITES= SF +MASTER_SITE_SUBDIR= clamav/${PORTNAME:tl} + +MAINTAINER= dvl@FreeBSD.org +COMMENT= Bytecode signature compiler for ClamAV + +LICENSE= GPLv2 + +#if __FreeBSD_version >= 1000000 +USE_GCC= any +#endif + +USES= gmake libtool perl5 +ALL_TARGET= clambc-only +GNU_CONFIGURE= yes +USE_LDCONFIG= yes +USE_PERL5= build +CONFIGURE_SCRIPT=../llvm/configure +CONFIGURE_ARGS= --enable-optimized --enable-targets=host-only \ + --disable-bindings --enable-bindings=none + +WRKSRC= ${WRKDIR}/clamav-bytecode-compiler-${DISTNAME}/obj + +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} . \ + ${STAGEDIR}${DATADIR}/include/) + ${INSTALL_PROGRAM} ${WRKSRC}/Release/bin/clambc-compiler \ + ${STAGEDIR}${PREFIX}/bin/ + +.include Index: security/clambc/distinfo =================================================================== --- /dev/null +++ security/clambc/distinfo @@ -0,0 +1,2 @@ +SHA256 (clambc-0.98.5rc1.tar.gz) = bed439949f4259791c80d069ea58c97637bdfaefe352dd0d8f27eb9e2df9b491 +SIZE (clambc-0.98.5rc1.tar.gz) = 17867376 Index: security/clambc/files/patch-clang_lib_Driver_ToolChains.cpp =================================================================== --- /dev/null +++ security/clambc/files/patch-clang_lib_Driver_ToolChains.cpp @@ -0,0 +1,11 @@ +--- ../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 @@ + + Linux::Linux(const HostInfo &Host, const llvm::Triple& Triple) + : Generic_GCC(Host, Triple) { +- getFilePaths().push_back(getDriver().Dir + "/../lib/clang/1.0/"); ++ getFilePaths().push_back(getDriver().Dir + "/../share/clambc/"); + getFilePaths().push_back("/lib/"); + getFilePaths().push_back("/usr/lib/"); + Index: security/clambc/files/patch-clang_lib_Frontend_CompilerInvocation.cpp =================================================================== --- /dev/null +++ security/clambc/files/patch-clang_lib_Frontend_CompilerInvocation.cpp @@ -0,0 +1,14 @@ +--- ../clang/lib/Frontend/CompilerInvocation.cpp.orig ++++ ../clang/lib/Frontend/CompilerInvocation.cpp +@@ -993,9 +993,8 @@ std::string CompilerInvocation::GetResourcesPath(const char *Argv0, + P.eraseComponent(); // Remove /bin from foo/bin + + // Get foo/lib/clang//include +- P.appendComponent("lib"); +- P.appendComponent("clang"); +- P.appendComponent(CLANG_VERSION_STRING); ++ P.appendComponent("share"); ++ P.appendComponent("clambc"); + } + + return P.str(); Index: security/clambc/files/patch-clang_lib_Headers_CMakeLists.txt =================================================================== --- /dev/null +++ security/clambc/files/patch-clang_lib_Headers_CMakeLists.txt @@ -0,0 +1,11 @@ +--- ../clang/lib/Headers/CMakeLists.txt.orig ++++ ../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) + else () +- set(output_dir ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/include) ++ set(output_dir ${LLVM_BINARY_DIR}/share/clambc) + endif () + + Index: security/clambc/files/patch-clang_lib_Headers_Makefile =================================================================== --- /dev/null +++ security/clambc/files/patch-clang_lib_Headers_Makefile @@ -0,0 +1,20 @@ +--- ../clang/lib/Headers/Makefile.orig ++++ ../clang/lib/Headers/Makefile +@@ -12,7 +12,7 @@ include $(LEVEL)/Makefile.common + + CLANG_VERSION := $(shell cat $(PROJ_SRC_DIR)/../../VER) + +-HeaderDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib/clang/$(CLANG_VERSION)/include ++HeaderDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/share/clambc + + HEADERS := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.h)) + +@@ -26,7 +26,7 @@ $(OBJHEADERS): $(HeaderDir)/%.h: $(PROJ_SRC_DIR)/%.h $(HeaderDir)/.dir + # Hook into the standard Makefile rules. + all-local:: $(OBJHEADERS) + +-PROJ_headers := $(DESTDIR)$(PROJ_prefix)/lib/clang/$(CLANG_VERSION)/include ++PROJ_headers := $(DESTDIR)$(PROJ_prefix)/share/clambc + + INSTHEADERS := $(addprefix $(PROJ_headers)/, $(HEADERS)) + Index: security/clambc/files/patch-clang_lib_Runtime_Makefile =================================================================== --- /dev/null +++ security/clambc/files/patch-clang_lib_Runtime_Makefile @@ -0,0 +1,13 @@ +--- ../clang/lib/Runtime/Makefile.orig ++++ ../clang/lib/Runtime/Makefile +@@ -17,8 +17,8 @@ LEVEL = ../../../.. + include $(LEVEL)/Makefile.common + + CLANG_VERSION := $(shell cat $(PROJ_SRC_DIR)/../../VER) +-ResourceDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib/clang/$(CLANG_VERSION) +-PROJ_resources := $(DESTDIR)$(PROJ_prefix)/lib/clang/$(CLANG_VERSION) ++ResourceDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/share/clambc ++PROJ_resources := $(DESTDIR)$(PROJ_prefix)/share/clambc + + ResourceLibDir := $(ResourceDir)/lib + PROJ_resources_lib := $(PROJ_resources)/lib Index: security/clambc/files/patch-clang_tools_CIndex_CIndexer.cpp =================================================================== --- /dev/null +++ security/clambc/files/patch-clang_tools_CIndex_CIndexer.cpp @@ -0,0 +1,14 @@ +--- ../clang/tools/CIndex/CIndexer.cpp.orig ++++ ../clang/tools/CIndex/CIndexer.cpp +@@ -87,9 +87,8 @@ std::string CIndexer::getClangResourcesPath() { + P.eraseComponent(); // Remove /bin from foo/bin + + // Get foo/lib/clang//include +- P.appendComponent("lib"); +- P.appendComponent("clang"); +- P.appendComponent(CLANG_VERSION_STRING); ++ P.appendComponent("local"); ++ P.appendComponent("clambc"); + } + + return P.str(); Index: security/clambc/files/patch-docs_user_building.tex =================================================================== --- /dev/null +++ security/clambc/files/patch-docs_user_building.tex @@ -0,0 +1,20 @@ +--- ../docs/user/building.tex.orig ++++ ../docs/user/building.tex +@@ -96,7 +96,7 @@ $ make install-clambc -j8 + \verb+$PREFIX/bin/clambc-compiler+ + \item ClamAV bytecode header files: + \begin{verbatim} +-$PREFIX/lib/clang/1.1/include: ++$PREFIX/share/clambc: + bcfeatures.h + bytecode_{api_decl.c,api,disasm,execs,features}.h + bytecode.h +@@ -104,7 +104,7 @@ bytecode_{local,pe,types}.h + \end{verbatim} + \item clang compiler (with ClamAV bytecode backend) compiler include files: + \begin{verbatim} +-$PREFIX/lib/clang/1.1/include: ++$PREFIX/share/clambc: + emmintrin.h + float.h + iso646.h Index: security/clambc/files/patch-docs_user_html_clambc-user.html =================================================================== --- /dev/null +++ security/clambc/files/patch-docs_user_html_clambc-user.html @@ -0,0 +1,11 @@ +--- ../docs/user/html/clambc-user.html.orig ++++ ../docs/user/html/clambc-user.html +@@ -233,7 +233,7 @@ class="ec-lmtt-10">$PREFIX/bin/clambc-compiler + + +
+- $PREFIX/lib/clang/1.1/include: ++ $PREFIX/share/clambc: +  
bcfeatures.h +  
bytecode_{api_decl.c,api,disasm,execs,features}.h +  
bytecode.h Index: security/clambc/pkg-descr =================================================================== --- /dev/null +++ security/clambc/pkg-descr @@ -0,0 +1,13 @@ +Bytecode signatures are a specialized type of ClamAV signature which is able +to perform additional processing of the scanned file and allow for more +robust detection. Unlike the standard ClamAV signature types, bytecode +signatures have a number of unique distinctions which need to be respected +for their effective usage. + +The major distinction between bytecode signatures and the other ClamAV based +standard signature languages is that bytecode signatures are actually +compiled from a user-written source file, similar to Java bytecode. The tool +used to generate bytecode signatures from source is the clambc-compiler +which is a separate project from ClamAV. + +WWW: https://github.com/vrtadmin/clamav-bytecode-compiler Index: security/clambc/pkg-plist =================================================================== --- /dev/null +++ security/clambc/pkg-plist @@ -0,0 +1,28 @@ +bin/clambc-compiler +%%DATADIR%%/include/bcfeatures.h +%%DATADIR%%/include/bytecode.h +%%DATADIR%%/include/bytecode_api.h +%%DATADIR%%/include/bytecode_api_decl.c.h +%%DATADIR%%/include/bytecode_detect.h +%%DATADIR%%/include/bytecode_disasm.h +%%DATADIR%%/include/bytecode_execs.h +%%DATADIR%%/include/bytecode_features.h +%%DATADIR%%/include/bytecode_ilog.h +%%DATADIR%%/include/bytecode_local.h +%%DATADIR%%/include/bytecode_pe.h +%%DATADIR%%/include/bytecode_types.h +%%DATADIR%%/include/emmintrin.h +%%DATADIR%%/include/float.h +%%DATADIR%%/include/iso646.h +%%DATADIR%%/include/limits.h +%%DATADIR%%/include/mm_malloc.h +%%DATADIR%%/include/mmintrin.h +%%DATADIR%%/include/pmmintrin.h +%%DATADIR%%/include/smmintrin.h +%%DATADIR%%/include/stdarg.h +%%DATADIR%%/include/stdbool.h +%%DATADIR%%/include/stddef.h +%%DATADIR%%/include/stdint.h +%%DATADIR%%/include/tgmath.h +%%DATADIR%%/include/tmmintrin.h +%%DATADIR%%/include/xmmintrin.h