summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app-forensics/magicrescue/Manifest1
-rw-r--r--app-forensics/magicrescue/files/magicrescue-1.1.10-ldflags.patch38
-rw-r--r--app-forensics/magicrescue/files/magicrescue-1.1.10-remove_toolsdir.patch106
-rw-r--r--app-forensics/magicrescue/magicrescue-1.1.10.ebuild35
4 files changed, 180 insertions, 0 deletions
diff --git a/app-forensics/magicrescue/Manifest b/app-forensics/magicrescue/Manifest
index 43b2e92290f6..0aa741015a5d 100644
--- a/app-forensics/magicrescue/Manifest
+++ b/app-forensics/magicrescue/Manifest
@@ -1 +1,2 @@
+DIST magicrescue-1.1.10.tar.gz 227237 BLAKE2B a1584f4e6f4b6771783c565901775e181ba2e952e780565831e5d46245a4dd4670657cec7fb57b18d7dfc09954faec410da2dfe1b35130c23d22d8a6ccf0ab07 SHA512 54fc943a1f521563a3416040eb6b140e3ef79966b615ae0223be0558b810f9202c2d1e5ba0165c43a614caf78dbce1b0992775bef39e9611d2dc290e4582c29d
DIST magicrescue-1.1.9.tar.gz 92621 BLAKE2B a0a3644729c8af3fab9294b211cfbba0a823186219a585923203236aee27954d2337f81fc4d9559b6dde43581c5ce2d6bae5c2961248e2c4f5dd1ab8e31d5b60 SHA512 3c0b97357f0d354dcf53045bbdf2ce81c451ae20c451d2d72dc8b2dbcc480cf48ab436494c0cca20c99f32c938c525074a561cbc779a580a648c674c150a7cc2
diff --git a/app-forensics/magicrescue/files/magicrescue-1.1.10-ldflags.patch b/app-forensics/magicrescue/files/magicrescue-1.1.10-ldflags.patch
new file mode 100644
index 000000000000..773bab4ff19c
--- /dev/null
+++ b/app-forensics/magicrescue/files/magicrescue-1.1.10-ldflags.patch
@@ -0,0 +1,38 @@
+--- magicrescue-1.1.9/config.d/50dbm 2008-06-27 00:24:05.000000000 +0400
++++ magicrescue-1.1.9.new//config.d/50dbm 2012-05-13 07:56:16.000000000 +0400
+@@ -14,18 +14,14 @@
+ flag="`echo $flag|sed 's/./-l&/'`"
+ echo "trying to link with flags [$flag]" >&5
+
+- bak_LDFLAGS="$LDFLAGS"
+- LDFLAGS="$LDFLAGS $flag"
++ LIBS="$flag"
+ if conftest_link; then
+ # we found it!
+- LDFLAGS="$bak_LDFLAGS"
+ DBM_LDFLAGS="$flag"
+ env_vars="$env_vars DBM_LDFLAGS"
+ echo "#define $dbmdef" >> config.h
+ echo "#define HAVE_NDBM" >> config.h
+ return 0
+- else
+- LDFLAGS="$bak_LDFLAGS"
+ fi
+ done
+
+Common subdirectories: a/config.d and b/config.d
+diff -u a/configure b/configure
+--- a/configure 2018-11-24 20:21:20.000000000 +0100
++++ b/configure 2019-11-12 22:13:03.744338398 +0100
+@@ -63,9 +63,9 @@
+ }
+
+ conftest_link() {
+- echo "$CC -o conftest conftest.o $LDFLAGS" >&5
++ echo "$CC -o conftest conftest.o $LDFLAGS $LIBS" >&5
+ echo >&5
+- $CC -o conftest conftest.o $LDFLAGS >&5 2>&5 \
++ $CC -o conftest conftest.o $LDFLAGS $LIBS >&5 2>&5 \
+ && [ -x conftest ] && ./conftest 2>&5
+ }
+
diff --git a/app-forensics/magicrescue/files/magicrescue-1.1.10-remove_toolsdir.patch b/app-forensics/magicrescue/files/magicrescue-1.1.10-remove_toolsdir.patch
new file mode 100644
index 000000000000..b3a238b1bbea
--- /dev/null
+++ b/app-forensics/magicrescue/files/magicrescue-1.1.10-remove_toolsdir.patch
@@ -0,0 +1,106 @@
+diff -Naur a/config.d/80magicrescue_defs b/config.d/80magicrescue_defs
+--- a/config.d/80magicrescue_defs 2018-11-24 20:21:20.000000000 +0100
++++ b/config.d/80magicrescue_defs 2019-11-14 09:41:34.030848527 +0100
+@@ -1,7 +1,7 @@
+ #!/bin/sh
+
+ cat >> config.h << EOF
+-#define COMMAND_PATH "$prefix/share/magicrescue/tools"
++#define COMMAND_PATH "$prefix/bin"
+ #define RECIPE_PATH "$prefix/share/magicrescue/recipes"
+ #include "largefile.h"
+ EOF
+diff -Naur a/doc/magicrescue.1 b/doc/magicrescue.1
+--- a/doc/magicrescue.1 2018-11-24 20:21:20.000000000 +0100
++++ b/doc/magicrescue.1 2019-11-14 09:41:34.030848527 +0100
+@@ -358,7 +358,7 @@
+ This means that you may have to write your own tool or wrap an existing program
+ in some scripts that make it behave better. For example, this could be to
+ extract the first 10MB into a temporary file and let the program work on that.
+-Or perhaps you can use \fItools/safecat\fR if the file may be very large.
++Or perhaps you can use \fIsafecat\fR if the file may be very large.
+ .SS "Recipe format reference"
+ .IX Subsection "Recipe format reference"
+ Empty lines and lines starting with \f(CW\*(C`#\*(C'\fR will be skipped. A recipe contains a
+@@ -424,7 +424,7 @@
+ should be set to 512.
+ .PP
+ To test whether your recipe actually works, either just run it on your hard
+-disk or use the \fItools/checkrecipe\fR script to pick out files that should match
++disk or use the \fIcheckrecipe\fR script to pick out files that should match
+ but don't.
+ .PP
+ If you have created a recipe that works, please mail it to me at jbj@knef.dk so
+diff -Naur a/doc/magicrescue.pod b/doc/magicrescue.pod
+--- a/doc/magicrescue.pod 2018-11-24 20:21:20.000000000 +0100
++++ b/doc/magicrescue.pod 2019-11-14 09:41:34.030848527 +0100
+@@ -239,7 +239,7 @@
+ This means that you may have to write your own tool or wrap an existing program
+ in some scripts that make it behave better. For example, this could be to
+ extract the first 10MB into a temporary file and let the program work on that.
+-Or perhaps you can use F<tools/safecat> if the file may be very large.
++Or perhaps you can use F<safecat> if the file may be very large.
+
+ =head2 Recipe format reference
+
+@@ -322,7 +322,7 @@
+ =back
+
+ To test whether your recipe actually works, either just run it on your hard
+-disk or use the F<tools/checkrecipe> script to pick out files that should match
++disk or use the F<checkrecipe> script to pick out files that should match
+ but don't.
+
+ If you have created a recipe that works, please mail it to me at jbj@knef.dk so
+diff -Naur a/src/magicrescue.c b/src/magicrescue.c
+--- a/src/magicrescue.c 2018-11-24 20:21:20.000000000 +0100
++++ b/src/magicrescue.c 2019-11-14 09:41:34.030848527 +0100
+@@ -552,7 +552,7 @@
+
+ buf = malloc(bufsize);
+
+- sprintf(buf, "PATH=%s%s%s:%s", "tools",
++ sprintf(buf, "PATH=%s%s%s:%s",
+ #ifdef COMMAND_PATH
+ ":", COMMAND_PATH,
+ #else
+diff -Naur a/tools/checkrecipe b/tools/checkrecipe
+--- a/tools/checkrecipe 2018-11-24 20:21:20.000000000 +0100
++++ b/tools/checkrecipe 2019-11-14 09:41:34.030848527 +0100
+@@ -8,7 +8,7 @@
+ a recipe.
+
+ Usage:
+-./magicrescue -Mio OPTIONS FILES|tools/checkrecipe [OPTIONS]
++./magicrescue -Mio OPTIONS FILES|checkrecipe [OPTIONS]
+
+ Options:
+ -s VALUE Size tolerance, in percent. Specifies when checkrecipe should
+@@ -18,13 +18,13 @@
+
+ find / -name \*.png -print0 \
+ |xargs -0 ./magicrescue -Mio -r png -d /tmp/test-output 2>/dev/null \
+-|tools/checkrecipe
++|checkrecipe
+
+ or
+
+ slocate \*.png|sed "s/['\"\\\\[:blank:]]/\\\\\\\\&/g" \
+ |xargs ./magicrescue -Mio -r png -d /tmp/test-output 2>/dev/null \
+-|tools/checkrecipe
++|checkrecipe
+ );
+ exit;
+ }
+diff -Naur a/tools/ole_rename.pl b/tools/ole_rename.pl
+--- a/tools/ole_rename.pl 2018-11-24 20:21:20.000000000 +0100
++++ b/tools/ole_rename.pl 2019-11-14 09:41:34.030848527 +0100
+@@ -32,7 +32,7 @@
+ my %extensions = @extensions; # for quick lookup
+
+ # When invoked by magicrescue, laola.pl should be in the PATH
+-push @INC, grep /tools/, split /:/, $ENV{PATH};
++push @INC, split /:/, $ENV{PATH};
+ require 'laola.pl';
+
+ my $file = $ARGV[0];
diff --git a/app-forensics/magicrescue/magicrescue-1.1.10.ebuild b/app-forensics/magicrescue/magicrescue-1.1.10.ebuild
new file mode 100644
index 000000000000..732ae17c8280
--- /dev/null
+++ b/app-forensics/magicrescue/magicrescue-1.1.10.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs
+
+DESCRIPTION="Find deleted files in block devices"
+HOMEPAGE="https://github.com/jbj/magicrescue"
+SRC_URI="https://github.com/jbj/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+DEPEND="|| ( sys-libs/gdbm sys-libs/db:* )"
+RDEPEND="${DEPEND}"
+
+PATCHES=( "${FILESDIR}/${P}-ldflags.patch"
+ "${FILESDIR}/${P}-remove_toolsdir.patch" )
+
+src_prepare() {
+ tc-export CC
+ sed -i -e "\
+ s:\$(INSTALLDIR)/share/magicrescue/recipes:\$(INSTALLDIR)/share/doc/${P}/recipes:;\
+ s:\$(INSTALLDIR)/man/man1:\$(INSTALLDIR)/share/man/man1:;\
+ s:\$(INSTALLDIR)/share/magicrescue/tools:\$(INSTALLDIR)/bin:" Makefile.in || die "could not mangle Makefile.in"
+ default
+}
+
+src_configure() {
+ # Not autotools, just looks like it sometimes
+ ./configure --prefix=/usr || die
+}