ports/183101: [patch] update sysutils/bulkextractor to 1.4, unbreak with clang
Antoine Brodin
antoine at freebsd.org
Sat Oct 19 14:00:00 UTC 2013
>Number: 183101
>Category: ports
>Synopsis: [patch] update sysutils/bulkextractor to 1.4, unbreak with clang
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Sat Oct 19 14:00:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator: Antoine Brodin
>Release: FreeBSD 9.2-RELEASE amd64
>Organization:
none
>Environment:
System: FreeBSD pepperseed.dreadbsd.org 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Thu Sep 26 22:50:31 UTC 2013 root at bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
>Description:
- update to 1.4.0
- patches to unbreak with clang and libc++
- LICENSE is GPLv3 because of a file polluting his license
- remove article from COMMENT
- convert to STAGEDIR
- new LIB_DEPENDS syntax
- option to build BEViewer (java frontend)
>How-To-Repeat:
>Fix:
--- bulk_extractor.diff begins here ---
Index: sysutils/bulk_extractor/Makefile
===================================================================
--- sysutils/bulk_extractor/Makefile (revision 330856)
+++ sysutils/bulk_extractor/Makefile (working copy)
@@ -2,31 +2,45 @@
# $FreeBSD$
PORTNAME= bulk_extractor
-PORTVERSION= 1.2.2
-PORTREVISION= 1
+PORTVERSION= 1.4.0
CATEGORIES= sysutils
-MASTER_SITES= http://cloud.github.com/downloads/simsong/bulk_extractor/
+MASTER_SITES= http://www.digitalcorpora.org/downloads/bulk_extractor/
MAINTAINER= nobutaka at FreeBSD.org
-COMMENT= A program that scans a disk image and extracts useful information
+COMMENT= Program that scans a disk image and extracts useful information
-LICENSE= PD
-LICENSE_NAME= public domain
+LICENSE= GPLv3
LICENSE_FILE= ${WRKSRC}/COPYING
-LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
-LIB_DEPENDS= afflib:${PORTSDIR}/sysutils/afflib \
- ewf:${PORTSDIR}/devel/libewf \
- exiv2:${PORTSDIR}/graphics/exiv2 \
- expat:${PORTSDIR}/textproc/expat2
+LIB_DEPENDS= libafflib.so:${PORTSDIR}/sysutils/afflib \
+ libewf.so:${PORTSDIR}/devel/libewf \
+ libexiv2.so:${PORTSDIR}/graphics/exiv2 \
+ libexpat.so:${PORTSDIR}/textproc/expat2
-USE_AUTOTOOLS= autoconf
USE_OPENSSL= yes
-USE_PYTHON= yes
+GNU_CONFIGURE= yes
+CONFIGURE_ARGS= --enable-exiv2=true
+CPPFLAGS+= -I${LOCALBASE}/include
-MAN1= bulk_extractor.1
+PLIST_FILES= bin/bulk_extractor bin/plugin_test man/man1/bulk_extractor.1.gz
-PLIST_FILES= bin/bulk_extractor
+OPTIONS_DEFINE= JAVA
+OPTIONS_DEFAULT=JAVA
-NO_STAGE= yes
+.include <bsd.port.options.mk>
+
+.if ${OSVERSION} < 1000033
+BUILD_DEPENDS= ${LOCALBASE}/bin/flex:${PORTSDIR}/textproc/flex
+CONFIGURE_ENV= LEX=${LOCALBASE}/bin/flex
+.endif
+
+.if ${PORT_OPTIONS:MJAVA}
+USE_JAVA= yes
+JAVA_VERSION= 1.6+
+PLIST_FILES+= bin/BEViewer \
+ bin/BEViewer.jar
+.else
+CONFIGURE_ARGS+=--disable-BEViewer
+.endif
+
.include <bsd.port.mk>
Index: sysutils/bulk_extractor/distinfo
===================================================================
--- sysutils/bulk_extractor/distinfo (revision 330856)
+++ sysutils/bulk_extractor/distinfo (working copy)
@@ -1,2 +1,2 @@
-SHA256 (bulk_extractor-1.2.2.tar.gz) = d53cd3586d7a980fbf8e37eeb7b332a6a1f70f126bd4b2c831be6377b33412cb
-SIZE (bulk_extractor-1.2.2.tar.gz) = 2348436
+SHA256 (bulk_extractor-1.4.0.tar.gz) = 664df29fc0276f8d1b9ff259db13229ea01724915d6ad69493facdc2b4b44dd9
+SIZE (bulk_extractor-1.4.0.tar.gz) = 4346859
Index: sysutils/bulk_extractor/files/patch-configure.ac
===================================================================
--- sysutils/bulk_extractor/files/patch-configure.ac (revision 330856)
+++ sysutils/bulk_extractor/files/patch-configure.ac (working copy)
@@ -1,17 +0,0 @@
---- configure.ac.orig 2012-04-30 02:24:19.000000000 +0900
-+++ configure.ac 2012-04-30 02:24:27.000000000 +0900
-@@ -371,12 +371,14 @@
- AC_CHECK_LIB([expat],[XML_ParserCreate])
- fi
-
-+AC_LANG_PUSH(C++)
- if test "${exiv2}" != "no" ; then
- dnl check to see if we have the relevant headers
- AC_CHECK_HEADER([exiv2/image.hpp])
- AC_CHECK_HEADER([exiv2/exif.hpp])
- AC_CHECK_HEADER([exiv2/error.hpp])
- fi
-+AC_LANG_POP()
-
- AC_TRY_COMPILE([#pragma GCC diagnostic ignored "-Wshadow"],[],
- [AC_DEFINE(GNUC_HAS_DIAGNOSTIC_PRAGMA,1,[define 1 if GCC supports #pragma GCC diagnostic])]
Index: sysutils/bulk_extractor/files/patch-src__be13_api__plugin.cpp
===================================================================
--- sysutils/bulk_extractor/files/patch-src__be13_api__plugin.cpp (revision 0)
+++ sysutils/bulk_extractor/files/patch-src__be13_api__plugin.cpp (working copy)
@@ -0,0 +1,48 @@
+--- ./src/be13_api/plugin.cpp.orig 2013-08-18 16:35:29.000000000 +0000
++++ ./src/be13_api/plugin.cpp 2013-10-19 13:12:21.000000000 +0000
+@@ -9,7 +9,16 @@
+ #include <sys/stat.h>
+ #include <dirent.h>
+ #include <algorithm>
++#ifdef __clang__
++#if __has_include(<unordered_set>)
++#define HAVE_CXX11_UNORDERED_SET 1
++#endif
++#endif
++#ifdef HAVE_CXX11_UNORDERED_SET
++#include <unordered_set>
++#else
+ #include <tr1/unordered_set>
++#endif
+ #ifdef HAVE_ERR_H
+ #include <err.h>
+ #endif
+@@ -23,20 +32,28 @@
+ #include "../dfxml/src/hash_t.h"
+
+ namespace std {
++#ifndef HAVE_CXX11_UNORDERED_SET
+ namespace tr1 {
++#endif
+ template<>
+ struct hash<md5_t> {
+ size_t operator()(const md5_t &key) const {
+ return *(size_t *)(key.final());
+ }
+ };
++#ifndef HAVE_CXX11_UNORDERED_SET
+ }
++#endif
+ }
+
+ class atomic_hash_set
+ {
+ cppmutex M;
++#ifdef HAVE_CXX11_UNORDERED_SET
++ std::unordered_set<md5_t>myset;
++#else
+ std::tr1::unordered_set<md5_t>myset;
++#endif
+ public:
+ atomic_hash_set():M(),myset(){}
+ bool in(const md5_t &s){
Property changes on: sysutils/bulk_extractor/files/patch-src__be13_api__plugin.cpp
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: sysutils/bulk_extractor/files/patch-src__be13_api__sbuf.h
===================================================================
--- sysutils/bulk_extractor/files/patch-src__be13_api__sbuf.h (revision 0)
+++ sysutils/bulk_extractor/files/patch-src__be13_api__sbuf.h (working copy)
@@ -0,0 +1,11 @@
+--- ./src/be13_api/sbuf.h.orig 2013-08-19 18:54:59.000000000 +0000
++++ ./src/be13_api/sbuf.h 2013-10-19 13:09:32.000000000 +0000
+@@ -61,7 +61,7 @@
+ * in a 64-bit number.
+ */
+
+-inline int stoi(std::string str){
++inline int be13stoi(std::string str){
+ std::istringstream ss(str);
+ int val(0);
+ ss >> val;
Property changes on: sysutils/bulk_extractor/files/patch-src__be13_api__sbuf.h
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: sysutils/bulk_extractor/files/patch-src__bulk_extractor.cpp
===================================================================
--- sysutils/bulk_extractor/files/patch-src__bulk_extractor.cpp (revision 0)
+++ sysutils/bulk_extractor/files/patch-src__bulk_extractor.cpp (working copy)
@@ -0,0 +1,15 @@
+--- ./src/bulk_extractor.cpp.orig 2013-09-04 17:58:01.000000000 +0000
++++ ./src/bulk_extractor.cpp 2013-10-19 13:09:32.000000000 +0000
+@@ -1042,9 +1042,9 @@
+ feature_recorder *fr = fs.get_name(params.at(1));
+ const std::string &cmd = params.at(2);
+ if(fr){
+- if(cmd=="window") fr->set_context_window(stoi(it->second));
+- if(cmd=="window_before") fr->set_context_window_before(stoi(it->second));
+- if(cmd=="window_after") fr->set_context_window_after(stoi(it->second));
++ if(cmd=="window") fr->set_context_window(be13stoi(it->second));
++ if(cmd=="window_before") fr->set_context_window_before(be13stoi(it->second));
++ if(cmd=="window_after") fr->set_context_window_after(be13stoi(it->second));
+ }
+ }
+ /* See if there is a scanner? */
Property changes on: sysutils/bulk_extractor/files/patch-src__bulk_extractor.cpp
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: sysutils/bulk_extractor/files/patch-src__scan_bulk.cpp
===================================================================
--- sysutils/bulk_extractor/files/patch-src__scan_bulk.cpp (revision 0)
+++ sysutils/bulk_extractor/files/patch-src__scan_bulk.cpp (working copy)
@@ -0,0 +1,11 @@
+--- ./src/scan_bulk.cpp.orig 2013-08-18 16:39:31.000000000 +0000
++++ ./src/scan_bulk.cpp 2013-10-19 13:09:32.000000000 +0000
+@@ -145,7 +145,7 @@
+ exit(1);
+ }
+
+- uint32_t len = stoi(vals[1]);
++ uint32_t len = be13stoi(vals[1]);
+
+ // If no data for this sector, simply append this type
+ // and then continue
Property changes on: sysutils/bulk_extractor/files/patch-src__scan_bulk.cpp
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: sysutils/bulk_extractor/files/patch-src__scan_exif.cpp
===================================================================
--- sysutils/bulk_extractor/files/patch-src__scan_exif.cpp (revision 0)
+++ sysutils/bulk_extractor/files/patch-src__scan_exif.cpp (working copy)
@@ -0,0 +1,24 @@
+--- ./src/scan_exif.cpp.orig 2013-08-18 16:39:17.000000000 +0000
++++ ./src/scan_exif.cpp 2013-10-19 13:09:32.000000000 +0000
+@@ -213,7 +213,7 @@
+ * Used for helping to convert TIFF's GPS format to decimal lat/long
+ */
+
+-static double stod(string s)
++static double be13stod(string s)
+ {
+ double d=0;
+ sscanf(s.c_str(),"%lf",&d);
+@@ -223,9 +223,9 @@
+ static double rational(string s)
+ {
+ std::vector<std::string> parts = split(s,'/');
+- if(parts.size()!=2) return stod(s); // no slash, so return without
+- double top = stod(parts[0]);
+- double bot = stod(parts[1]);
++ if(parts.size()!=2) return be13stod(s); // no slash, so return without
++ double top = be13stod(parts[0]);
++ double bot = be13stod(parts[1]);
+ return bot>0 ? top / bot : top;
+ }
+
Property changes on: sysutils/bulk_extractor/files/patch-src__scan_exif.cpp
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Index: sysutils/bulk_extractor/files/patch-src__scan_exiv2.cpp
===================================================================
--- sysutils/bulk_extractor/files/patch-src__scan_exiv2.cpp (revision 0)
+++ sysutils/bulk_extractor/files/patch-src__scan_exiv2.cpp (working copy)
@@ -0,0 +1,24 @@
+--- ./src/scan_exiv2.cpp.orig 2013-08-18 16:39:17.000000000 +0000
++++ ./src/scan_exiv2.cpp 2013-10-19 13:09:32.000000000 +0000
+@@ -68,7 +68,7 @@
+ * Used for helping to convert libexiv2's GPS format to decimal lat/long
+ */
+
+-static double stod(string s)
++static double be13stod(string s)
+ {
+ double d=0;
+ sscanf(s.c_str(),"%lf",&d);
+@@ -78,9 +78,9 @@
+ static double rational(string s)
+ {
+ std::vector<std::string> parts = split(s,'/');
+- if(parts.size()!=2) return stod(s); // no slash, so return without
+- double top = stod(parts[0]);
+- double bot = stod(parts[1]);
++ if(parts.size()!=2) return be13stod(s); // no slash, so return without
++ double top = be13stod(parts[0]);
++ double bot = be13stod(parts[1]);
+ return bot>0 ? top / bot : top;
+ }
+
Property changes on: sysutils/bulk_extractor/files/patch-src__scan_exiv2.cpp
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: sysutils/bulk_extractor/files/patch-src__scan_net.cpp
===================================================================
--- sysutils/bulk_extractor/files/patch-src__scan_net.cpp (revision 0)
+++ sysutils/bulk_extractor/files/patch-src__scan_net.cpp (working copy)
@@ -0,0 +1,31 @@
+--- ./src/scan_net.cpp.orig 2013-08-18 16:39:17.000000000 +0000
++++ ./src/scan_net.cpp 2013-10-19 13:09:32.000000000 +0000
+@@ -27,7 +27,16 @@
+ #include "be13_api/utils.h"
+
+ #include <set>
++#ifdef __clang__
++#if __has_include(<unordered_set>)
++#define HAVE_CXX11_UNORDERED_SET 1
++#endif
++#endif
++#ifdef HAVE_CXX11_UNORDERED_SET
++#include <unordered_set>
++#else
+ #include <tr1/unordered_set>
++#endif
+
+ #include <sys/types.h>
+ #include <stdlib.h>
+@@ -603,7 +612,11 @@
+ return *this; // no-op
+ }
+ public:
++#ifdef HAVE_CXX11_UNORDERED_SET
++ typedef std::unordered_set<const void *> packetset;
++#else
+ typedef std::tr1::unordered_set<const void *> packetset;
++#endif
+ feature_recorder_set &fs;
+ packetset ps;
+ feature_recorder *ip_recorder;
Property changes on: sysutils/bulk_extractor/files/patch-src__scan_net.cpp
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: sysutils/bulk_extractor/files/patch-src__stand.cpp
===================================================================
--- sysutils/bulk_extractor/files/patch-src__stand.cpp (revision 0)
+++ sysutils/bulk_extractor/files/patch-src__stand.cpp (working copy)
@@ -0,0 +1,11 @@
+--- ./src/stand.cpp.orig 2012-12-12 15:36:14.000000000 +0000
++++ ./src/stand.cpp 2013-10-19 13:09:32.000000000 +0000
+@@ -91,7 +91,7 @@
+
+ if(argc!=1) usage();
+
+- opt_scan_bulk_block_size = stoi(be_config["bulk_block_size"]);
++ opt_scan_bulk_block_size = be13stoi(be_config["bulk_block_size"]);
+
+ feature_file_names_t feature_file_names;
+ enable_feature_recorders(feature_file_names);
Property changes on: sysutils/bulk_extractor/files/patch-src__stand.cpp
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Index: sysutils/bulk_extractor/files/patch-src__word_and_context_list.h
===================================================================
--- sysutils/bulk_extractor/files/patch-src__word_and_context_list.h (revision 0)
+++ sysutils/bulk_extractor/files/patch-src__word_and_context_list.h (working copy)
@@ -0,0 +1,40 @@
+--- ./src/word_and_context_list.h.orig 2012-12-12 15:36:14.000000000 +0000
++++ ./src/word_and_context_list.h 2013-10-19 13:09:32.000000000 +0000
+@@ -29,8 +29,18 @@
+ * Typically this is used for stop lists and alert lists.
+ */
+
++#ifdef __clang__
++#if __has_include(<unordered_set>)
++#define HAVE_CXX11_UNORDERED_SET 1
++#endif
++#endif
++#ifdef HAVE_CXX11_UNORDERED_SET
++#include <unordered_map>
++#include <unordered_set>
++#else
+ #include <tr1/unordered_map>
+ #include <tr1/unordered_set>
++#endif
+
+ class context {
+ public:
+@@ -75,10 +85,18 @@
+ */
+ class word_and_context_list {
+ private:
++#ifdef HAVE_CXX11_UNORDERED_SET
++ typedef unordered_multimap<string,context> stopmap_t;
++#else
+ typedef tr1::unordered_multimap<string,context> stopmap_t;
++#endif
+ stopmap_t fcmap; // maps features to contexts; for finding them
+
++#ifdef HAVE_CXX11_UNORDERED_SET
++ typedef unordered_set< string > stopset_t;
++#else
+ typedef tr1::unordered_set< string > stopset_t;
++#endif
+ stopset_t context_set; // presence of a pair in fcmap
+
+ beregex_vector patterns;
Property changes on: sysutils/bulk_extractor/files/patch-src__word_and_context_list.h
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: sysutils/bulk_extractor/files/patch-src_scan_net.cpp
===================================================================
--- sysutils/bulk_extractor/files/patch-src_scan_net.cpp (revision 330856)
+++ sysutils/bulk_extractor/files/patch-src_scan_net.cpp (working copy)
@@ -1,21 +0,0 @@
---- src/scan_net.cpp.orig 2012-04-30 02:52:53.000000000 +0900
-+++ src/scan_net.cpp 2012-04-30 02:53:04.000000000 +0900
-@@ -28,6 +28,7 @@
- #include <tr1/unordered_set>
-
- #include <sys/types.h>
-+#include <sys/socket.h>
- #include <stdlib.h>
- #include <string.h>
- #include <ctype.h>
-@@ -233,8 +234,8 @@
- u_int8_t ip_ttl; /* time to live */
- u_int8_t ip_p; /* protocol */
- u_short ip_sum; /* checksum */
-- uint32_t ip_src;
-- uint32_t ip_dst; /* source and dest address */
-+ struct in_addr ip_src;
-+ struct in_addr ip_dst; /* source and dest address */
- };
- #endif
-
--- bulk_extractor.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list