diff --git a/bindings/java/Makefile.am b/bindings/java/Makefile.am index 9bb1c374a9f0c62a0f5ca66923c45b1fcf2630f3..ad27526edaf40d1ead0b16f3ef2ccde7f2c137a1 100644 --- a/bindings/java/Makefile.am +++ b/bindings/java/Makefile.am @@ -5,10 +5,17 @@ tsk_jar = $(top_builddir)/bindings/java/dist/sleuthkit-$(PACKAGE_VERSION).jar jardir = $(prefix)/share/java jar_DATA = $(tsk_jar) +if OFFLINE + ant_args=-Doffline=true +else + +endif + + $(tsk_jar): all-local: - ant dist + ant dist $(ant_args) CLEANFILES = $(tsk_jar) diff --git a/bindings/java/README.txt b/bindings/java/README.txt index b347f2b58fe72c141b3217fefc39e09b708c5b90..2e19856518c82151224d703e6f6502a22298071b 100644 --- a/bindings/java/README.txt +++ b/bindings/java/README.txt @@ -13,6 +13,11 @@ To use the Java bindings, you must have the Sleuth Kit datamodel JAR file compiled and have compiled the associated dynamic library from the C/C++ code. +The following jar files must be on the classpath. Version details can be found in ivy.xml. +- sqlite-jdbc +- postgresql-jdbc +- c3p0 + Requirements: * Java JDK * Ant diff --git a/bindings/java/build-unix.xml b/bindings/java/build-unix.xml index d7e80acd911736387ab9a412302689a129357c2a..84d2c84addf8e2edbd070d01115008972fc3bdfd 100644 --- a/bindings/java/build-unix.xml +++ b/bindings/java/build-unix.xml @@ -1,26 +1,22 @@ <?xml version="1.0" encoding="windows-1252"?> <project name="TSKTestTargets"> <property name="dlls" value="../../win32/x64/Release_PostgreSQL"/> - <property environment="env"/> + <property environment="env"/> - <target name="test" - description="Performs regression tests." - depends="compile-test, copyTSKLibs"> + <target name="test" description="Performs regression tests." depends="compile-test, copyTSKLibs"> <junit fork="on" haltonfailure="yes" dir="."> <env key="path" value="${env.Path}:${dlls}"/> <sysproperty key="rslt" value="${test-results}"/> <sysproperty key="gold" value="${test-standards}"/> <sysproperty key="inpt" value="${test-input}"/> - <classpath refid="libraries" /> - <formatter type="plain" usefile="false" /> - <test name="org.sleuthkit.datamodel.DataModelTestSuite" /> + <classpath refid="libraries"/> + <formatter type="plain" usefile="false"/> + <test name="org.sleuthkit.datamodel.DataModelTestSuite"/> </junit> </target> - <target name="test-rebuild" - description="Rebuilds regression tests." - depends="compile-test, copyTSKLibs"> - <java classname="org.sleuthkit.datamodel.DataModelTestSuite" classpathref="libraries" fork="true" failonerror="true"> + <target name="test-rebuild" description="Rebuilds regression tests." depends="compile-test, copyTSKLibs"> + <java classname="org.sleuthkit.datamodel.DataModelTestSuite" classpathref="libraries" fork="true" failonerror="true"> <sysproperty key="gold" value="${test-standards}"/> <sysproperty key="inpt" value="${test-input}"/> <sysproperty key="types" value="${test-types}"/> @@ -30,57 +26,57 @@ <target name="check-native-build" depends="check-native-build-mac,check-native-build-unix"/> <target name="check-native-build-mac" depends="testTSKLibs" if="tsk_dylib.present"> - <uptodate property="native-up-to-date" srcfile="./jni/.libs/libtsk_jni.dylib" - targetfile="${amd64}/mac/libtsk_jni.jnilib" /> + <uptodate property="native-up-to-date" srcfile="./jni/.libs/libtsk_jni.dylib" targetfile="${amd64}/mac/libtsk_jni.jnilib"/> </target> <target name="check-native-build-unix" depends="testTSKLibs" if="tsk_so.present"> - <uptodate property="native-up-to-date" srcfile="./jni/.libs/libtsk_jni.so" - targetfile="${amd64}/linux/libtsk_jni.so"/> + <uptodate property="native-up-to-date" srcfile="./jni/.libs/libtsk_jni.so" targetfile="${amd64}/linux/libtsk_jni.so"/> </target> - <target name="testTSKLibs"> - <property environment="env"/> - <available file="./jni/.libs/libtsk_jni.dylib" property="tsk_dylib.present"/> - <available file="./jni/.libs/libtsk_jni.so" property="tsk_so.present"/> - <fail message="JNI native library not built."> - <condition> - <not><or> - <isset property="tsk_dylib.present"/> - <isset property="tsk_so.present"/> - </or></not> - </condition> - </fail> - <!-- Default location to find zlib and libewf. Overwritten by properties in makefile --> - <property name="lib.z.path" value="/usr/lib"/> - <property name="lib.ewf.path" value="/usr/local/lib"/> - </target> + <target name="testTSKLibs"> + <property environment="env"/> + <available file="./jni/.libs/libtsk_jni.dylib" property="tsk_dylib.present"/> + <available file="./jni/.libs/libtsk_jni.so" property="tsk_so.present"/> + <fail message="JNI native library not built."> + <condition> + <not> + <or> + <isset property="tsk_dylib.present"/> + <isset property="tsk_so.present"/> + </or> + </not> + </condition> + </fail> + <!-- Default location to find zlib and libewf. Overwritten by properties in makefile --> + <property name="lib.z.path" value="/usr/lib"/> + <property name="lib.ewf.path" value="/usr/local/lib"/> + </target> + + <!-- OS X --> + <target name="copyTskLibs_dylib" depends="testTSKLibs" if="tsk_dylib.present"> + <property environment="env"/> + <copy file="./jni/.libs/libtsk_jni.dylib" tofile="./libtsk_jni.jnilib" overwrite="true"/> + </target> - <!-- OS X --> - <target name="copyTskLibs_dylib" depends="testTSKLibs" if="tsk_dylib.present"> - <property environment="env"/> - <copy file="./jni/.libs/libtsk_jni.dylib" tofile="./libtsk_jni.jnilib" overwrite="true"/> - </target> - <target name="copyMacLibs" depends="testTSKLibs" if="tsk_dylib.present"> - <property environment="env"/> - <property name="jni.dylib" location="${basedir}/jni/.libs/libtsk_jni.dylib" /> - <property name="jni.jnilib" value="libtsk_jni.jnilib" /> + <property environment="env"/> + <property name="jni.dylib" location="${basedir}/jni/.libs/libtsk_jni.dylib"/> + <property name="jni.jnilib" value="libtsk_jni.jnilib"/> <!-- x86_64 --> - <copy file="${jni.dylib}" tofile="${x86_64}/mac/${jni.jnilib}" overwrite="true"/> + <copy file="${jni.dylib}" tofile="${x86_64}/mac/${jni.jnilib}" overwrite="true"/> <!-- amd64 --> <copy file="${jni.dylib}" tofile="${amd64}/mac/${jni.jnilib}" overwrite="true"/> - </target> + </target> + + <!-- Non-OS X --> + <target name="copyTskLibs_so" depends="testTSKLibs" if="tsk_so.present"> + <property environment="env"/> + <copy file="./jni/.libs/libtsk_jni.so" tofile="./libtsk_jni.so" overwrite="true"/> + </target> - <!-- Non-OS X --> - <target name="copyTskLibs_so" depends="testTSKLibs" if="tsk_so.present"> - <property environment="env"/> - <copy file="./jni/.libs/libtsk_jni.so" tofile="./libtsk_jni.so" overwrite="true"/> - </target> - <target name="copyLinuxLibs" depends="testTSKLibs" if="tsk_so.present"> <property environment="env"/> - <property name="jni.so" location="${basedir}/jni/.libs/libtsk_jni.so" /> + <property name="jni.so" location="${basedir}/jni/.libs/libtsk_jni.so"/> <property name="zlib.so" location="${lib.z.path}/libz.so"/> <property name="libewf.so" location="${lib.ewf.path}/libewf.so"/> <!-- x86_64 --> @@ -97,13 +93,13 @@ <copy file="${jni.so}" tofile="${i686}/linux/libtsk_jni.so" overwrite="true"/> </target> - <target name="copyLibs-SQLite" depends="copyLinuxLibs,copyMacLibs" /> - <target name="copyLibs-PostgreSQL" depends="copyLinuxLibs,copyMacLibs" /> - <target name="copyLibs-SQLiteDebug" depends="copyLinuxLibs,copyMacLibs" /> - <target name="copyLibs-PostgreSQLDebug" depends="copyLinuxLibs,copyMacLibs" /> - - <target name="copyTSKLibs" depends="copyTskLibs_so,copyTskLibs_dylib"> - <!-- depends targets take care of the actual copying since the file differs on OS X and Linux --> - <!-- This assumes that TSK, libewf, and zlib have been installed on the system and those libraries will be with normal loading approaches --> - </target> + <target name="copyLibs-SQLite" depends="copyLinuxLibs,copyMacLibs"/> + <target name="copyLibs-PostgreSQL" depends="copyLinuxLibs,copyMacLibs"/> + <target name="copyLibs-SQLiteDebug" depends="copyLinuxLibs,copyMacLibs"/> + <target name="copyLibs-PostgreSQLDebug" depends="copyLinuxLibs,copyMacLibs"/> + + <target name="copyTSKLibs" depends="copyTskLibs_so,copyTskLibs_dylib"> + <!-- depends targets take care of the actual copying since the file differs on OS X and Linux --> + <!-- This assumes that TSK, libewf, and zlib have been installed on the system and those libraries will be with normal loading approaches --> + </target> </project> diff --git a/bindings/java/build-windows.xml b/bindings/java/build-windows.xml index bb3b2c72e6d652c834d632c7c12b5eba02a9e724..e65df5537f28ec5ca4f313863239eb2cb10d0ab3 100644 --- a/bindings/java/build-windows.xml +++ b/bindings/java/build-windows.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="windows-1252"?> <project name="TSKTestTargets"> - + <property name="dlls" value="../../win32/x64/Release_PostgreSQL"/> <property environment="env"/> - - <target name="test" + + <target name="test" description="Runs the regression tests." depends="compile-test" > <junit fork="on" haltonfailure="yes" dir="."> @@ -22,7 +22,7 @@ description="Rebuilds gold standards for tests." depends="compile-test" > <java classname="org.sleuthkit.datamodel.DataModelTestSuite" classpathref="libraries" fork="true" failonerror="true"> - <sysproperty key="java.library.path" value="${dlls}"/> + <sysproperty key="java.library.path" value="${dlls}"/> <sysproperty key="gold" value="${test-standards}"/> <sysproperty key="inpt" value="${test-input}"/> <sysproperty key="types" value="${test-types}"/> @@ -45,7 +45,7 @@ <property name="tsk.config" value="Release"/> <antcall target="copyWinTskLibsToBuildSQLite" /> </target> - + <target name="copyLibs-SQLiteDebug" description="Copy native libs to the correct folder"> <property name="tsk.config" value="Debug"/> <antcall target="copyWinTskLibsToBuildSQLite" /> @@ -55,55 +55,55 @@ <property name="tsk.config" value="Release_PostgreSQL"/> <antcall target="copyWinTskLibsToBuild-PostgreSQL" /> </target> - + <target name="copyLibs-PostgreSQLDebug" description="Copy native libs to the correct folder, PostgreSQL build"> <property name="tsk.config" value="Debug_PostgreSQL"/> <antcall target="copyWinTskLibsToBuild-PostgreSQL" /> </target> <target name="copyWinTskLibsToBuildSQLite" depends="copyWinTskLibs64ToBuildSQLite, copyWinTskLibs32ToBuild-SQLite" description="Copy Windows DLLs to the correct location, SQLite build." /> - + <target name="checkTskLibDirsSQLite"> <available property="win64.TskLib.exists" type="file" file="${basedir}/../../win32/x64/${tsk.config}/libtsk_jni.dll" /> <available property="win32.TskLib.exists" type="file" file="${basedir}/../../win32/${tsk.config}/libtsk_jni.dll" /> </target> - + <target name="copyWinTskLibs64ToBuildSQLite" depends="checkTskLibDirsSQLite" if="win64.TskLib.exists"> <property name="tsk.jni.64" location="${basedir}/../../win32/x64/${tsk.config}/libtsk_jni.dll" /> - + <copy file="${tsk.jni.64}" todir="${amd64}/win" overwrite="true"/> <copy file="${tsk.jni.64}" todir="${x86_64}/win" overwrite="true"/> </target> - + <target name="copyWinTskLibs32ToBuild-SQLite" depends="checkTskLibDirs" if="win32.TskLib.exists"> <property name="tsk.jni.32" location="${basedir}/../../win32/${tsk.config}/libtsk_jni.dll" /> - + <copy file="${tsk.jni.32}" todir="${i386}/win" overwrite="true"/> <copy file="${tsk.jni.32}" todir="${x86}/win" overwrite="true"/> - <copy file="${tsk.jni.32}" todir="${i586}/win" overwrite="true"/> + <copy file="${tsk.jni.32}" todir="${i586}/win" overwrite="true"/> <copy file="${tsk.jni.32}" todir="${i686}/win" overwrite="true"/> </target> - + <target name="copyWinTskLibsToBuild-PostgreSQL" depends="copyWinTskLibs64ToBuild-PostgreSQL,copyWinTskLibs32ToBuild-PostgreSQL" description="Copy Windows DLLs to the correct location, PostgreSQL build." /> - + <target name="checkTskLibDirs"> <available property="win64.TskLib.exists" type="file" file="${basedir}/../../win32/x64/${tsk.config}/libtsk_jni.dll" /> <available property="win32.TskLib.exists" type="file" file="${basedir}/../../win32/${tsk.config}/libtsk_jni.dll" /> </target> - + <target name="copyWinTskLibs64ToBuild-PostgreSQL" depends="checkTskLibDirs" if="win64.TskLib.exists"> <property name="tsk.jni.64" location="${basedir}/../../win32/x64/${tsk.config}/libtsk_jni.dll" /> - + <copy file="${tsk.jni.64}" todir="${amd64}/win" overwrite="true"/> <copy file="${tsk.jni.64}" todir="${x86_64}/win" overwrite="true"/> </target> - + <target name="copyWinTskLibs32ToBuild-PostgreSQL" depends="checkTskLibDirs" if="win32.TskLib.exists"> <property name="tsk.jni.32" location="${basedir}/../../win32/${tsk.config}/libtsk_jni.dll" /> - + <copy file="${tsk.jni.32}" todir="${i386}/win" overwrite="true"/> <copy file="${tsk.jni.32}" todir="${x86}/win" overwrite="true"/> - <copy file="${tsk.jni.32}" todir="${i586}/win" overwrite="true"/> + <copy file="${tsk.jni.32}" todir="${i586}/win" overwrite="true"/> <copy file="${tsk.jni.32}" todir="${i686}/win" overwrite="true"/> </target> </project> diff --git a/bindings/java/build.xml b/bindings/java/build.xml index d1808c6440b3be5a01c630957fcb1b6b7bdc080a..e8763610163d5b118519709bf6e5fb88fdb2a537 100755 --- a/bindings/java/build.xml +++ b/bindings/java/build.xml @@ -1,42 +1,36 @@ <project xmlns:ivy="antlib:org.apache.ivy.ant" name="DataModel" default="dist" basedir="."> <description> - Sleuthkit Java DataModel + Sleuthkit Java DataModel </description> - <condition property="os.family" value="unix"> - <os family="unix"/> - </condition> - <condition property="os.family" value="windows"> - <os family="windows"/> - </condition> - <import file="build-${os.family}.xml"/> + <condition property="os.family" value="unix"> + <os family="unix"/> + </condition> + <condition property="os.family" value="windows"> + <os family="windows"/> + </condition> + <import file="build-${os.family}.xml"/> <!-- set global properties for this build --> + <property name="default-jar-location" location="/usr/share/java"/> <property name="src" location="src/org/sleuthkit/datamodel"/> <property name="VERSION" value="4.6.0"/> <property name="sample" location="src/org/sleuthkit/datamodel/Examples"/> <property name="build" location="build/"/> <property name="build-datamodel" location="build/org/sleuthkit/datamodel"/> - <property name="dist" location="dist"/> + <property name="dist" location="dist"/> <property name="lib" location="lib"/> <property name="test" location="test"/> <property name="test-standards" location="test/output/gold"/> <property name="test-results" location="test/output/results"/> <property name="test-input" location="test/input"/> <property name="test-types" location="test/org/sleuthkit/datamodel"/> - <property name="native-libs" location="build/NATIVELIBS" /> - <property name="amd64" location="build/NATIVELIBS/amd64" /> - <property name="x86" location="build/NATIVELIBS/x86" /> - <property name="x86_64" location="build/NATIVELIBS/x86_64" /> - <property name="i386" location="build/NATIVELIBS/i386" /> - <property name="i586" location="build/NATIVELIBS/i586" /> + <property name="native-libs" location="build/NATIVELIBS"/> + <property name="amd64" location="build/NATIVELIBS/amd64"/> + <property name="x86" location="build/NATIVELIBS/x86"/> + <property name="x86_64" location="build/NATIVELIBS/x86_64"/> + <property name="i386" location="build/NATIVELIBS/i386"/> + <property name="i586" location="build/NATIVELIBS/i586"/> <property name="i686" location="build/NATIVELIBS/i686"/> - - <path id="libraries"> - <fileset dir="${lib}"> - <include name="*.jar"/> - </fileset> - <pathelement path="${build}"/> - </path> <!-- Only added win folders for now --> <target name="init"> @@ -46,72 +40,93 @@ <mkdir dir="${test-input}"/> <mkdir dir="${test-standards}"/> <mkdir dir="${test-results}"/> - <mkdir dir="${native-libs}" /> - <mkdir dir="${amd64}" /> - <mkdir dir="${amd64}/win" /> - <mkdir dir="${amd64}/mac" /> - <mkdir dir="${amd64}/linux" /> - <mkdir dir="${x86}" /> - <mkdir dir="${x86}/win" /> - <mkdir dir="${x86}/linux" /> - <mkdir dir="${x86_64}" /> - <mkdir dir="${x86_64}/win" /> - <mkdir dir="${x86_64}/mac" /> + <mkdir dir="${native-libs}"/> + <mkdir dir="${amd64}"/> + <mkdir dir="${amd64}/win"/> + <mkdir dir="${amd64}/mac"/> + <mkdir dir="${amd64}/linux"/> + <mkdir dir="${x86}"/> + <mkdir dir="${x86}/win"/> + <mkdir dir="${x86}/linux"/> + <mkdir dir="${x86_64}"/> + <mkdir dir="${x86_64}/win"/> + <mkdir dir="${x86_64}/mac"/> <mkdir dir="${x86_64}/linux"/> - <mkdir dir="${i386}" /> - <mkdir dir="${i386}/win" /> + <mkdir dir="${i386}"/> + <mkdir dir="${i386}/win"/> <mkdir dir="${i386}/linux"/> - <mkdir dir="${i586}" /> - <mkdir dir="${i586}/win" /> - <mkdir dir="${i586}/linux" /> + <mkdir dir="${i586}"/> + <mkdir dir="${i586}/win"/> + <mkdir dir="${i586}/linux"/> <mkdir dir="${i686}"/> <mkdir dir="${i686}/win"/> <mkdir dir="${i686}/linux"/> </target> - - <property name="ivy.install.version" value="2.3.0-rc2" /> + + <!-- set classpath for dependencies--> + + <target name="set-library-path" description="sets the path of the libraries" depends="set-library-path-online,set-library-path-offline"></target> + + <target name="set-library-path-online" description="set this library path when the user is online" unless="offline"> + <path id="libraries"> + <fileset dir="${lib}"> + <include name="*.jar"/> + </fileset> + <pathelement path="${build}"/> + </path> + <echo message="hey"/> + </target> + + <target name="set-library-path-offline" description="set the library path when the user is offline" if="offline"> + <path id="libraries"> + <fileset dir="${default-jar-location}"> + <include name="*.jar"/> + </fileset> + <fileset dir="${lib}"> + <include name="*.jar"/> + </fileset> + <pathelement path="${build}"/> + </path> + </target> + + <property name="ivy.install.version" value="2.3.0-rc2"/> <condition property="ivy.home" value="${env.IVY_HOME}"> - <isset property="env.IVY_HOME" /> + <isset property="env.IVY_HOME"/> </condition> - <property name="ivy.home" value="${user.home}/.ant" /> - <property name="ivy.jar.dir" value="${ivy.home}/lib" /> - <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" /> + <property name="ivy.home" value="${user.home}/.ant"/> + <property name="ivy.jar.dir" value="${ivy.home}/lib"/> + <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/> <target name="download-ivy" unless="offline"> <available file="${ivy.jar.file}" property="ivy.available"/> - <antcall target="-download-ivy" /> + <antcall target="-download-ivy"/> </target> <target name="-download-ivy" unless="ivy.available"> <mkdir dir="${ivy.jar.dir}"/> - <get src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" - dest="${ivy.jar.file}" usetimestamp="true"/> + <get src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.file}" usetimestamp="true"/> </target> <target name="init-ivy" depends="download-ivy" unless="ivy.lib.path"> <path id="ivy.lib.path"> <fileset dir="${ivy.jar.dir}" includes="*.jar"/> </path> - <taskdef resource="org/apache/ivy/ant/antlib.xml" - uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/> + <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/> </target> <target name="retrieve-deps" description="retrieve dependencies using ivy" depends="init-ivy" unless="offline"> - <ivy:settings file="ivysettings.xml" /> + <ivy:settings file="ivysettings.xml"/> <ivy:resolve/> - <ivy:retrieve sync="true" - pattern="lib/[artifact]-[revision](-[classifier]).[ext]" /> + <ivy:retrieve sync="true" pattern="lib/[artifact]-[revision](-[classifier]).[ext]"/> </target> - - <target name="compile-test" depends="compile" - description="compile the tests" > + + <target name="compile-test" depends="compile" description="compile the tests"> <javac debug="on" srcdir="${test}" destdir="${build}" includeantruntime="false"> <classpath refid="libraries"/> </javac> </target> - - <target name="compile" depends="init, retrieve-deps" - description="compile the source" > + + <target name="compile" depends="init, retrieve-deps" description="compile the source"> <!-- Compile the java code from ${src} into ${build} --> <javac debug="on" srcdir="${src}" destdir="${build}" classpathref="libraries" includeantruntime="false"> <compilerarg value="-Xlint"/> @@ -127,20 +142,18 @@ </javac> </target> - <target name="dist-SQLite" depends="check-build, init-ivy, compile, copyLibs-SQLite" - unless="up-to-date" description="generate the distribution" > + <target name="dist-SQLite" depends="check-build, init-ivy,set-library-path, compile, copyLibs-SQLite" unless="up-to-date" description="generate the distribution"> <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file --> <jar jarfile="${dist}/sleuthkit-${VERSION}.jar" basedir="${build}"/> </target> - <target name="dist-PostgreSQL" depends="check-build, init-ivy, compile, copyLibs-PostgreSQL" - unless="up-to-date" description="generate the PostgreSQL distribution" > + <target name="dist-PostgreSQL" depends="check-build, init-ivy,set-library-path, compile, copyLibs-PostgreSQL" unless="up-to-date" description="generate the PostgreSQL distribution"> <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file --> <jar jarfile="${dist}/sleuthkit-postgresql-${VERSION}.jar" basedir="${build}"/> </target> <target name="check-build" depends="check-native-build"> - <uptodate property="java-up-to-date" targetfile="${dist}/sleuthkit-${VERSION}.jar" > + <uptodate property="java-up-to-date" targetfile="${dist}/sleuthkit-${VERSION}.jar"> <srcfiles dir="${src}" includes="**/*.java"/> </uptodate> <condition property="up-to-date"> @@ -151,69 +164,62 @@ </condition> </target> - <target name="dist" depends="check-build" unless="up-to-date"> + <target name="dist" depends="check-build" unless="up-to-date"> <antcall target="dist-SQLite"/> - </target> - + </target> + <target name="Debug" depends="check-build" unless="up-to-date"> <antcall target="Debug-SQLite"/> - </target> - - <target name="Debug-SQLite" depends="check-build, init-ivy, compile, copyLibs-SQLiteDebug" - unless="up-to-date" description="generate the debug distribution" > + </target> + + <target name="Debug-SQLite" depends="check-build, init-ivy, compile, copyLibs-SQLiteDebug" unless="up-to-date" description="generate the debug distribution"> <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file --> <jar jarfile="${dist}/sleuthkit-${VERSION}.jar" basedir="${build}"/> </target> - - <target name="Debug-PostgreSQL" depends="init-ivy, compile, copyLibs-PostgreSQLDebug" - description="generate the PostgreSQL debug distribution" > + + <target name="Debug-PostgreSQL" depends="init-ivy, compile, copyLibs-PostgreSQLDebug" description="generate the PostgreSQL debug distribution"> <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file --> <jar jarfile="${dist}/sleuthkit-postgresql-${VERSION}.jar" basedir="${build}"/> </target> <target name="jni" depends="compile" description="make the jni.h file"> - <javah classpath = "${build}" outputFile="jni/dataModel_SleuthkitJNI.h" force="yes"> + <javah classpath="${build}" outputFile="jni/dataModel_SleuthkitJNI.h" force="yes"> <class name="org.sleuthkit.datamodel.SleuthkitJNI"/> </javah> </target> - - <target name="clean" - description="clean up" > + + <target name="clean" description="clean up"> <delete dir="${build}"/> <delete dir="${dist}"/> <delete dir="${lib}"/> </target> - <target name ="javadoc" description="Make the API docs"> + <target name="javadoc" description="Make the API docs"> <mkdir dir="javadoc"/> - <javadoc sourcepath="src" destdir="javadoc" overview="src/overview.html" /> + <javadoc sourcepath="src" destdir="javadoc" overview="src/overview.html"/> </target> <target name="test-download" description="download test images."> - <mkdir dir="${test-input}" /> + <mkdir dir="${test-input}"/> <get src="http://digitalcorpora.org/corp/nps/drives/nps-2009-canon2/nps-2009-canon2-gen6.E01" dest="${test-input}"/> <get src="http://digitalcorpora.org/corp/nps/drives/nps-2009-ntfs1/ntfs1-gen2.E01" dest="${test-input}"/> - <!--<get src="http://www.cfreds.nist.gov/dfr-images/dfr-16-ext.dd.bz2" dest="${test-input}"/> - <bunzip2 src="${test-input}/dfr-16-ext.dd.bz2" /> --> + <!--<get src="http://www.cfreds.nist.gov/dfr-images/dfr-16-ext.dd.bz2" dest="${test-input}"/> <bunzip2 src="${test-input}/dfr-16-ext.dd.bz2" /> --> </target> <!-- NOTE: test and test-rebuild targets are in the OS-specific files --> - <target name="run-sample" depends="compile" - description="run the sample"> - <java classname="org.sleuthkit.datamodel.Examples.Sample" - fork="true" - failonerror="true"> + <target name="run-sample" depends="compile" description="run the sample"> + <java classname="org.sleuthkit.datamodel.Examples.Sample" fork="true" failonerror="true"> <env key="PATH" path="${env.TEMP}:${env.Path}:${env.TSK_HOME}/win32/x64/Release"/> <arg value="${image}"/> <classpath refid="libraries"/> </java> - + </target> <target name="doxygen" description="build doxygen docs, requires doxygen in PATH"> <exec executable="doxygen" dir="${basedir}/doxygen"> <arg value="Doxyfile"/> </exec> </target> - + </project> diff --git a/configure.ac b/configure.ac index 39e453c6d2125f5fe327fe00b1deba3e19d068b4..51356e14f51fb0f51177a575fd64f2fbca4475a9 100644 --- a/configure.ac +++ b/configure.ac @@ -33,7 +33,6 @@ AC_PROG_LN_S AC_PROG_MAKE_SET AC_PATH_PROG(PERL, perl) - dnl Checks for header files. AC_HEADER_STDC dnl AC_HEADER_MAJOR @@ -209,6 +208,19 @@ AC_SUBST(Z_PATH, $Z_PATH) dnl needed for sqllite AC_CHECK_LIB(dl, dlopen) +dnl check for user online input + +AC_ARG_ENABLE([offline], + [ AS_HELP_STRING([--enable-offline],[Turn on offline mode])], + [case "${enableval}" in + yes) offline=true ;; + no) offline=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-online]) ;; + esac],[offline=false]) + +AM_CONDITIONAL([OFFLINE], [test "x$offline" = xtrue]) + + dnl Check if we should link libewf. AC_ARG_WITH([libewf], [AS_HELP_STRING([--without-libewf],[Do not use libewf even if it is installed])] diff --git a/debian/README.source b/debian/README.source new file mode 100644 index 0000000000000000000000000000000000000000..93de9f3dd4c94797a1ad85ba46f969b2ef8848ff --- /dev/null +++ b/debian/README.source @@ -0,0 +1,8 @@ +sleuthkit for Debian +------------------- + +These debian files are not for the official debian packaging and it does not meet all of the debian rules. We are using these files for our own distribution + + + -- Rishwanth Senthilkumar <rishwanth@basistech.com> Tue, 30 Jan 2018 15:34:02 -0500 + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000000000000000000000000000000000000..8ada6ad230332c2e43bfd15571a3ff1695aa3ffe --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +sleuthkit-java (4.6.0-1) unstable; urgency=medium + + * Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP> + + -- Rishwanth Senthilkumar <rishwanth@basistech.com> Tue, 30 Jan 2018 15:34:02 -0500 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000000000000000000000000000000000000..ec635144f60048986bc560c5576355344005e6e7 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000000000000000000000000000000000000..b844a588351da5aa32389cd97475ff04d3f1f327 --- /dev/null +++ b/debian/control @@ -0,0 +1,36 @@ +Source: sleuthkit-java +Section: contrib +Priority: optional +Maintainer: Rishwanth Senthilkumar <rishwanth@basistech.com> +Build-Depends: debhelper (>=9),autotools-dev, libewf-dev (>= 20130416), libsqlite3-dev, libafflib-dev (>= 3.6.6), libc3p0-java, libpostgresql-jdbc-java +Standards-Version: 4.0.0 +Homepage: http://www.sleuthkit.org/sleuthkit + +Package: sleuthkit-java +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, libewf-dev (>= 20130416), libafflib-dev (>= 3.6.6), libsqlite3-dev, libc3p0-java, libpostgresql-jdbc-java +Description: tools for forensics analysis on volume and filesystem data + The Sleuth Kit, also known as TSK, is a collection of UNIX-based command + line file and volume system forensic analysis tools. The filesystem tools + allow you to examine filesystems of a suspect computer in a non-intrusive + fashion. Because the tools do not rely on the operating system to process the + filesystems, deleted and hidden content is shown. + . + The volume system (media management) tools allow you to examine the layout of + disks and other media. You can also recover deleted files, get information + stored in slack spaces, examine filesystems journal, see partitions layout on + disks or images etc. But is very important clarify that the TSK acts over the + current filesystem only. + . + The Sleuth Kit supports DOS partitions, BSD partitions (disk labels), Mac + partitions, Sun slices (Volume Table of Contents), and GPT disks. With these + tools, you can identify where partitions are located and extract them so that + they can be analyzed with filesystem analysis tools. + . + Currently, TSK supports several filesystems, as NTFS, FAT, exFAT, HFS+, Ext3, + Ext4, UFS and YAFFS2. + . + This package contains the set of command line tools in The Sleuth Kit. + + + diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000000000000000000000000000000000000..e384949135577e572e6d4276118e6fae4b5311d9 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,13 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: The Sleuth Kit (TSK) +Upstream-Contact: Brian Carrier <carrier@sleuthkit.org> +Source: https://github.com/sleuthkit/sleuthkit + +Files: * +Copyright: 2001-2016 Brian Carrier <carrier@sleuthkit.org> + 2002 @stake Inc. + 2005 Naysawn Naderi <ndn@xiphos.ca> + 2006-2011 Joachim Metz <jbmetz@users.sourceforge.net> + 2006-2014 Basis Technology <carrier@sleuthkit.org> +License: CPL-1.0 + diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000000000000000000000000000000000000..466d9083113628d207e42b6181c6d703f7bf9e45 --- /dev/null +++ b/debian/rules @@ -0,0 +1,35 @@ +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +#export DH_VERBOSE = 1 + + +# see FEATURE AREAS in dpkg-buildflags(1) +export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +# see ENVIRONMENT in dpkg-buildflags(1) +# package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# package maintainers to append LDFLAGS +export DEB_LDFLAGS_MAINT_APPEND = -lsqlite3 -lsupc++ -Wl,--as-needed + + +%: + dh $@ --with autotools_dev + + +# dh_make generated override targets +# This is example for Cmake (See https://bugs.debian.org/641051 ) +#override_dh_auto_configure: +# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) + + +override_dh_auto_configure: + dh_auto_configure -- --enable-offline=yes +override_dh_auto_install: + cd tsk/ + sudo make install + cd .. + cd bindings/java/ + sudo make install + dh_install diff --git a/debian/sleuthkit-java-docs.docs b/debian/sleuthkit-java-docs.docs new file mode 100644 index 0000000000000000000000000000000000000000..efea0a6a245fdf48ae469285ec0354f799f805e4 --- /dev/null +++ b/debian/sleuthkit-java-docs.docs @@ -0,0 +1,2 @@ +README.Debian +README.source diff --git a/debian/sleuthkit-java.install b/debian/sleuthkit-java.install new file mode 100644 index 0000000000000000000000000000000000000000..67b5aefc5d486e8f38d60c9be816158e84f1aed4 --- /dev/null +++ b/debian/sleuthkit-java.install @@ -0,0 +1,4 @@ +bindings/java/thirdpartyjars/sqlite-jdbc-3.21.0.1.jar /usr/share/java +bindings/java/dist/sleuthkit-4.6.0.jar /usr/share/java +bindings/java/libtsk.so /usr/lib/ + diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000000000000000000000000000000000000..163aaf8d82b6c54f23c45f32895dbdfdcc27b047 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt)