Gentoo Archives: gentoo-commits

From: Florian Schmaus <flow@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-forensics/sleuthkit/
Date: Mon, 09 May 2022 18:58:25
Message-Id: 1652122694.33dc6d3ab9212c4163a4f38807aa0ae0ca2c54e3.flow@gentoo
1 commit: 33dc6d3ab9212c4163a4f38807aa0ae0ca2c54e3
2 Author: Volkmar W. Pogatzki <gentoo <AT> pogatzki <DOT> net>
3 AuthorDate: Thu Apr 28 11:13:20 2022 +0000
4 Commit: Florian Schmaus <flow <AT> gentoo <DOT> org>
5 CommitDate: Mon May 9 18:58:14 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=33dc6d3a
7
8 app-forensics/sleuthkit: dependency switch guava:20 -> guava:0
9
10 Signed-off-by: Volkmar W. Pogatzki <gentoo <AT> pogatzki.net>
11 Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
12
13 app-forensics/sleuthkit/sleuthkit-4.10.1-r5.ebuild | 296 +++++++++++++++++++
14 app-forensics/sleuthkit/sleuthkit-4.11.1-r1.ebuild | 313 +++++++++++++++++++++
15 2 files changed, 609 insertions(+)
16
17 diff --git a/app-forensics/sleuthkit/sleuthkit-4.10.1-r5.ebuild b/app-forensics/sleuthkit/sleuthkit-4.10.1-r5.ebuild
18 new file mode 100644
19 index 000000000000..2376e0f7e793
20 --- /dev/null
21 +++ b/app-forensics/sleuthkit/sleuthkit-4.10.1-r5.ebuild
22 @@ -0,0 +1,296 @@
23 +# Copyright 1999-2022 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=7
27 +
28 +JAVA_PKG_BSFIX_NAME="build.xml build-unix.xml"
29 +inherit autotools java-pkg-opt-2 java-ant-2
30 +
31 +DESCRIPTION="A collection of file system and media management forensic analysis tools"
32 +HOMEPAGE="https://www.sleuthkit.org/sleuthkit/"
33 +# TODO: sqlite-jdbc does not exist in the tree, we bundle it for now
34 +# See: https://bugs.gentoo.org/690010
35 +# TODO: Upstream uses a very specific version of libewf which is not in
36 +# the tree anymore. So we statically compile and link to sleuthkit.
37 +# Hopefully upstream will figure something out in the future.
38 +# See: https://bugs.gentoo.org/689752
39 +SRC_URI="https://github.com/${PN}/${PN}/releases/download/${P}/${P}.tar.gz
40 + java? (
41 + http://repo1.maven.org/maven2/org/xerial/sqlite-jdbc/3.25.2/sqlite-jdbc-3.25.2.jar
42 + )
43 + ewf? ( https://github.com/sleuthkit/libewf_64bit/archive/VisualStudio_2010.tar.gz -> sleuthkit-libewf_64bit-20130416.tar.gz )"
44 +
45 +LICENSE="BSD CPL-1.0 GPL-2+ IBM java? ( Apache-2.0 )"
46 +SLOT="0/19" # subslot = major soname version
47 +KEYWORDS="~amd64 ~hppa ~ppc ~x86"
48 +IUSE="aff doc ewf java static-libs test +threads zlib"
49 +RESTRICT="!test? ( test )"
50 +
51 +DEPEND="
52 + dev-db/sqlite:3
53 + dev-lang/perl:*
54 + aff? ( app-forensics/afflib )
55 + ewf? ( sys-libs/zlib )
56 + java? (
57 + >=dev-java/c3p0-0.9.5:0
58 + dev-java/commons-lang:3.6
59 + >=dev-java/commons-validator-1.6:0
60 + >=dev-java/gson-2.8.5:2.6
61 + dev-java/guava:0
62 + >=dev-java/jdbc-postgresql-9.4:0
63 + >=dev-java/joda-time-2.4:0
64 + dev-java/sparsebitset:0
65 + )
66 + zlib? ( sys-libs/zlib )
67 +"
68 +# TODO: add support for not-in-tree libraries libvhdi and libvmdk
69 +# libvhdi: https://github.com/libyal/libvhdi
70 +# libvmdk: https://github.com/libyal/libvmdk
71 +# DEPEND="${DEPEND}
72 +# vhdi? ( dev-libs/libvhdi )
73 +# vmdk? ( dev-libs/libvmdk )
74 +# "
75 +
76 +RDEPEND="${DEPEND}
77 + java? ( virtual/jre:1.8 )
78 +"
79 +DEPEND="${DEPEND}
80 + java? ( virtual/jdk:1.8 )
81 + test? ( >=dev-util/cppunit-1.2.1 )
82 +"
83 +BDEPEND="
84 + doc? ( app-doc/doxygen )
85 +"
86 +
87 +PATCHES=(
88 + "${FILESDIR}"/${PN}-4.1.0-tools-shared-libs.patch
89 + "${FILESDIR}"/${PN}-4.6.4-default-jar-location-fix.patch
90 + "${FILESDIR}"/${PN}-4.10.1-exclude-usr-local.patch
91 +)
92 +
93 +src_unpack() {
94 + local f
95 +
96 + unpack ${P}.tar.gz
97 +
98 + if use ewf; then
99 + pushd "${T}" &>/dev/null || die
100 + unpack sleuthkit-libewf_64bit-20130416.tar.gz
101 + export TSK_LIBEWF_SRCDIR="${T}"/libewf_64bit-VisualStudio_2010
102 + popd &>/dev/null || die
103 + fi
104 +
105 + # Copy the jar files that don't exist in the tree yet
106 + if use java; then
107 + TSK_JAR_DIR="${T}/lib"
108 + mkdir "${TSK_JAR_DIR}" || die
109 + for f in ${A}; do
110 + if [[ ${f} =~ .jar$ ]]; then
111 + cp "${DISTDIR}"/"${f}" "${TSK_JAR_DIR}" || die
112 + fi
113 + done
114 + export TSK_JAR_DIR
115 + fi
116 +}
117 +
118 +tsk_prepare_libewf() {
119 + # Inlining breaks the compilation, disable it
120 + sed -e 's/LIBUNA_INLINE inline/LIBUNA_INLINE/' \
121 + -i "${TSK_LIBEWF_SRCDIR}"/libuna/libuna_inline.h || die
122 +}
123 +
124 +src_prepare() {
125 + use ewf && tsk_prepare_libewf
126 +
127 + # Do not pass '-Werror'. This is overkill for user builds.
128 + sed -e '/AM_CXXFLAGS/ s/-Werror//g' \
129 + -i tsk/util/Makefile.am \
130 + -i tsk/pool/Makefile.am || die
131 + # Remove -static from LDFLAGS because it doesn't actually create
132 + # a static binary. It confuses libtool, who then inserts rpath
133 + sed -e '/LDFLAGS/ s/-static//' \
134 + -i tools/pooltools/Makefile.am || die
135 +
136 + if use java; then
137 + pushd "${S}"/bindings/java &>/dev/null || die
138 +
139 + # Prevent "make install" from installing
140 + # jar files under /usr/share/java
141 + # We'll use the java eclasses for this
142 + # See: https://github.com/sleuthkit/sleuthkit/pull/1379
143 + sed -e '/^jar_DATA/ d;' -i Makefile.am || die
144 +
145 + java-pkg-opt-2_src_prepare
146 +
147 + popd &>/dev/null || die
148 + fi
149 +
150 + # Override the doxygen output directories
151 + if use doc; then
152 + sed -e "/^OUTPUT_DIRECTORY/ s|=.*$|= ${T}/doc|" \
153 + -i tsk/docs/Doxyfile \
154 + -i bindings/java/doxygen/Doxyfile || die
155 + fi
156 +
157 + # It's safe to call this even after java-pkg-opt-2_src_prepare
158 + # because future calls to eapply_user do nothing and return 0
159 + default
160 +
161 + eautoreconf
162 +}
163 +
164 +tsk_compile_libewf() {
165 + local myeconfargs=(
166 + --prefix=/
167 + --libdir=/lib
168 + --enable-static
169 + --disable-shared
170 + --disable-winapi
171 + --without-libbfio
172 + --with-zlib
173 + --without-bzip2
174 + --without-libhmac
175 + --without-openssl
176 + --without-libuuid
177 + --without-libfuse
178 +
179 + --with-libcstring=no
180 + --with-libcerror=no
181 + --with-libcdata=no
182 + --with-libclocale=no
183 + --with-libcnotify=no
184 + --with-libcsplit=no
185 + --with-libuna=no
186 + --with-libcfile=no
187 + --with-libcpath=no
188 + --with-libbfio=no
189 + --with-libfcache=no
190 + --with-libfvalue=no
191 +
192 + )
193 + # We want to contain our build flags
194 + local CFLAGS="${CFLAGS}"
195 + local LDFLAGS="${LDFLAGS}"
196 +
197 + pushd "${TSK_LIBEWF_SRCDIR}" &>/dev/null || die
198 +
199 + # Produce relocatable code
200 + CFLAGS+=" -fPIC"
201 + LDFLAGS+=" -fPIC"
202 + econf "${myeconfargs[@]}"
203 +
204 + # Do not waste CPU cycles on building ewftools
205 + sed -e '/ewftools/ d' -i Makefile || die
206 + emake
207 +
208 + # Only install the headers and the library
209 + emake -C libewf DESTDIR="${T}"/image install
210 + emake -C include DESTDIR="${T}"/image install
211 + find "${T}"/image -name '*.la' -delete || die
212 +
213 + popd &>/dev/null || die
214 +}
215 +
216 +src_configure() {
217 + local myeconfargs=(
218 + --enable-offline="${TSK_JAR_DIR}"
219 + $(use_enable java)
220 + $(use_enable static-libs static)
221 + $(use_enable threads multithreading)
222 + $(use_with aff afflib)
223 + $(use_with zlib)
224 + )
225 + # TODO: add support for non-existing libraries libvhdi and libvmdk
226 + # myeconfargs+=(
227 + # $(use_with vhdi libvhdi)
228 + # $(use_with vmdk libvmdk)
229 + # )
230 + myeconfargs+=(
231 + --without-libvhdi
232 + --without-libvmdk
233 + )
234 +
235 + use ewf && tsk_compile_libewf
236 + myeconfargs+=( $(use_with ewf libewf "${T}"/image) )
237 +
238 + if use java; then
239 + pushd "${S}"/bindings/java &>/dev/null || die
240 + java-ant-2_src_configure
241 + popd &>/dev/null || die
242 + fi
243 +
244 + econf "${myeconfargs[@]}"
245 +}
246 +
247 +src_compile() {
248 + # Give it an existing bogus ivy home #672220
249 + local -x IVY_HOME="${T}"
250 +
251 + # Create symlinks of jars for the required dependencies
252 + if use java; then
253 + java-pkg_jar-from --into "${TSK_JAR_DIR}" c3p0
254 + java-pkg_jar-from --into "${TSK_JAR_DIR}" commons-lang:3.6
255 + java-pkg_jar-from --into "${TSK_JAR_DIR}" commons-validator
256 + java-pkg_jar-from --into "${TSK_JAR_DIR}" gson:2.6
257 + java-pkg_jar-from --into "${TSK_JAR_DIR}" guava
258 + java-pkg_jar-from --into "${TSK_JAR_DIR}" jdbc-postgresql
259 + java-pkg_jar-from --into "${TSK_JAR_DIR}" joda-time
260 + java-pkg_jar-from --into "${TSK_JAR_DIR}" sparsebitset
261 +
262 + # case-uco needs gson and expects it under case-uco/java/lib
263 + # symlink it to the jar dir we create for java bindings
264 + ln -s "${TSK_JAR_DIR}" "${S}"/case-uco/java/lib || die
265 + ln -s ./gson.jar "${TSK_JAR_DIR}"/gson-2.8.5.jar || die
266 + fi
267 +
268 + # Create the doc output dirs if requested
269 + if use doc; then
270 + mkdir -p "${T}"/doc/{api-docs,jni-docs} || die
271 + fi
272 +
273 + emake all $(usex doc api-docs "")
274 +}
275 +
276 +src_install() {
277 + # Give it an existing bogus ivy home #756766
278 + local -x IVY_HOME="${T}"
279 + local f
280 +
281 + if use java; then
282 + pushd "${S}"/bindings/java &>/dev/null || die
283 +
284 + # Install case-uco
285 + pushd "${S}"/case-uco/java &>/dev/null || die
286 + java-pkg_newjar "dist/${PN}-caseuco-${PV}".jar "${PN}-caseuco.jar"
287 + popd || die
288 +
289 + # Install the bundled jar files as well as the
290 + # sleuthkit jar installed here by case-uco
291 + pushd "${TSK_JAR_DIR}" &>/dev/null || die
292 + for f in *; do
293 + # Skip the symlinks java-pkg_jar-from created
294 + [[ -f ${f} ]] || continue
295 +
296 + # Strip the version numbers as per eclass recommendation
297 + [[ ${f} =~ -([0-9]+\.)+jar$ ]] || continue
298 +
299 + java-pkg_newjar "${f}" "${f/${BASH_REMATCH[0]}/.jar}"
300 + done
301 + popd &>/dev/null || die
302 +
303 + popd &>/dev/null || die
304 + fi
305 +
306 + default
307 + # Default install target for case-uco installs the jar in the wrong place
308 + rm -r "${ED}"/usr/share/java
309 +
310 + # It unconditionally builds both api and jni docs
311 + # We install conditionally based on the provided use flags
312 + if use doc; then
313 + dodoc -r "${T}"/doc/api-docs
314 + use java && dodoc -r "${T}"/doc/jni-docs
315 + fi
316 +
317 + find "${D}" -name '*.la' -delete || die
318 +}
319
320 diff --git a/app-forensics/sleuthkit/sleuthkit-4.11.1-r1.ebuild b/app-forensics/sleuthkit/sleuthkit-4.11.1-r1.ebuild
321 new file mode 100644
322 index 000000000000..145498c3e809
323 --- /dev/null
324 +++ b/app-forensics/sleuthkit/sleuthkit-4.11.1-r1.ebuild
325 @@ -0,0 +1,313 @@
326 +# Copyright 1999-2022 Gentoo Authors
327 +# Distributed under the terms of the GNU General Public License v2
328 +
329 +EAPI=8
330 +
331 +JAVA_PKG_BSFIX_NAME="build.xml build-unix.xml"
332 +inherit autotools java-pkg-opt-2 java-ant-2
333 +
334 +DESCRIPTION="A collection of file system and media management forensic analysis tools"
335 +HOMEPAGE="https://www.sleuthkit.org/sleuthkit/"
336 +# TODO: sqlite-jdbc does not exist in the tree, we bundle it for now
337 +# See: https://bugs.gentoo.org/690010
338 +# TODO: Upstream uses a very specific version of libewf which is not in
339 +# the tree anymore. So we statically compile and link to sleuthkit.
340 +# Hopefully upstream will figure something out in the future.
341 +# See: https://bugs.gentoo.org/689752
342 +SRC_URI="https://github.com/${PN}/${PN}/releases/download/${P}/${P}.tar.gz
343 + java? (
344 + http://repo1.maven.org/maven2/org/xerial/sqlite-jdbc/3.25.2/sqlite-jdbc-3.25.2.jar
345 + )
346 + ewf? ( https://github.com/sleuthkit/libewf_64bit/archive/VisualStudio_2010.tar.gz -> sleuthkit-libewf_64bit-20130416.tar.gz )"
347 +
348 +LICENSE="BSD CPL-1.0 GPL-2+ IBM java? ( Apache-2.0 )"
349 +SLOT="0/19" # subslot = major soname version
350 +KEYWORDS="~amd64 ~hppa ~ppc ~x86"
351 +IUSE="aff doc ewf java static-libs test +threads zlib"
352 +RESTRICT="!test? ( test )"
353 +
354 +DEPEND="
355 + dev-db/sqlite:3
356 + dev-lang/perl:*
357 + aff? ( app-forensics/afflib )
358 + ewf? ( sys-libs/zlib )
359 + java? (
360 + >=dev-java/c3p0-0.9.5:0
361 + dev-java/commons-lang:3.6
362 + >=dev-java/commons-validator-1.6:0
363 + >=dev-java/gson-2.8.5:2.6
364 + dev-java/guava:0
365 + >=dev-java/jdbc-postgresql-9.4:0
366 + >=dev-java/joda-time-2.4:0
367 + dev-java/sparsebitset:0
368 + )
369 + zlib? ( sys-libs/zlib )
370 +"
371 +# TODO: add support for not-in-tree libraries libvhdi and libvmdk
372 +# libvhdi: https://github.com/libyal/libvhdi
373 +# libvmdk: https://github.com/libyal/libvmdk
374 +# DEPEND="${DEPEND}
375 +# vhdi? ( dev-libs/libvhdi )
376 +# vmdk? ( dev-libs/libvmdk )
377 +# "
378 +
379 +RDEPEND="${DEPEND}
380 + java? ( virtual/jre:1.8 )
381 +"
382 +DEPEND="${DEPEND}
383 + java? ( virtual/jdk:1.8 )
384 + test? (
385 + >=dev-util/cppunit-1.2.1
386 + )
387 +"
388 +BDEPEND="
389 + virtual/pkgconfig
390 + doc? ( app-doc/doxygen )
391 +"
392 +
393 +PATCHES=(
394 + "${FILESDIR}"/${PN}-4.1.0-tools-shared-libs.patch
395 + "${FILESDIR}"/${PN}-4.6.4-default-jar-location-fix.patch
396 + "${FILESDIR}"/${PN}-4.10.1-exclude-usr-local.patch
397 +)
398 +
399 +src_unpack() {
400 + local f
401 +
402 + unpack ${P}.tar.gz
403 +
404 + if use ewf; then
405 + pushd "${T}" &>/dev/null || die
406 + unpack sleuthkit-libewf_64bit-20130416.tar.gz
407 + export TSK_LIBEWF_SRCDIR="${T}"/libewf_64bit-VisualStudio_2010
408 + popd &>/dev/null || die
409 + fi
410 +
411 + # Copy the jar files that don't exist in the tree yet
412 + if use java; then
413 + TSK_JAR_DIR="${T}/lib"
414 + mkdir "${TSK_JAR_DIR}" || die
415 + for f in ${A}; do
416 + if [[ ${f} =~ .jar$ ]]; then
417 + cp "${DISTDIR}"/"${f}" "${TSK_JAR_DIR}" || die
418 + fi
419 + done
420 + export TSK_JAR_DIR
421 + fi
422 +}
423 +
424 +tsk_prepare_libewf() {
425 + # Inlining breaks the compilation, disable it
426 + sed -e 's/LIBUNA_INLINE inline/LIBUNA_INLINE/' \
427 + -i "${TSK_LIBEWF_SRCDIR}"/libuna/libuna_inline.h || die
428 +}
429 +
430 +src_prepare() {
431 + use ewf && tsk_prepare_libewf
432 +
433 + # Do not pass '-Werror'. This is overkill for user builds.
434 + sed -e '/AM_CXXFLAGS/ s/-Werror//g' \
435 + -i tsk/util/Makefile.am \
436 + -i tsk/pool/Makefile.am || die
437 + # Remove -static from LDFLAGS because it doesn't actually create
438 + # a static binary. It confuses libtool, who then inserts rpath
439 + sed -e '/LDFLAGS/ s/-static//' \
440 + -i tools/pooltools/Makefile.am || die
441 +
442 + if use java; then
443 + pushd "${S}"/bindings/java &>/dev/null || die
444 +
445 + # Prevent "make install" from installing
446 + # jar files under /usr/share/java
447 + # We'll use the java eclasses for this
448 + # See: https://github.com/sleuthkit/sleuthkit/pull/1379
449 + sed -e '/^jar_DATA/ d;' -i Makefile.am || die
450 +
451 + java-pkg-opt-2_src_prepare
452 +
453 + popd &>/dev/null || die
454 +
455 + # Call ant with jar target for case-uco.
456 + # The default invocation of ant tries to
457 + # run junit tests, which there are none.
458 + # It ends up failing with:
459 + # junit.framework.AssertionFailedError: No tests found in org.sleuthkit.caseuco.TestSuite
460 + sed -e '/\tant \$(ant_args)/ s|$| jar|' \
461 + -i "${S}"/case-uco/java/Makefile.am \
462 + || die
463 + fi
464 +
465 + # Override the doxygen output directories
466 + if use doc; then
467 + sed -e "/^OUTPUT_DIRECTORY/ s|=.*$|= ${T}/doc|" \
468 + -i tsk/docs/Doxyfile \
469 + -i bindings/java/doxygen/Doxyfile || die
470 + fi
471 +
472 + # It's safe to call this even after java-pkg-opt-2_src_prepare
473 + # because future calls to eapply_user do nothing and return 0
474 + default
475 +
476 + eautoreconf
477 +}
478 +
479 +tsk_compile_libewf() {
480 + local myeconfargs=(
481 + --prefix=/
482 + --libdir=/lib
483 + --enable-static
484 + --disable-shared
485 + --disable-winapi
486 + --without-libbfio
487 + --with-zlib
488 + --without-bzip2
489 + --without-libhmac
490 + --without-openssl
491 + --without-libuuid
492 + --without-libfuse
493 +
494 + --with-libcstring=no
495 + --with-libcerror=no
496 + --with-libcdata=no
497 + --with-libclocale=no
498 + --with-libcnotify=no
499 + --with-libcsplit=no
500 + --with-libuna=no
501 + --with-libcfile=no
502 + --with-libcpath=no
503 + --with-libbfio=no
504 + --with-libfcache=no
505 + --with-libfvalue=no
506 +
507 + )
508 + # We want to contain our build flags
509 + local CFLAGS="${CFLAGS}"
510 + local LDFLAGS="${LDFLAGS}"
511 +
512 + pushd "${TSK_LIBEWF_SRCDIR}" &>/dev/null || die
513 +
514 + # Produce relocatable code
515 + CFLAGS+=" -fPIC"
516 + LDFLAGS+=" -fPIC"
517 + econf "${myeconfargs[@]}"
518 +
519 + # Do not waste CPU cycles on building ewftools
520 + sed -e '/ewftools/ d' -i Makefile || die
521 + emake
522 +
523 + # Only install the headers and the library
524 + emake -C libewf DESTDIR="${T}"/image install
525 + emake -C include DESTDIR="${T}"/image install
526 + find "${T}"/image -name '*.la' -delete || die
527 +
528 + popd &>/dev/null || die
529 +}
530 +
531 +src_configure() {
532 + local myeconfargs=(
533 + --enable-offline="${TSK_JAR_DIR}"
534 + $(use_enable java)
535 + $(use_enable static-libs static)
536 + $(use_enable test cppunit)
537 + $(use_enable threads multithreading)
538 + $(use_with aff afflib)
539 + $(use_with zlib)
540 + )
541 + # TODO: add support for non-existing libraries libvhdi and libvmdk
542 + # myeconfargs+=(
543 + # $(use_with vhdi libvhdi)
544 + # $(use_with vmdk libvmdk)
545 + # )
546 + myeconfargs+=(
547 + --without-libvhdi
548 + --without-libvmdk
549 + )
550 +
551 + use ewf && tsk_compile_libewf
552 + myeconfargs+=( $(use_with ewf libewf "${T}"/image) )
553 +
554 + if use java; then
555 + pushd "${S}"/bindings/java &>/dev/null || die
556 + java-ant-2_src_configure
557 + popd &>/dev/null || die
558 + fi
559 +
560 + econf "${myeconfargs[@]}"
561 +}
562 +
563 +src_compile() {
564 + # Give it an existing bogus ivy home #672220
565 + local -x IVY_HOME="${T}"
566 +
567 + # Create symlinks of jars for the required dependencies
568 + if use java; then
569 + java-pkg_jar-from --into "${TSK_JAR_DIR}" c3p0
570 + java-pkg_jar-from --into "${TSK_JAR_DIR}" commons-lang:3.6
571 + java-pkg_jar-from --into "${TSK_JAR_DIR}" commons-validator
572 + java-pkg_jar-from --into "${TSK_JAR_DIR}" gson:2.6
573 + java-pkg_jar-from --into "${TSK_JAR_DIR}" guava
574 + java-pkg_jar-from --into "${TSK_JAR_DIR}" jdbc-postgresql
575 + java-pkg_jar-from --into "${TSK_JAR_DIR}" joda-time
576 + java-pkg_jar-from --into "${TSK_JAR_DIR}" sparsebitset
577 +
578 + # case-uco needs gson and expects it under case-uco/java/lib
579 + # symlink it to the jar dir we create for java bindings
580 + ln -s "${TSK_JAR_DIR}" "${S}"/case-uco/java/lib || die
581 + ln -s ./gson.jar "${TSK_JAR_DIR}"/gson-2.8.5.jar || die
582 + fi
583 +
584 + # Create the doc output dirs if requested
585 + if use doc; then
586 + mkdir -p "${T}"/doc/{api-docs,jni-docs} || die
587 + fi
588 +
589 + emake all $(usex doc api-docs "")
590 +}
591 +
592 +src_install() {
593 + # Give it an existing bogus ivy home #756766
594 + local -x IVY_HOME="${T}"
595 + local f
596 +
597 + if use java; then
598 + pushd "${S}"/bindings/java &>/dev/null || die
599 +
600 + # Install case-uco
601 + pushd "${S}"/case-uco/java &>/dev/null || die
602 + java-pkg_newjar "dist/${PN}-caseuco-${PV}".jar "${PN}-caseuco.jar"
603 + popd || die
604 +
605 + # Install the bundled jar files as well as the
606 + # sleuthkit jar installed here by case-uco
607 + pushd "${TSK_JAR_DIR}" &>/dev/null || die
608 + for f in *; do
609 + # Skip the symlinks java-pkg_jar-from created
610 + [[ -L ${f} ]] && continue
611 +
612 + # Strip the version numbers as per eclass recommendation
613 + [[ ${f} =~ -([0-9]+\.)+jar$ ]] || continue
614 +
615 + java-pkg_newjar "${f}" "${f/${BASH_REMATCH[0]}/.jar}"
616 + done
617 + popd &>/dev/null || die
618 +
619 + popd &>/dev/null || die
620 + fi
621 +
622 + default
623 + # Default install target for case-uco installs the jar in the wrong place
624 + rm -r "${ED}"/usr/share/java
625 +
626 + # It unconditionally builds both api and jni docs
627 + # We install conditionally based on the provided use flags
628 + if use doc; then
629 + dodoc -r "${T}"/doc/api-docs
630 + use java && dodoc -r "${T}"/doc/jni-docs
631 + fi
632 +
633 + find "${D}" -name '*.la' -delete || die
634 +}
635 +
636 +src_test() {
637 + emake -C "${S}"/unit_tests check
638 +}