Gentoo Archives: gentoo-commits

From: "Göktürk Yüksek" <gokturk@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-forensics/sleuthkit/, app-forensics/sleuthkit/files/
Date: Thu, 29 Nov 2018 02:58:47
Message-Id: 1543460301.e848842de5bfddc72ef014c13d97b62801b5b6fd.gokturk@gentoo
1 commit: e848842de5bfddc72ef014c13d97b62801b5b6fd
2 Author: Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
3 AuthorDate: Thu Nov 29 02:54:50 2018 +0000
4 Commit: Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
5 CommitDate: Thu Nov 29 02:58:21 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e848842d
7
8 app-forensics/sleuthkit: bump to 4.6.4
9
10 - Add support for dev-db/postgresql via 'postgres' USE flag
11 - Strip the version in the sleuthkit jar file name when installing
12 as per eclass recommendation
13 - Fix the regex in src_install
14 (Buggy version worked fine for previous versions, no user visible breakage)
15
16 Signed-off-by: Göktürk Yüksek <gokturk <AT> gentoo.org>
17 Package-Manager: Portage-2.3.51, Repoman-2.3.11
18
19 app-forensics/sleuthkit/Manifest | 2 +
20 .../sleuthkit-4.6.4-default-jar-location-fix.patch | 58 +++++
21 app-forensics/sleuthkit/sleuthkit-4.6.4.ebuild | 254 +++++++++++++++++++++
22 3 files changed, 314 insertions(+)
23
24 diff --git a/app-forensics/sleuthkit/Manifest b/app-forensics/sleuthkit/Manifest
25 index 532874c9e0c..9b98215a04a 100644
26 --- a/app-forensics/sleuthkit/Manifest
27 +++ b/app-forensics/sleuthkit/Manifest
28 @@ -1,4 +1,6 @@
29 +DIST SparseBitSet-1.1.jar 23706 BLAKE2B 8623a723f11f97386a108c775fefddd324997b68bea7f7ade0581ec5800bfa8d32f699ab903ad66c631b7b5c69ba1ef377243653f5044f39234dac07543eb129 SHA512 cf75431c5f705961800ce5cbca2acb9b2459eaf98ec37b5ee21c5a90d204ffb466fa25457b0560fbb024489777efbea0276201024c7b1b2853124930ac490983
30 DIST libewf-20130128.tar.gz 1978794 BLAKE2B e5d2bd8f4a8b878e13536b89b032d8cee6982272065b2bf325f8a811dff258264118a79496912377337ceb9ad630138b6bedb89e3c3be89a5f6a6fea85ab586b SHA512 94cdd0c3f0d8f535f3462c5adba266302f9b129abacda077ed429fa38af6862fca5a90ba2e606b78607b509769305cc6134c483c7033c20e226596cca2d42b90
31 DIST sleuthkit-4.5.0.tar.gz 8611141 BLAKE2B a1ae66bfcb74ce1fec24f80dfe60cd68f1de53119331c38848f7f82de8052eda49d78fdea49e42ada5843094939ef212dece42a5ceb85931a79e02adccda30e6 SHA512 911890cacca739f121681514197104cb2dc3bd219f3e068c4ce61264498c56989359976fc75172e1f456c94e4e25c6206413b0234c36e55736a577b8e664e4b3
32 DIST sleuthkit-4.6.0.tar.gz 8634432 BLAKE2B b45721cdee798d84f0caa0bfe38645346539bb497f5a492c72016a6b3b0246b362ecea676a7a0e788d66cc0dc32335e719912434bd61aa205b7d51b8d4bd7c14 SHA512 dbf880e8503dccb0a686f1d9658d56e9cb40f452127f9b713cf2a4941f4083fa1cf80a886994d58421307a679242cd4ee005b3e874cf429cfb140a597a0dc739
33 +DIST sleuthkit-4.6.4.tar.gz 8655341 BLAKE2B 9d8a2884d1c90e9be3104221c22fdc4346c8f288a13384ef8205cea46bbda2249691b548b7d19a1b34d6d0d1fc6d5390aa0fc8c8b28ea75b53de946b62c8e25c SHA512 0dd3fc3659fd6dee49ababd8033bcc5ce218c9154b61eb072a943e8d1a96fb04dcabc85124583bc69ad0ced2609fed11812164a3db6587446255a9c507f08762
34 DIST sqlite-jdbc-3.8.11.jar 5131732 BLAKE2B 1a04fa9e9cb97fdddc19af2de9efa7b54c0b527642e6e325e31054e4e294e3bc6af00ea291087ed9dd26668d48dae356035fc85212c0eb81656550d552103ed0 SHA512 5f4705101992e8916e29742c560aef0d01eba9dc0d2d984b75a77e56be3c9fd20b284390fe8f9bb54bf9d1f8528c3413922684c446212ca8961ac731543fb179
35
36 diff --git a/app-forensics/sleuthkit/files/sleuthkit-4.6.4-default-jar-location-fix.patch b/app-forensics/sleuthkit/files/sleuthkit-4.6.4-default-jar-location-fix.patch
37 new file mode 100644
38 index 00000000000..126fce904a8
39 --- /dev/null
40 +++ b/app-forensics/sleuthkit/files/sleuthkit-4.6.4-default-jar-location-fix.patch
41 @@ -0,0 +1,58 @@
42 +From f8c1cada7f01826b15a82b20600b8df7562fa2ed Mon Sep 17 00:00:00 2001
43 +From: =?UTF-8?q?G=C3=B6kt=C3=BCrk=20Y=C3=BCksek?= <gokturk@g.o>
44 +Date: Wed, 28 Nov 2018 21:33:46 -0500
45 +Subject: [PATCH v1] Allow --enable-offline to accept a directory argument for
46 + jar libs
47 +
48 +Allow the hardcoded default_jar_location in build.xml to
49 +/usr/share/java to be changed using the argument provided to
50 +--enable-offline. Note that this changes the behavior of the switch
51 +from "anything other than yes or no is incorrect" to "anything other
52 +than no implies offline mode".
53 +---
54 + bindings/java/Makefile.am | 4 ++++
55 + configure.ac | 10 +++++++++-
56 + 2 files changed, 13 insertions(+), 1 deletion(-)
57 +
58 +diff --git a/bindings/java/Makefile.am b/bindings/java/Makefile.am
59 +index ad27526e..f0bb9f68 100644
60 +--- a/bindings/java/Makefile.am
61 ++++ b/bindings/java/Makefile.am
62 +@@ -7,6 +7,10 @@ jar_DATA = $(tsk_jar)
63 +
64 + if OFFLINE
65 + ant_args=-Doffline=true
66 ++if CUSTOM_DEFAULT_JAR_LOCATION
67 ++ ant_args+= -Ddefault-jar-location="@DEFAULT_JAR_LOCATION@"
68 ++else
69 ++endif
70 + else
71 +
72 + endif
73 +diff --git a/configure.ac b/configure.ac
74 +index dc9026ed..d3d41646 100644
75 +--- a/configure.ac
76 ++++ b/configure.ac
77 +@@ -221,10 +221,18 @@ AC_ARG_ENABLE([offline],
78 + [case "${enableval}" in
79 + yes) offline=true ;;
80 + no) offline=false ;;
81 +- *) AC_MSG_ERROR([bad value ${enableval} for --enable-online]) ;;
82 ++ *)
83 ++ offline=true
84 ++ default_jar_location="${enableval}"
85 ++ ;;
86 + esac],[offline=false])
87 +
88 + AM_CONDITIONAL([OFFLINE], [test "x$offline" = xtrue])
89 ++AM_CONDITIONAL([CUSTOM_DEFAULT_JAR_LOCATION], [test "x$default_jar_location" != "x"])
90 ++AM_COND_IF([CUSTOM_DEFAULT_JAR_LOCATION],
91 ++ [AC_SUBST([DEFAULT_JAR_LOCATION], [$default_jar_location])]
92 ++)
93 ++
94 +
95 +
96 + dnl Check if we should link libewf.
97 +--
98 +2.19.1
99 +
100
101 diff --git a/app-forensics/sleuthkit/sleuthkit-4.6.4.ebuild b/app-forensics/sleuthkit/sleuthkit-4.6.4.ebuild
102 new file mode 100644
103 index 00000000000..2ec1f680ac4
104 --- /dev/null
105 +++ b/app-forensics/sleuthkit/sleuthkit-4.6.4.ebuild
106 @@ -0,0 +1,254 @@
107 +# Copyright 1999-2018 Gentoo Authors
108 +# Distributed under the terms of the GNU General Public License v2
109 +
110 +EAPI=6
111 +
112 +JAVA_PKG_BSFIX_NAME="build.xml build-unix.xml"
113 +inherit autotools java-pkg-opt-2 java-ant-2
114 +
115 +DESCRIPTION="A collection of file system and media management forensic analysis tools"
116 +HOMEPAGE="https://www.sleuthkit.org/sleuthkit/"
117 +# TODO: sqlite-jdbc does not exist in the tree, we bundle it for now
118 +# TODO: Upstream uses a very specific version of libewf which is not in
119 +# the tree anymore. So we statically compile and link to sleuthkit.
120 +# Hopefully upstream will figure something out in the future.
121 +SRC_URI="https://github.com/${PN}/${PN}/releases/download/${P}/${P}.tar.gz
122 + java? (
123 + http://repo1.maven.org/maven2/org/xerial/sqlite-jdbc/3.8.11/sqlite-jdbc-3.8.11.jar
124 + http://repo1.maven.org/maven2/com/zaxxer/SparseBitSet/1.1/SparseBitSet-1.1.jar
125 + )
126 + ewf? ( https://dev.gentoo.org/~gokturk/distfiles/app-forensics/libewf/libewf-20130128.tar.gz )"
127 +
128 +LICENSE="BSD CPL-1.0 GPL-2+ IBM java? ( Apache-2.0 )"
129 +SLOT="0/13" # subslot = major soname version
130 +KEYWORDS="~amd64 ~hppa ~ppc ~x86"
131 +IUSE="aff doc ewf java postgres static-libs test +threads zlib"
132 +
133 +# Note: It is not possible to move the dep on dev-java/jdbc-postgresql
134 +# inside a conditional postgres? block because java sources import
135 +# org.postgres unconditionally as of writing this (version 4.6.4). The
136 +# postgres USE flag will be used for the TSK postgresql support however.
137 +DEPEND="
138 + dev-db/sqlite:3
139 + dev-lang/perl:*
140 + aff? ( app-forensics/afflib )
141 + ewf? ( sys-libs/zlib )
142 + java? (
143 + >=virtual/jdk-1.8:*
144 + >=dev-java/c3p0-0.9.5:0
145 + >=dev-java/jdbc-postgresql-9.4:0
146 + )
147 + postgres? ( dev-db/postgresql:= )
148 + zlib? ( sys-libs/zlib )
149 +"
150 +# TODO: add support for not-in-tree libraries libvhdi and libvmdk
151 +# libvhdi: https://github.com/libyal/libvhdi
152 +# libvmdk: https://github.com/libyal/libvmdk
153 +# DEPEND="${DEPEND}
154 +# vhdi? ( dev-libs/libvhdi )
155 +# vmdk? ( dev-libs/libvmdk )
156 +# "
157 +
158 +RDEPEND="${DEPEND}
159 + java? ( >=virtual/jre-1.8:= )
160 +"
161 +DEPEND="${DEPEND}
162 + doc? ( app-doc/doxygen )
163 + test? ( >=dev-util/cppunit-1.2.1 )
164 +"
165 +
166 +PATCHES=(
167 + "${FILESDIR}"/${PN}-4.1.0-tools-shared-libs.patch
168 + "${FILESDIR}"/${PN}-4.6.4-default-jar-location-fix.patch
169 +)
170 +
171 +src_unpack() {
172 + local f
173 +
174 + unpack ${P}.tar.gz
175 +
176 + # Ick, the upstream is stuck at libewf-20130128 which is
177 + # not even in the tree anymore. So we have to bundle it.
178 + if use ewf; then
179 + pushd "${T}" &>/dev/null || die
180 + unpack libewf-20130128.tar.gz
181 + export TSK_LIBEWF_SRCDIR="${T}"/libewf-20130128
182 + popd &>/dev/null || die
183 + fi
184 +
185 + # Copy the jar files that don't exist in the tree yet
186 + if use java; then
187 + TSK_JAR_DIR="${T}/lib"
188 + mkdir "${TSK_JAR_DIR}" || die
189 + for f in ${A}; do
190 + if [[ ${f} =~ .jar$ ]]; then
191 + cp "${DISTDIR}"/"${f}" "${TSK_JAR_DIR}" || die
192 + fi
193 + done
194 + export TSK_JAR_DIR
195 + fi
196 +}
197 +
198 +tsk_prepare_libewf() {
199 + # Yeah, libewf-20130128 obviously doesn't just nicely compile
200 + sed -e 's/LIBUNA_INLINE inline/LIBUNA_INLINE/' \
201 + -i "${TSK_LIBEWF_SRCDIR}"/libuna/libuna_inline.h || die
202 +}
203 +
204 +src_prepare() {
205 + use ewf && tsk_prepare_libewf
206 +
207 + if use java; then
208 + pushd "${S}"/bindings/java &>/dev/null || die
209 +
210 + # Prevent "make install" from installing
211 + # jar files under /usr/share/java
212 + # We'll use the java eclasses for this
213 + sed -e '/^jar_DATA/ d;' -i Makefile.am || die
214 +
215 + java-pkg-opt-2_src_prepare
216 +
217 + popd &>/dev/null || die
218 + fi
219 +
220 + # Override the doxygen output directories
221 + if use doc; then
222 + sed -e "/^OUTPUT_DIRECTORY/ s|=.*$|= ${T}/doc|" \
223 + -i tsk/docs/Doxyfile \
224 + -i bindings/java/doxygen/Doxyfile || die
225 + fi
226 +
227 + # It's safe to call this even after java-pkg-opt-2_src_prepare
228 + # because future calls to eapply_user do nothing and return 0
229 + default
230 +
231 + eautoreconf
232 +}
233 +
234 +tsk_compile_libewf() {
235 + local myeconfargs=(
236 + --prefix=/
237 + --libdir=/lib
238 + --enable-static
239 + --disable-shared
240 + --disable-winapi
241 + --without-libbfio
242 + --with-zlib
243 + --without-bzip2
244 + --without-libhmac
245 + --without-openssl
246 + --without-libuuid
247 + --without-libfuse
248 + )
249 + # We want to contain our build flags
250 + local CFLAGS="${CFLAGS}"
251 + local LDFLAGS="${LDFLAGS}"
252 +
253 + pushd "${TSK_LIBEWF_SRCDIR}" &>/dev/null || die
254 +
255 + # Produce relocatable code
256 + CFLAGS+=" -fPIC"
257 + LDFLAGS+=" -fPIC"
258 + econf "${myeconfargs[@]}"
259 +
260 + # Do not waste CPU cycles on building ewftools
261 + sed -e '/ewftools/ d' -i Makefile || die
262 + emake
263 +
264 + # Only install the headers and the library
265 + emake -C libewf DESTDIR="${T}"/image install
266 + emake -C include DESTDIR="${T}"/image install
267 + find "${T}"/image -name '*.la' -delete || die
268 +
269 + popd &>/dev/null || die
270 +}
271 +
272 +src_configure() {
273 + local myeconfargs=(
274 + --enable-offline="${TSK_JAR_DIR}"
275 + $(use_enable java)
276 + $(use_enable static-libs static)
277 + $(use_enable threads multithreading)
278 + $(use_with aff afflib)
279 + $(use_with zlib)
280 + )
281 + # Workaround the automagic detection of postgresql
282 + local -x ac_cv_lib_pq_PQlibVersion="$(usex postgres)"
283 + # TODO: add support for non-existing libraries libvhdi and libvmdk
284 + # myeconfargs+=(
285 + # $(use_with vhdi libvhdi)
286 + # $(use_with vmdk libvmdk)
287 + # )
288 + myeconfargs+=(
289 + --without-libvhdi
290 + --without-libvmdk
291 + )
292 +
293 + if use ewf; then
294 + tsk_compile_libewf
295 + myeconfargs+=( $(use_with ewf libewf "${T}"/image) )
296 + fi
297 +
298 + if use java; then
299 + pushd "${S}"/bindings/java &>/dev/null || die
300 + java-ant-2_src_configure
301 + popd &>/dev/null || die
302 + fi
303 +
304 + econf "${myeconfargs[@]}"
305 +}
306 +
307 +src_compile() {
308 + # Create symlinks of jars for the required dependencies
309 + if use java; then
310 + pushd "${S}"/bindings/java &>/dev/null || die
311 +
312 + java-pkg_jar-from --into "${TSK_JAR_DIR}" c3p0
313 + java-pkg_jar-from --into "${TSK_JAR_DIR}" jdbc-postgresql
314 +
315 + popd &>/dev/null || die
316 + fi
317 +
318 + # Create the doc output dirs if requested
319 + if use doc; then
320 + mkdir -p "${T}"/doc/{api-docs,jni-docs} || die
321 + fi
322 +
323 + emake all $(usex doc api-docs "")
324 +}
325 +
326 +src_install() {
327 + local f
328 +
329 + if use java; then
330 + pushd "${S}"/bindings/java &>/dev/null || die
331 +
332 + java-pkg_newjar "dist/${P}.jar" "${PN}.jar"
333 +
334 + # Install the bundled jar files
335 + pushd "${TSK_JAR_DIR}" &>/dev/null || die
336 + for f in *; do
337 + # Skip the symlinks java-pkg_jar-from created
338 + [[ -f ${f} ]] || continue
339 +
340 + # Strip the version numbers as per eclass recommendation
341 + [[ ${f} =~ -([0-9]+\.)+jar$ ]] || continue
342 +
343 + java-pkg_newjar "${f}" "${f/${BASH_REMATCH[0]}/.jar}"
344 + done
345 + popd &>/dev/null || die
346 +
347 + popd &>/dev/null || die
348 + fi
349 +
350 + default
351 +
352 + # It unconditionally builds both api and jni docs
353 + # We install conditionally based on the provided use flags
354 + if use doc; then
355 + dodoc -r "${T}"/doc/api-docs
356 + use java && dodoc -r "${T}"/doc/jni-docs
357 + fi
358 +
359 + find "${D}" -name '*.la' -delete || die
360 +}