Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autopsy 4.21.0 #190813

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 59 additions & 94 deletions Formula/a/autopsy.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
class Autopsy < Formula

Check failure on line 1 in Formula/a/autopsy.rb

View workflow job for this annotation

GitHub Actions / Linux

`brew linkage --test autopsy` failed on Linux!

Unwanted system libraries: /lib/x86_64-linux-gnu/libz.so.1
desc "Graphical interface to Sleuth Kit investigation tools"
homepage "https://www.sleuthkit.org/autopsy/index.php"
url "https://downloads.sourceforge.net/project/autopsy/autopsy/2.24/autopsy-2.24.tar.gz"
sha256 "ab787f519942783d43a561d12be0554587f11f22bc55ab79d34d8da703edc09e"
homepage "https://www.autopsy.com/"
url "https://github.com/sleuthkit/autopsy/releases/download/autopsy-4.21.0/autopsy-4.21.0.zip"
sha256 "49228e6e5d6ecbfb6da8362c18df0ddfe86691556a461bfdbe2a8963088c5a24"
license "GPL-2.0-or-later"

livecheck do
url :stable
regex(/autopsy[._-]v?(\d+(?:\.\d+)+)/i)
strategy :github_latest
end

bottle do
sha256 cellar: :any_skip_relocation, arm64_sequoia: "dbb4291f1325784e67d172ee19b80d1557ae45ee1e0cc9be8da5e1baf0b08374"
sha256 cellar: :any_skip_relocation, arm64_sonoma: "0b7daff147ae1d82a0dee7c5f3d853b0b6015af1bf2fde65f23676feae1b7895"
Expand All @@ -20,89 +26,61 @@
sha256 cellar: :any_skip_relocation, x86_64_linux: "5e1ce8b5147639d7737a4013030ee2a059d1b8dd4657554e08e9423a9a6b2f66"
end

# Installs prebuilt binaries, broken on arm: https://github.com/Homebrew/homebrew-core/issues/175053
deprecate! date: "2024-06-22", because: :does_not_build
Comment on lines -23 to -24
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this, but it looks like the reason we deprecated it still applies:

  autopsy
    * Binaries built for a non-native architecture were installed into autopsy's prefix.
      The offending files are:
        /opt/homebrew/Cellar/autopsy/4.21.0/libexec/autopsy/markmckinnon/Export_srudb_macos	(x86_64)
        /opt/homebrew/Cellar/autopsy/4.21.0/libexec/autopsy/markmckinnon/parse_prefetch_macos	(x86_64)
        /opt/homebrew/Cellar/autopsy/4.21.0/libexec/platform/modules/lib/x86_64/libjnidispatch-nb.jnilib	(x86_64)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carlocab the formula is still being worked on I was just testing what was the issue with the old formula

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, no problem! Please feel free to continue working on this.

When you feel that this PR is close to ready, please edit your commit message to read

autopsy 4.21.0

Thanks!


depends_on "cmake" => :build
depends_on "jpeg-turbo"
depends_on "libheif"
depends_on "openjdk"
depends_on "sleuthkit"
depends_on "testdisk"
depends_on "zlib"

uses_from_macos "perl"

on_linux do
depends_on "file-formula"
depends_on "grep"
depends_on "md5sha1sum"
end

# fixes weird configure script that wouldn't work nicely with homebrew
patch :DATA

def autcfg
# Although these binaries are usually available on Linux, they can be in different locations
# so we use the brewed versions instead.

grep = "/usr/bin/grep"
file = "/usr/bin/file"
md5 = "/sbin/md5"
sha1 = "/usr/bin/shasum"

on_linux do
grep = Formula["grep"].opt_bin/"grep"
file = Formula["file"].opt_bin/"file"
md5 = Formula["md5sha1sum"].opt_bin/"md5sum"
sha1 = Formula["md5sha1sum"].opt_bin/"sha1sum"
end

<<~EOS
# Autopsy configuration settings

# when set to 1, the server will stop after it receives no
# connections for STIMEOUT seconds.
$USE_STIMEOUT = 0;
$STIMEOUT = 3600;

# number of seconds that child waits for input from client
$CTIMEOUT = 15;

# set to 1 to save the cookie value in a file (for scripting)
$SAVE_COOKIE = 1;

$INSTALLDIR = '#{prefix}';


# System Utilities
$GREP_EXE = '#{grep}';
$FILE_EXE = '#{file}';
$MD5_EXE = '#{md5}';
$SHA1_EXE = '#{sha1}';


# Directories
$TSKDIR = '#{Formula["sleuthkit"].opt_bin}';

# Homebrew users can install NSRL database and change this variable later
$NSRLDB = '';

# Evidence locker location
$LOCKDIR = '#{var}/lib/autopsy';
EOS
resource "autopsy-src" do
url "https://github.com/sleuthkit/autopsy/archive/refs/tags/autopsy-4.21.0.tar.gz"
sha256 "044d8466edb995c619ef310a6ca0a2216cb5c63d32395b718aea129bab78649c"
end

def install
(var+"lib/autopsy").mkpath
mv "lib", "libexec"
prefix.install %w[global.css help libexec pict]
prefix.install Dir["*.txt"]
(prefix+"conf.pl").write autcfg
inreplace "base/autopsy.base", "/tmp/autopsy", prefix
inreplace "base/autopsy.base", "lib/define.pl", "#{libexec}/define.pl"
bin.install "base/autopsy.base" => "autopsy"
end

def caveats
<<~EOS
By default, the evidence locker is in:
#{var}/lib/autopsy
EOS
rm_r(Dir["**/*.{cmd,dll,exe}", "platform/modules/lib/{aarch64,i386,riscv64}"])
libexec.install Dir["*"]
bin.install_symlink Dir[libexec/"bin/*"]

# Ensure correct zlib linkage
zlib_dir = Formula["zlib"].opt_lib
ENV.prepend "LDFLAGS", "-L#{zlib_dir}"
ENV.prepend "CPPFLAGS", "-I#{Formula["zlib"].opt_include}"

# Perform setup based on https://github.com/sleuthkit/autopsy/blob/develop/unix_setup.sh
java_home = Language::Java.java_home
inreplace libexec/"etc/autopsy.conf", /^#jdkhome=.*$/, "jdkhome=\"#{java_home}\""
sleuthkit_jar = "sleuthkit-#{Formula["sleuthkit"].version}.jar"
(libexec/"autopsy/modules/ext"/sleuthkit_jar).unlink
(libexec/"autopsy/modules/ext").install_symlink Formula["sleuthkit"].opt_share/"java"/sleuthkit_jar
chmod "+x", libexec.glob("autopsy/markmckinnon/{Export,parse}*")
chmod "+x", libexec.glob("autopsy/solr/bin/**/*")
chmod "+x", libexec/"bin/autopsy"

# Rebuild binaries with broken linkage
modules_libdir = libexec/"autopsy/modules/lib"
if Hardware::CPU.arm?
# Remove non-native binaries for arm64
rm_r(libexec/"autopsy/markmckinnon/Export_srudb_macos")
rm_r(libexec/"autopsy/markmckinnon/parse_prefetch_macos")
rm_r(libexec/"platform/modules/lib/x86_64/libjnidispatch-nb.jnilib")
else
%w[x86_64 amd64].each do |arch|
(modules_libdir/arch/"libheifconvert.dylib").unlink
(modules_libdir/arch/"libheifconvert.so").unlink
end
end
resource("autopsy-src").stage do
ENV["JAVA_HOME"] = java_home
system "cmake", "-S", "thirdparty/libheif/HeifConvertJNI", "-B", "build",
"-DCMAKE_INSTALL_BINDIR=.",
*std_cmake_args(install_prefix: libexec/"autopsy/modules/lib/x86_64", install_libdir: ".")
system "cmake", "--build", "build"
system "cmake", "--install", "build"
end
(modules_libdir/"amd64").install_symlink modules_libdir/"x86_64"/shared_library("libheifconvert")
end

test do
Expand All @@ -112,16 +90,3 @@
end
end
end

__END__
diff --git a/base/autopsy.base b/base/autopsy.base
index 3b3bbdc..a0d2632 100644
--- a/base/autopsy.base
+++ b/base/autopsy.base
@@ -1,3 +1,6 @@
+#!/usr/bin/perl -wT
+use lib '/tmp/autopsy/';
+use lib '/tmp/autopsy/libexec/';
#
# autopsy gui server
# Autopsy Forensic Browser
Loading