diff --git a/app-forensics/libforensic1394/Manifest b/app-forensics/libforensic1394/Manifest index ae03900a9..f338e44fc 100644 --- a/app-forensics/libforensic1394/Manifest +++ b/app-forensics/libforensic1394/Manifest @@ -1 +1 @@ -DIST libforensic1394-0.2.tar.gz 59079 SHA256 a32cb432d79cec01d7c90252676d42d92167d851d09770c11ada01b34b228d26 SHA512 4571f58ed7d127c050a31c669105a55974fb858045cd0bae7c3372ddcf35f94bdd08bd3a4f269ba6031b9d022c7d71848e6baf9d6e8fcc38882ced3387a066ee WHIRLPOOL 3f700141ccb21c2fd7f92c080ff109d147dc5aee96fdb5c45be8348381156cdc37634f8d579aa299e7441b58819a7380faac6fe118315115012d5cd7ce7b4568 +DIST libforensic1394-0.2.tar.gz 59079 BLAKE2B b950d8c00e51af3494104d3d87a04d0fa15f0f83ddf84d3855bf7be9c8f07442f294f1b54f43d804ea9e76d5c1462e5dcdc2067f9af0bba99488de8687b5b84a SHA512 4571f58ed7d127c050a31c669105a55974fb858045cd0bae7c3372ddcf35f94bdd08bd3a4f269ba6031b9d022c7d71848e6baf9d6e8fcc38882ced3387a066ee diff --git a/app-forensics/libforensic1394/files/libforensic1394-0.2_add_gcc-8.0+_support.patch b/app-forensics/libforensic1394/files/libforensic1394-0.2_add_gcc-8.0+_support.patch new file mode 100644 index 000000000..4a4b04d8c --- /dev/null +++ b/app-forensics/libforensic1394/files/libforensic1394-0.2_add_gcc-8.0+_support.patch @@ -0,0 +1,24 @@ +diff -ur a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt 2010-09-19 01:18:54.000000000 +0400 ++++ b/CMakeLists.txt 2019-05-16 10:20:47.148956235 +0300 +@@ -20,7 +20,7 @@ + + IF(CMAKE_COMPILER_IS_GNUCC) + # The more warnings the better +- ADD_DEFINITIONS(-g -pipe -Werror -fsigned-char -Wall) ++ ADD_DEFINITIONS(-g -pipe -fsigned-char -Wall) + + CHECK_C_SOURCE_COMPILES(" + #if ((defined(__GNUC__)) && (__GNUC__ >= 4)) +diff -ur a/src/linux/juju.c b/src/linux/juju.c +--- a/src/linux/juju.c 2010-09-19 01:18:54.000000000 +0400 ++++ b/src/linux/juju.c 2019-05-16 10:21:19.846146825 +0300 +@@ -364,7 +364,7 @@ + dev->pdev = malloc(sizeof(platform_dev)); + + // Copy the device path into the platform specific structure +- strncpy(dev->pdev->path, devpath, sizeof(dev->pdev->path)); ++ snprintf(dev->pdev->path, sizeof(dev->pdev->path), "%s", devpath); + + // Mark the file descriptor as invalid + dev->pdev->fd = -1; diff --git a/app-forensics/libforensic1394/files/libforensic-exception.patch b/app-forensics/libforensic1394/files/libforensic1394-0.2_libforensic-exception.patch similarity index 100% rename from app-forensics/libforensic1394/files/libforensic-exception.patch rename to app-forensics/libforensic1394/files/libforensic1394-0.2_libforensic-exception.patch diff --git a/app-forensics/libforensic1394/libforensic1394-0.2-r1.ebuild b/app-forensics/libforensic1394/libforensic1394-0.2-r1.ebuild new file mode 100644 index 000000000..90e833416 --- /dev/null +++ b/app-forensics/libforensic1394/libforensic1394-0.2-r1.ebuild @@ -0,0 +1,95 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 python3_{4,5,6,7} ) +CMAKE_IN_SOURCE_BUILD=1 + +inherit distutils-r1 cmake-utils linux-info + +DESCRIPTION="Library for carrying out memory forensics using firewire/ieee1394" +HOMEPAGE="https://freddie.witherden.org/tools/libforensic1394/ https://github.com/FreddieWitherden/libforensic1394" + +if [[ ${PV} == *9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/FreddieWitherden/libforensic1394" +else + SRC_URI="https://github.com/FreddieWitherden/libforensic1394/archive/${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~x86" +fi + +LICENSE="LGPL-3" +SLOT="0" + +IUSE="+python static-libs" +RDEPEND="python? ( ${PYTHON_DEPS} )" +DEPEND="python? ( ${PYTHON_DEPS} )" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +pkg_setup() { + CONFIG_CHECK="~FIREWIRE_OHCI" + linux-info_pkg_setup +} + +src_prepare() { + if use python; then + pushd python >/dev/null || die + distutils-r1_src_prepare + popd >/dev/null || die + fi + + # eapply "${FILESDIR}/request-pipeline.patch" + eapply "${FILESDIR}/${P}_libforensic-exception.patch" + eapply "${FILESDIR}/${P}_add_gcc-8.0+_support.patch" + + sed -e "s#DESTINATION lib#DESTINATION $(get_libdir)#" \ + -i "${S}/CMakeLists.txt" || die "sed failed!" + + cmake-utils_src_prepare +} + +src_configure() { + local mycmakeargs=( + $(usex static-libs \ + "-DFORENSIC1394_BUILD_STATIC=TRUE" \ + "-DFORENSIC1394_BUILD_STATIC=FALSE") + ) + + if use python; then + pushd python >/dev/null || die + distutils-r1_src_configure + popd >/dev/null || die + fi + + cmake-utils_src_configure +} + +src_compile() { + if use python; then + pushd python >/dev/null || die + distutils-r1_src_compile + popd >/dev/null || die + fi + + cmake-utils_src_compile +} + +src_install() { + if use python; then + pushd python >/dev/null || die + distutils-r1_src_install + popd >/dev/null || die + fi + + cmake-utils_src_install + +# TODO: enable access to all nodes +# files/61-libforensic.rules +} + +pkg_postinst() { + einfo "\nMake sure that the old firewire stack is not enabled" + einfo "The following modules must be unloaded:" + einfo " ~# modprobe -r ohci1394 sbp2 eth1394 dv1394 raw1394 video1394\n" +} diff --git a/app-forensics/libforensic1394/libforensic1394-0.2.ebuild b/app-forensics/libforensic1394/libforensic1394-0.2.ebuild deleted file mode 100644 index 971813edd..000000000 --- a/app-forensics/libforensic1394/libforensic1394-0.2.ebuild +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id$ - -EAPI=5 - -PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) - -#for python source files -CMAKE_IN_SOURCE_BUILD=1 - -inherit distutils-r1 cmake-utils linux-info - -DESCRIPTION="Library for carrying out memory forensics using firewire/ieee1394." -HOMEPAGE="https://freddie.witherden.org/tools/libforensic1394/" -SRC_URI="https://github.com/FreddieWitherden/libforensic1394/archive/${PV}.tar.gz -> ${P}.tar.gz" - -LICENSE="LGPL-3" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -IUSE="+python" - -RDEPEND="python? ( ${PYTHON_DEPS} )" -DEPEND="python? ( ${PYTHON_DEPS} )" -REQUIRED_USE="${PYTHON_REQUIRED_USE}" - -pkg_setup() { - CONFIG_CHECK="~FIREWIRE_OHCI" - linux-info_pkg_setup -} - -src_prepare() { - # epatch "${FILESDIR}/request-pipeline.patch" - epatch "${FILESDIR}/libforensic-exception.patch" - sed -e "s#DESTINATION lib#DESTINATION $(get_libdir)#" \ - -i "${S}/CMakeLists.txt" -} - -src_compile() { - cmake-utils_src_compile - if use python; then - einfo "Compiling python modules..." - cd "${S}/python" - distutils-r1_src_compile - fi -} - -src_install() { - cmake-utils_src_install - if use python; then - einfo "Installing python modules..." - cd "${S}/python" - distutils-r1_src_install - fi - -# TODO: enable access to all nodes -# files/61-libforensic.rules -} - -pkg_postinst() { - einfo "Make sure that the old firewire stack is not enabled" - einfo "The following modules must be unloaded:" - einfo "modprobe -r ohci1394 sbp2 eth1394 dv1394 raw1394 video1394" -} diff --git a/app-forensics/libforensic1394/libforensic1394-9999.ebuild b/app-forensics/libforensic1394/libforensic1394-9999.ebuild index 6f4f092bd..25a7bfa72 100644 --- a/app-forensics/libforensic1394/libforensic1394-9999.ebuild +++ b/app-forensics/libforensic1394/libforensic1394-9999.ebuild @@ -1,26 +1,28 @@ -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -# $Id$ -EAPI=5 +EAPI=7 -PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) - -#for python source files +PYTHON_COMPAT=( python2_7 python3_{4,5,6,7} ) CMAKE_IN_SOURCE_BUILD=1 -inherit distutils-r1 cmake-utils linux-info git-r3 +inherit distutils-r1 cmake-utils linux-info -DESCRIPTION="Library for carrying out memory forensics using firewire/ieee1394." -HOMEPAGE="https://freddie.witherden.org/tools/libforensic1394/" -EGIT_REPO_URI="https://github.com/FreddieWitherden/libforensic1394.git" +DESCRIPTION="Library for carrying out memory forensics using firewire/ieee1394" +HOMEPAGE="https://freddie.witherden.org/tools/libforensic1394/ https://github.com/FreddieWitherden/libforensic1394" + +if [[ ${PV} == *9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/FreddieWitherden/libforensic1394" +else + SRC_URI="https://github.com/FreddieWitherden/libforensic1394/archive/${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~x86" +fi LICENSE="LGPL-3" SLOT="0" -KEYWORDS="" - -IUSE="+python" +IUSE="+python static-libs" RDEPEND="python? ( ${PYTHON_DEPS} )" DEPEND="python? ( ${PYTHON_DEPS} )" REQUIRED_USE="${PYTHON_REQUIRED_USE}" @@ -31,34 +33,59 @@ pkg_setup() { } src_prepare() { + if use python; then + pushd python >/dev/null || die + distutils-r1_src_prepare + popd >/dev/null || die + fi + sed -e "s#DESTINATION lib#DESTINATION $(get_libdir)#" \ - -i "${S}/CMakeLists.txt" - # epatch "${FILESDIR}/request-pipeline.patch" + -i "${S}/CMakeLists.txt" || die "sed failed!" + + cmake-utils_src_prepare +} + +src_configure() { + local mycmakeargs=( + $(usex static-libs \ + "-DFORENSIC1394_BUILD_STATIC=TRUE" \ + "-DFORENSIC1394_BUILD_STATIC=FALSE") + ) + + if use python; then + pushd python >/dev/null || die + distutils-r1_src_configure + popd >/dev/null || die + fi + + cmake-utils_src_configure } src_compile() { - cmake-utils_src_compile - if $(use python); then - einfo "Compiling python modules..." - cd "${S}/python" + if use python; then + pushd python >/dev/null || die distutils-r1_src_compile + popd >/dev/null || die fi + + cmake-utils_src_compile } src_install() { - cmake-utils_src_install - if $(use python); then - einfo "Installing python modules..." - cd "${S}/python" + if use python; then + pushd python >/dev/null || die distutils-r1_src_install + popd >/dev/null || die fi + cmake-utils_src_install + # TODO: enable access to all nodes # files/61-libforensic.rules } pkg_postinst() { - einfo "Make sure that the old firewire stack is not enabled" + einfo "\nMake sure that the old firewire stack is not enabled" einfo "The following modules must be unloaded:" - einfo "modprobe -r ohci1394 sbp2 eth1394 dv1394 raw1394 video1394" + einfo " ~# modprobe -r ohci1394 sbp2 eth1394 dv1394 raw1394 video1394\n" }