new attempt for purging unnecessary libs

This commit is contained in:
Greg DiCristofaro 2023-08-01 20:31:03 -04:00
parent c3a3f7ddbc
commit c83ac1b587

View File

@ -16,8 +16,6 @@
# Snap uses assertions to digitally sign snaps (https://snapcraft.io/docs/assertions). Otherwise, snaps need to be installed with the `--dangerous` flag
# it would be best to install autopsy with `sudo snap install --dangerous autopsy` and then connect all super-priveleged interfaces or `sudo snap install --dangerous --devmode autopsy``
# yaml reference here: https://snapcraft.io/docs/snapcraft-yaml-reference
# sample yaml files here: https://github.com/videolan/vlc/blob/master/extras/package/snap/snapcraft.yaml, https://github.com/canonical/firefox-snap/blob/stable/snapcraft.yaml
name: autopsy
@ -50,6 +48,12 @@ plugs:
interface: browser-support
allow-sandbox: true
slots:
dbus-daemon:
interface: dbus
bus: session
name: org.sleuthkit.autopsy
apps:
autopsy:
# more on env vars here: https://snapcraft.io/docs/environment-variables
@ -103,6 +107,8 @@ apps:
- system-files-autopsy
- system-files-hugepages
- system-observe
slots:
- dbus-daemon
parts:
sleuthkit:
@ -137,6 +143,20 @@ parts:
- libewf-dev
- libvhdi-dev
- libvmdk-dev
# taken from https://github.com/ubuntu/libreoffice/blob/7.3/snapcraft.yaml, https://github.com/ubuntu/thunderbird/blob/stable/snapcraft.yaml
prime:
- -usr/lib/*/libgio*
- -usr/lib/*/libglib*
- -usr/lib/*/libgm*
- usr/lib/*/lib*
- -usr/lib/*/libgtk*
- -usr/lib/*/libgdk*
- -usr/lib/*/libcairo*
- -usr/lib/*/libpango*
- -usr/lib/*/libwayland*
- usr/lib/*/mesa/lib*
- usr/share/java/
- usr/sbin/*
autopsy:
after: [sleuthkit]
# information on packages here: https://snapcraft.io/docs/package-repositories
@ -225,6 +245,21 @@ parts:
# include this line to print all set variables
# sed -i '129 i set -o posix ; echo $(set) >&2 ; ls -l "${jdkhome}/bin/java"' "$AUTOPSY_LOCATION/platform/lib/nbexec"
# taken from https://github.com/ubuntu/libreoffice/blob/7.3/snapcraft.yaml, https://github.com/ubuntu/thunderbird/blob/stable/snapcraft.yaml
prime:
- -usr/lib/*/libgio*
- -usr/lib/*/libglib*
- -usr/lib/*/libgm*
- usr/lib/*/lib*
- -usr/lib/*/libgtk*
- -usr/lib/*/libgdk*
- -usr/lib/*/libcairo*
- -usr/lib/*/libpango*
- -usr/lib/*/libwayland*
- usr/lib/*/mesa/lib*
- usr/share/java/
- usr/sbin/*
# taken from https://github.com/ubuntu/thunderbird/blob/stable/snapcraft.yaml
# Find files provided by the base and platform snap and ensure they aren't
# duplicated in this snap
@ -236,7 +271,7 @@ parts:
override-prime: |
set -eux
for snap in "core22" "gnome-42-2204"; do
cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$CRAFT_PRIME/{}" \;
cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$SNAPCRAFT_PRIME/{}" \;
done
# taken from https://github.com/ubuntu/libreoffice/blob/7.3/snapcraft.yaml