app-forensics/sleuthkit: bump to 4.6.5
authorGöktürk Yüksek <gokturk@gentoo.org>
Thu, 24 Jan 2019 19:44:24 +0000 (14:44 -0500)
committerGöktürk Yüksek <gokturk@gentoo.org>
Thu, 24 Jan 2019 20:17:39 +0000 (15:17 -0500)
Also addresses CVE-2018-19497.

Bug: https://bugs.gentoo.org/661160
Package-Manager: Portage-2.3.52, Repoman-2.3.12
Signed-off-by: Göktürk Yüksek <gokturk@gentoo.org>
app-forensics/sleuthkit/Manifest
app-forensics/sleuthkit/sleuthkit-4.6.5.ebuild [new file with mode: 0644]

index 9b98215a04a329d06e3216c2036211d1340a6497..281da89a45bdcc05e5afcec32043c884fde50ea0 100644 (file)
@@ -3,4 +3,5 @@ DIST libewf-20130128.tar.gz 1978794 BLAKE2B e5d2bd8f4a8b878e13536b89b032d8cee698
 DIST sleuthkit-4.5.0.tar.gz 8611141 BLAKE2B a1ae66bfcb74ce1fec24f80dfe60cd68f1de53119331c38848f7f82de8052eda49d78fdea49e42ada5843094939ef212dece42a5ceb85931a79e02adccda30e6 SHA512 911890cacca739f121681514197104cb2dc3bd219f3e068c4ce61264498c56989359976fc75172e1f456c94e4e25c6206413b0234c36e55736a577b8e664e4b3
 DIST sleuthkit-4.6.0.tar.gz 8634432 BLAKE2B b45721cdee798d84f0caa0bfe38645346539bb497f5a492c72016a6b3b0246b362ecea676a7a0e788d66cc0dc32335e719912434bd61aa205b7d51b8d4bd7c14 SHA512 dbf880e8503dccb0a686f1d9658d56e9cb40f452127f9b713cf2a4941f4083fa1cf80a886994d58421307a679242cd4ee005b3e874cf429cfb140a597a0dc739
 DIST sleuthkit-4.6.4.tar.gz 8655341 BLAKE2B 9d8a2884d1c90e9be3104221c22fdc4346c8f288a13384ef8205cea46bbda2249691b548b7d19a1b34d6d0d1fc6d5390aa0fc8c8b28ea75b53de946b62c8e25c SHA512 0dd3fc3659fd6dee49ababd8033bcc5ce218c9154b61eb072a943e8d1a96fb04dcabc85124583bc69ad0ced2609fed11812164a3db6587446255a9c507f08762
+DIST sleuthkit-4.6.5.tar.gz 8658866 BLAKE2B 29b75c96a14c5d42522e7116a80cc368c8097fa43af27c0e958215142d6ee61131c7b154fb876fa3ea9c727e8100de9bd703dfd8cef9ccce1f6602222c8470fa SHA512 ba21be166da1a7bdd197946722a1e0947f90bbb2c27d635cdfbcbc870aa42937fe6b42f432482f70a5e686942c8891d0367b5ce28615315d8905661e73aefe32
 DIST sqlite-jdbc-3.8.11.jar 5131732 BLAKE2B 1a04fa9e9cb97fdddc19af2de9efa7b54c0b527642e6e325e31054e4e294e3bc6af00ea291087ed9dd26668d48dae356035fc85212c0eb81656550d552103ed0 SHA512 5f4705101992e8916e29742c560aef0d01eba9dc0d2d984b75a77e56be3c9fd20b284390fe8f9bb54bf9d1f8528c3413922684c446212ca8961ac731543fb179
diff --git a/app-forensics/sleuthkit/sleuthkit-4.6.5.ebuild b/app-forensics/sleuthkit/sleuthkit-4.6.5.ebuild
new file mode 100644 (file)
index 0000000..7acead6
--- /dev/null
@@ -0,0 +1,255 @@
+# Copyright 1999-2019 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
+# 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.
+SRC_URI="https://github.com/${PN}/${PN}/releases/download/${P}/${P}.tar.gz
+       java? (
+               http://repo1.maven.org/maven2/org/xerial/sqlite-jdbc/3.8.11/sqlite-jdbc-3.8.11.jar
+               http://repo1.maven.org/maven2/com/zaxxer/SparseBitSet/1.1/SparseBitSet-1.1.jar
+       )
+       ewf? ( https://dev.gentoo.org/~gokturk/distfiles/app-forensics/libewf/libewf-20130128.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"
+
+# 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? (
+               >=virtual/jdk-1.8:*
+               >=dev-java/c3p0-0.9.5:0
+               >=dev-java/jdbc-postgresql-9.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:= )
+"
+DEPEND="${DEPEND}
+       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
+
+       # Ick, the upstream is stuck at libewf-20130128 which is
+       # not even in the tree anymore. So we have to bundle it.
+       if use ewf; then
+               pushd "${T}" &>/dev/null || die
+               unpack libewf-20130128.tar.gz
+               export TSK_LIBEWF_SRCDIR="${T}"/libewf-20130128
+               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() {
+       # Yeah, libewf-20130128 obviously doesn't just nicely compile
+       sed -e 's/LIBUNA_INLINE inline/LIBUNA_INLINE/' \
+               -i "${TSK_LIBEWF_SRCDIR}"/libuna/libuna_inline.h || die
+}
+
+src_prepare() {
+       use ewf && tsk_prepare_libewf
+
+       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
+               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
+       )
+       # 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}" jdbc-postgresql
+
+               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
+}