public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Miroslav Šulc" <fordfrog@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-forensics/sleuthkit/
Date: Wed, 23 Jun 2021 08:13:10 +0000 (UTC)	[thread overview]
Message-ID: <1624435980.1f182a6955605f0ef6cdab76e682bdc9a2056077.fordfrog@gentoo> (raw)

commit:     1f182a6955605f0ef6cdab76e682bdc9a2056077
Author:     Volkmar W. Pogatzki <gentoo <AT> pogatzki <DOT> net>
AuthorDate: Tue Jun 15 07:24:24 2021 +0000
Commit:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Wed Jun 23 08:13:00 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1f182a69

app-forensics/sleuthkit: v 4.9.0-r1 switch

Bug: https://bugs.gentoo.org/784026

Package-Manager: Portage-3.0.18, Repoman-3.0.2
Signed-off-by: Volkmar W. Pogatzki <gentoo <AT> pogatzki.net>
Closes: https://github.com/gentoo/gentoo/pull/21245/commits/6f2b8416d60df1f5ba4c4503f2936afc01e812f3
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>

 app-forensics/sleuthkit/sleuthkit-4.9.0-r1.ebuild | 303 ++++++++++++++++++++++
 1 file changed, 303 insertions(+)

diff --git a/app-forensics/sleuthkit/sleuthkit-4.9.0-r1.ebuild b/app-forensics/sleuthkit/sleuthkit-4.9.0-r1.ebuild
new file mode 100644
index 00000000000..376076bbef9
--- /dev/null
+++ b/app-forensics/sleuthkit/sleuthkit-4.9.0-r1.ebuild
@@ -0,0 +1,303 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+JAVA_PKG_BSFIX_NAME="build.xml build-unix.xml"
+inherit autotools java-pkg-opt-2 java-ant-2
+
+DESCRIPTION="A collection of file system and media management forensic analysis tools"
+HOMEPAGE="https://www.sleuthkit.org/sleuthkit/"
+# TODO: sqlite-jdbc does not exist in the tree, we bundle it for now
+#		See: https://bugs.gentoo.org/690010
+# TODO: SparseBitSet does not exist in the tree, we bundle it for now
+#		See: https://bugs.gentoo.org/690012
+# TODO: Upstream uses a very specific version of libewf which is not in
+#       the tree anymore. So we statically compile and link to sleuthkit.
+#       Hopefully upstream will figure something out in the future.
+#		See: https://bugs.gentoo.org/689752
+# TODO: gson-2.8.5 does not exist in the tree. Building it seems to
+# 		require Java 9. We have Java 11 in the tree but I don't see a
+# 		way to use it as a gentoo-vm in order to build gson. Sleuthkit
+# 		upstream still uses Java 8.
+# 		See: https://bugs.gentoo.org/706274
+# TODO: commons-validator-1.6 does not exist in the tree. The latest version
+#		as of writing this ebuild is 1.4.1, for which the build fails. As
+#		per #711930, this is a security sensitive bump. We're gonna fetch
+#		the jar file here and file a bug request for a bump as well:
+#		    https://bugs.gentoo.org/721020
+SRC_URI="https://github.com/${PN}/${PN}/releases/download/${P}/${P}.tar.gz
+	java? (
+		https://repo1.maven.org/maven2/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar
+		http://repo1.maven.org/maven2/org/xerial/sqlite-jdbc/3.25.2/sqlite-jdbc-3.25.2.jar
+		http://repo1.maven.org/maven2/com/zaxxer/SparseBitSet/1.1/SparseBitSet-1.1.jar
+		https://repo1.maven.org/maven2/commons-validator/commons-validator/1.6/commons-validator-1.6.jar
+	)
+	ewf? ( https://github.com/sleuthkit/libewf_64bit/archive/VisualStudio_2010.tar.gz -> sleuthkit-libewf_64bit-20130416.tar.gz )"
+
+LICENSE="BSD CPL-1.0 GPL-2+ IBM java? ( Apache-2.0 )"
+SLOT="0/13" # subslot = major soname version
+KEYWORDS="~amd64 ~hppa ~ppc ~x86"
+IUSE="aff doc ewf java postgres static-libs test +threads zlib"
+RESTRICT="!test? ( test )"
+
+#
+# Note: It is not possible to move the dep on dev-java/jdbc-postgresql
+# inside a conditional postgres? block because java sources import
+# org.postgres unconditionally as of writing this (version 4.6.4). The
+# postgres USE flag will be used for the TSK postgresql support however.
+#
+DEPEND="
+	dev-db/sqlite:3
+	dev-lang/perl:*
+	aff? ( app-forensics/afflib )
+	ewf? ( sys-libs/zlib )
+	java? (
+		>=dev-java/c3p0-0.9.5:0
+		dev-java/commons-lang:3.6
+		dev-java/guava:20
+		>=dev-java/jdbc-postgresql-9.4:0
+		>=dev-java/joda-time-2.4:0
+	)
+	postgres? ( dev-db/postgresql:= )
+	zlib? ( sys-libs/zlib )
+"
+# TODO: add support for not-in-tree libraries libvhdi and libvmdk
+# libvhdi: https://github.com/libyal/libvhdi
+# libvmdk: https://github.com/libyal/libvmdk
+# DEPEND="${DEPEND}
+# 	vhdi? ( dev-libs/libvhdi )
+# 	vmdk? ( dev-libs/libvmdk )
+# "
+
+RDEPEND="${DEPEND}
+	java? (
+		|| (
+			virtual/jre:1.8
+			virtual/jdk:1.8
+		)
+	)
+"
+DEPEND="${DEPEND}
+	java? ( virtual/jdk:1.8 )
+	doc? ( app-doc/doxygen )
+	test? ( >=dev-util/cppunit-1.2.1 )
+"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-4.1.0-tools-shared-libs.patch
+	"${FILESDIR}"/${PN}-4.6.4-default-jar-location-fix.patch
+)
+
+src_unpack() {
+	local f
+
+	unpack ${P}.tar.gz
+
+	if use ewf; then
+		pushd "${T}" &>/dev/null || die
+		unpack sleuthkit-libewf_64bit-20130416.tar.gz
+		export TSK_LIBEWF_SRCDIR="${T}"/libewf_64bit-VisualStudio_2010
+		popd &>/dev/null || die
+	fi
+
+	# Copy the jar files that don't exist in the tree yet
+	if use java; then
+		TSK_JAR_DIR="${T}/lib"
+		mkdir "${TSK_JAR_DIR}" || die
+		for f in ${A}; do
+			if [[ ${f} =~ .jar$ ]]; then
+				cp "${DISTDIR}"/"${f}" "${TSK_JAR_DIR}" || die
+			fi
+		done
+		export TSK_JAR_DIR
+	fi
+}
+
+tsk_prepare_libewf() {
+	# Inlining breaks the compilation, disable it
+	sed -e 's/LIBUNA_INLINE inline/LIBUNA_INLINE/' \
+		-i "${TSK_LIBEWF_SRCDIR}"/libuna/libuna_inline.h || die
+}
+
+src_prepare() {
+	use ewf && tsk_prepare_libewf
+
+	# Do not pass '-Werror'. This is overkill for user builds.
+	sed -e '/AM_CXXFLAGS/ s/-Werror//g' \
+		-i tsk/util/Makefile.am \
+		-i tsk/pool/Makefile.am || die
+
+	if use java; then
+		pushd "${S}"/bindings/java &>/dev/null || die
+
+		# Prevent "make install" from installing
+		# jar files under /usr/share/java
+		# We'll use the java eclasses for this
+		# See: https://github.com/sleuthkit/sleuthkit/pull/1379
+		sed -e '/^jar_DATA/ d;' -i Makefile.am || die
+
+		java-pkg-opt-2_src_prepare
+
+		popd &>/dev/null || die
+	fi
+
+	# Override the doxygen output directories
+	if use doc; then
+		sed -e "/^OUTPUT_DIRECTORY/ s|=.*$|= ${T}/doc|" \
+			-i tsk/docs/Doxyfile \
+			-i bindings/java/doxygen/Doxyfile || die
+	fi
+
+	# It's safe to call this even after java-pkg-opt-2_src_prepare
+	# because future calls to eapply_user do nothing and return 0
+	default
+
+	eautoreconf
+}
+
+tsk_compile_libewf() {
+	local myeconfargs=(
+		--prefix=/
+		--libdir=/lib
+		--enable-static
+		--disable-shared
+		--disable-winapi
+		--without-libbfio
+		--with-zlib
+		--without-bzip2
+		--without-libhmac
+		--without-openssl
+		--without-libuuid
+		--without-libfuse
+
+		--with-libcstring=no
+		--with-libcerror=no
+		--with-libcdata=no
+		--with-libclocale=no
+		--with-libcnotify=no
+		--with-libcsplit=no
+		--with-libuna=no
+		--with-libcfile=no
+		--with-libcpath=no
+		--with-libbfio=no
+		--with-libfcache=no
+		--with-libfvalue=no
+
+	)
+	# We want to contain our build flags
+	local CFLAGS="${CFLAGS}"
+	local LDFLAGS="${LDFLAGS}"
+
+	pushd "${TSK_LIBEWF_SRCDIR}" &>/dev/null || die
+
+	# Produce relocatable code
+	CFLAGS+=" -fPIC"
+	LDFLAGS+=" -fPIC"
+	econf "${myeconfargs[@]}"
+
+	# Do not waste CPU cycles on building ewftools
+	sed -e '/ewftools/ d' -i Makefile || die
+	emake
+
+	# Only install the headers and the library
+	emake -C libewf DESTDIR="${T}"/image install
+	emake -C include DESTDIR="${T}"/image install
+	find "${T}"/image -name '*.la' -delete || die
+
+	popd &>/dev/null || die
+}
+
+src_configure() {
+	local myeconfargs=(
+		--enable-offline="${TSK_JAR_DIR}"
+		$(use_enable java)
+		$(use_enable static-libs static)
+		$(use_enable threads multithreading)
+		$(use_with aff afflib)
+		$(use_with zlib)
+	)
+	# Workaround the automagic detection of postgresql
+	local -x ac_cv_lib_pq_PQlibVersion="$(usex postgres)"
+	# TODO: add support for non-existing libraries libvhdi and libvmdk
+	# myeconfargs+=(
+	# 	$(use_with vhdi libvhdi)
+	# 	$(use_with vmdk libvmdk)
+	# )
+	myeconfargs+=(
+		--without-libvhdi
+		--without-libvmdk
+	)
+
+	use ewf && tsk_compile_libewf
+	myeconfargs+=( $(use_with ewf libewf "${T}"/image) )
+
+	if use java; then
+		pushd "${S}"/bindings/java &>/dev/null || die
+		java-ant-2_src_configure
+		popd &>/dev/null || die
+	fi
+
+	econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+	# Give it an existing bogus ivy home #672220
+	local -x IVY_HOME="${T}"
+
+	# Create symlinks of jars for the required dependencies
+	if use java; then
+		pushd "${S}"/bindings/java &>/dev/null || die
+
+		java-pkg_jar-from --into "${TSK_JAR_DIR}" c3p0
+		java-pkg_jar-from --into "${TSK_JAR_DIR}" commons-lang:3.6
+		java-pkg_jar-from --into "${TSK_JAR_DIR}" guava:20
+		java-pkg_jar-from --into "${TSK_JAR_DIR}" jdbc-postgresql
+		java-pkg_jar-from --into "${TSK_JAR_DIR}" joda-time
+
+		popd &>/dev/null || die
+	fi
+
+	# Create the doc output dirs if requested
+	if use doc; then
+		mkdir -p "${T}"/doc/{api-docs,jni-docs} || die
+	fi
+
+	emake all $(usex doc api-docs "")
+}
+
+src_install() {
+	local f
+
+	if use java; then
+		pushd "${S}"/bindings/java &>/dev/null || die
+
+		java-pkg_newjar "dist/${P}.jar" "${PN}.jar"
+
+		# Install the bundled jar files
+		pushd "${TSK_JAR_DIR}" &>/dev/null || die
+		for f in *; do
+			# Skip the symlinks java-pkg_jar-from created
+			[[ -f ${f} ]] || continue
+
+			# Strip the version numbers as per eclass recommendation
+			[[ ${f} =~ -([0-9]+\.)+jar$ ]] || continue
+
+			java-pkg_newjar "${f}" "${f/${BASH_REMATCH[0]}/.jar}"
+		done
+		popd &>/dev/null || die
+
+		popd &>/dev/null || die
+	fi
+
+	default
+
+	# It unconditionally builds both api and jni docs
+	# We install conditionally based on the provided use flags
+	if use doc; then
+		dodoc -r "${T}"/doc/api-docs
+		use java && dodoc -r "${T}"/doc/jni-docs
+	fi
+
+	find "${D}" -name '*.la' -delete || die
+}


             reply	other threads:[~2021-06-23  8:13 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-23  8:13 Miroslav Šulc [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-09-11 17:47 [gentoo-commits] repo/gentoo:master commit in: app-forensics/sleuthkit/ Arthur Zamarin
2024-09-11 14:15 Sam James
2024-09-05 12:22 Sam James
2024-09-05 12:22 Sam James
2024-08-05  7:26 Göktürk Yüksek
2024-08-05  7:19 Göktürk Yüksek
2024-07-30 23:44 Jakov Smolić
2024-07-30 18:00 Arthur Zamarin
2024-07-30 18:00 Arthur Zamarin
2024-01-07  7:52 Göktürk Yüksek
2023-06-27  4:11 Göktürk Yüksek
2023-06-27  4:11 Göktürk Yüksek
2022-09-07  6:51 Jakov Smolić
2022-09-06 12:51 Agostino Sarubbo
2022-09-06 12:50 Agostino Sarubbo
2022-06-09  6:45 Sam James
2022-06-08  8:46 Agostino Sarubbo
2022-06-08  8:44 Agostino Sarubbo
2022-06-08  8:42 Agostino Sarubbo
2022-05-09 18:58 Florian Schmaus
2022-05-09 18:58 Florian Schmaus
2022-05-09 18:58 Florian Schmaus
2022-02-16  2:53 Göktürk Yüksek
2021-08-11  6:43 Agostino Sarubbo
2021-08-10 15:36 Agostino Sarubbo
2021-08-10  6:42 Agostino Sarubbo
2021-08-09 23:53 Göktürk Yüksek
2021-08-09 23:16 Göktürk Yüksek
2021-08-09 23:16 Göktürk Yüksek
2021-08-09 23:16 Göktürk Yüksek
2021-06-23 15:41 Göktürk Yüksek
2021-06-23  8:13 Miroslav Šulc
2021-06-23  8:13 Miroslav Šulc
2021-06-23  8:13 Miroslav Šulc
2021-06-23  8:13 Miroslav Šulc
2020-11-26  3:26 Göktürk Yüksek
2020-11-25  2:29 Göktürk Yüksek
2020-06-20  1:11 Aaron Bauman
2020-06-18  2:46 Aaron Bauman
2020-06-09 13:53 Agostino Sarubbo
2020-06-09 13:49 Agostino Sarubbo
2020-06-09 13:45 Agostino Sarubbo
2020-05-09 19:43 Sergei Trofimovich
2020-05-06  0:51 Göktürk Yüksek
2020-05-06  0:07 Göktürk Yüksek
2020-01-25  0:54 Göktürk Yüksek
2019-10-15 23:21 Göktürk Yüksek
2019-08-05  4:43 Göktürk Yüksek
2019-08-05  4:43 Göktürk Yüksek
2019-06-05  0:02 Göktürk Yüksek
2019-01-24 20:18 Göktürk Yüksek
2018-12-19 17:08 Göktürk Yüksek
2018-11-29 18:00 Göktürk Yüksek
2018-04-22 19:18 Matt Turner
2018-04-04 11:24 Göktürk Yüksek
2018-03-03 22:16 Sergei Trofimovich
2017-11-29 18:52 Thomas Deutschmann
2017-11-29 11:19 Agostino Sarubbo
2017-11-09  0:06 Göktürk Yüksek
2017-11-08 23:56 Göktürk Yüksek
2017-11-08 23:53 Göktürk Yüksek
2017-08-16 22:53 Göktürk Yüksek
2017-08-16  3:07 Göktürk Yüksek
2017-08-16  3:07 Göktürk Yüksek
2017-08-11 17:38 Michał Górny
2015-08-28  0:14 Manuel Rüger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1624435980.1f182a6955605f0ef6cdab76e682bdc9a2056077.fordfrog@gentoo \
    --to=fordfrog@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox