diff --git a/sysutils/py-tsk/Makefile b/sysutils/py-tsk/Makefile new file mode 100644 index 00000000000..e8c88bc8259 --- /dev/null +++ b/sysutils/py-tsk/Makefile @@ -0,0 +1,36 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2017/01/22 08:18:04 rpointel Exp $ + +COMMENT = Python bindings for The Sleuth Kit (libtsk) + +MODPY_EGG_VERSION = 20160721 +DISTNAME = pytsk3-${MODPY_EGG_VERSION} +PKGNAME = py-tsk-${MODPY_EGG_VERSION} + +CATEGORIES = sysutils + +HOMEPAGE = https://github.com/py4n6/pytsk/ + +MAINTAINER = Remi Pointel + +# Apache v2 +PERMIT_PACKAGE_CDROM = Yes + +MODULES = lang/python +MODPY_PI = Yes +MODPY_SETUPTOOLS = Yes + +WANTLIB += pthread talloc tsk ${MODPY_WANTLIB} + +pre-configure: + ${SUBST_DATA} ${WRKSRC}/setup.py ${WRKSRC}/setup.py.new + mv ${WRKSRC}/setup.py.new ${WRKSRC}/setup.py + +LIB_DEPENDS = sysutils/sleuthkit \ + devel/libtalloc +TEST_DEPENDS = sysutils/py-tsk=${MODPY_EGG_VERSION} + +# it needs test_data/* in the Github repository +do-test: + cd ${WRKSRC} && ${MODPY_BIN} run_tests.py + +.include diff --git a/sysutils/py-tsk/distinfo b/sysutils/py-tsk/distinfo new file mode 100644 index 00000000000..0ad29a0a722 --- /dev/null +++ b/sysutils/py-tsk/distinfo @@ -0,0 +1,2 @@ +SHA256 (pytsk3-20160721.tar.gz) = 3m9J5oek63R9BStD7FXm6upbwzOUaA7iMq8DKSCf/IU= +SIZE (pytsk3-20160721.tar.gz) = 2958826 diff --git a/sysutils/py-tsk/patches/patch-setup_py b/sysutils/py-tsk/patches/patch-setup_py new file mode 100644 index 00000000000..eddb95c3311 --- /dev/null +++ b/sysutils/py-tsk/patches/patch-setup_py @@ -0,0 +1,43 @@ +$OpenBSD: patch-setup_py,v 1.1.1.1 2017/01/22 08:18:04 rpointel Exp $ +--- setup.py.orig Thu Jul 21 21:02:40 2016 ++++ setup.py Thu Oct 13 22:33:14 2016 +@@ -171,7 +171,7 @@ class BuildExtCommand(build_ext): + compiler = new_compiler(compiler=self.compiler) + self.define = self.configure_source_tree(compiler) + +- libtsk_path = "sleuthkit/tsk" ++ libtsk_path = "${LOCALBASE}/include/tsk" + + if not os.access("pytsk3.c", os.R_OK): + # Generate the Python binding code (pytsk3.c). +@@ -286,7 +286,7 @@ class UpdateCommand(Command): + with open("version.txt", "w") as fd: + fd.write(self.version) + +- libtsk_path = "sleuthkit/tsk" ++ libtsk_path = "${LOCALBASE}/include/tsk" + + # Generate the Python binding code (pytsk3.c). + libtsk_header_files = [ +@@ -325,7 +325,7 @@ class ProjectBuilder(object): + self._argv = argv + + # The path to the "tsk" directory. +- self._libtsk_path = "sleuthkit/tsk" ++ self._libtsk_path = "${LOCALBASE}/include/tsk" + + # paths under the tsk/ directory which contain files we need to compile. + self._sub_library_names = "auto base docs fs hashdb img vs".split() +@@ -333,9 +333,9 @@ class ProjectBuilder(object): + # The args for the extension builder. + self.extension_args = dict( + define_macros=[], +- include_dirs=["talloc", "sleuthkit/tsk", "sleuthkit", "."], +- library_dirs=[], +- libraries=[], ++ include_dirs=[".", "${LOCALBASE}/include"], ++ library_dirs=["${LOCALBASE}/lib"], ++ libraries=["tsk", "talloc"], + ) + + # The sources to build. diff --git a/sysutils/py-tsk/pkg/DESCR b/sysutils/py-tsk/pkg/DESCR new file mode 100644 index 00000000000..73c6e944a15 --- /dev/null +++ b/sysutils/py-tsk/pkg/DESCR @@ -0,0 +1 @@ + Python bindings for The Sleuth Kit (libtsk). diff --git a/sysutils/py-tsk/pkg/PLIST b/sysutils/py-tsk/pkg/PLIST new file mode 100644 index 00000000000..d276b7b5017 --- /dev/null +++ b/sysutils/py-tsk/pkg/PLIST @@ -0,0 +1,8 @@ +@comment $OpenBSD: PLIST,v 1.1.1.1 2017/01/22 08:18:04 rpointel Exp $ +lib/python${MODPY_VERSION}/site-packages/pytsk3-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/ +lib/python${MODPY_VERSION}/site-packages/pytsk3-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/PKG-INFO +lib/python${MODPY_VERSION}/site-packages/pytsk3-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/SOURCES.txt +lib/python${MODPY_VERSION}/site-packages/pytsk3-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/dependency_links.txt +lib/python${MODPY_VERSION}/site-packages/pytsk3-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/not-zip-safe +lib/python${MODPY_VERSION}/site-packages/pytsk3-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/top_level.txt +lib/python${MODPY_VERSION}/site-packages/pytsk3.so