mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
snapcraft script update
This commit is contained in:
parent
17996195b1
commit
b0e30343aa
@ -1,9 +1,10 @@
|
||||
name: autopsy
|
||||
# core22 brings along linting for share object library paths as well as improvements to get java gstreamer working
|
||||
base: core22
|
||||
version: '4.19.3'
|
||||
version: 4.19.3
|
||||
summary: A graphical interface to The Sleuth Kit and other digital forensics tools. # 79 char long summary
|
||||
description: Autopsy is a graphical interface to The Sleuth Kit and other open source digital forensics tools.
|
||||
description: Autopsy is a graphical interface to The Sleuth Kit and other open source
|
||||
digital forensics tools.
|
||||
grade: stable # must be 'stable' to release into candidate/stable channels
|
||||
# TODO look into turning back to strict for easier store inclusion but more limited usage
|
||||
confinement: classic # use 'strict' once you have the right plugs and slots
|
||||
@ -13,7 +14,7 @@ icon: snap/gui/autopsy.png
|
||||
|
||||
# Java package repo to use with snapcraft
|
||||
package-repositories:
|
||||
- type: apt
|
||||
- type: apt
|
||||
formats: [deb]
|
||||
components: [main]
|
||||
suites: [stable]
|
||||
@ -30,7 +31,7 @@ apps:
|
||||
environment:
|
||||
jdkhome: $SNAP/usr/lib/jvm/bellsoft-java8-full-amd64
|
||||
# provide means for java gstreamer to find gstreamer libs
|
||||
jreflags: "$jreflags \"-Djna.library.path=$SNAP/usr/lib/x86_64-linux-gnu\""
|
||||
jreflags: $jreflags "-Djna.library.path=$SNAP/usr/lib/x86_64-linux-gnu"
|
||||
LD_LIBRARY_PATH: $SNAP/usr/local/lib:$LD_LIBRARY_PATH
|
||||
# make sure path is set up to ensure things like photorec are found
|
||||
PATH: $SNAP/usr/bin:$SNAP/usr/local/bin:$PATH
|
||||
@ -84,8 +85,6 @@ parts:
|
||||
sleuthkit:
|
||||
plugin: autotools
|
||||
source: https://github.com/sleuthkit/sleuthkit.git
|
||||
source-branch: develop
|
||||
# source-tag: sleuthkit-4.11.1
|
||||
build-environment: [JAVA_HOME: /usr/lib/jvm/bellsoft-java8-full-amd64]
|
||||
build-packages:
|
||||
- build-essential
|
||||
@ -111,6 +110,7 @@ parts:
|
||||
- libewf-dev
|
||||
- libvhdi-dev
|
||||
- libvmdk-dev
|
||||
source-tag: sleuthkit-4.11.1
|
||||
autopsy:
|
||||
after: [sleuthkit]
|
||||
build-packages:
|
||||
@ -140,15 +140,11 @@ parts:
|
||||
- bellsoft-java8-full
|
||||
- perl
|
||||
plugin: nil
|
||||
source: https://github.com/gdicristofaro/autopsy.git
|
||||
source-branch: 8425_linuxMacBuild
|
||||
# source: https://github.com/sleuthkit/autopsy.git
|
||||
# source-branch: develop
|
||||
# source-tag: autopsy-4.19.3
|
||||
source: https://github.com/sleuthkit/autopsy.git
|
||||
build-environment:
|
||||
- JAVA_HOME: /usr/lib/jvm/bellsoft-java8-full-amd64
|
||||
- TSK_JAVA_LIB_PATH: $SNAPCRAFT_STAGE/usr/local/share/java
|
||||
override-build: |
|
||||
override-build: |-
|
||||
# ----- BUILD ZIP -----
|
||||
AUTOPSY_SRC_PATH=$(pwd)
|
||||
NETBEANS_PLAT_VER=$(grep "netbeans-plat-version=" "$AUTOPSY_SRC_PATH/nbproject/platform.properties" | cut -d'=' -f2)
|
||||
@ -177,3 +173,4 @@ 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"
|
||||
source-tag: autopsy-4.19.3
|
||||
|
2
snap/version_update/.gitignore
vendored
Normal file
2
snap/version_update/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/.idea
|
||||
/venv
|
3
snap/version_update/requirements.txt
Normal file
3
snap/version_update/requirements.txt
Normal file
@ -0,0 +1,3 @@
|
||||
argparse==1.4.0
|
||||
#PyYAML==6.0
|
||||
ruamel.yaml==0.17.21
|
75
snap/version_update/snap_version_update.py
Normal file
75
snap/version_update/snap_version_update.py
Normal file
@ -0,0 +1,75 @@
|
||||
import sys
|
||||
import argparse
|
||||
import ruamel.yaml
|
||||
from typing import Union
|
||||
from os.path import join, dirname, abspath, realpath
|
||||
|
||||
SNAPCRAFT_YAML_PATH = join(dirname(dirname(abspath(realpath(__file__)))), 'snapcraft.yaml')
|
||||
SLEUTHKIT_REPO = 'https://github.com/sleuthkit/sleuthkit.git'
|
||||
AUTOPSY_REPO = 'https://github.com/sleuthkit/autopsy.git'
|
||||
|
||||
|
||||
def update_versions(sleuthkit_version_tag: str,
|
||||
autopsy_version_tag: str,
|
||||
snapcraft_version: str,
|
||||
snapcraft_yaml_path: Union[str, None],
|
||||
sleuthkit_repo: Union[str, None],
|
||||
autopsy_repo: Union[str, None]):
|
||||
|
||||
snapcraft_yaml_path = snapcraft_yaml_path if snapcraft_yaml_path is not None and len(
|
||||
snapcraft_yaml_path.strip()) > 0 else SNAPCRAFT_YAML_PATH
|
||||
sleuthkit_repo = sleuthkit_repo if sleuthkit_repo is not None and len(
|
||||
sleuthkit_repo.strip()) > 0 else SLEUTHKIT_REPO
|
||||
autopsy_repo = autopsy_repo if autopsy_repo is not None and len(
|
||||
autopsy_repo.strip()) > 0 else AUTOPSY_REPO
|
||||
|
||||
yaml = ruamel.yaml.YAML()
|
||||
with open(snapcraft_yaml_path) as snapcraft_file:
|
||||
yaml_dict = yaml.load(snapcraft_file)
|
||||
|
||||
yaml_dict['version'] = snapcraft_version
|
||||
|
||||
yaml_dict['parts']['sleuthkit']['source'] = sleuthkit_repo
|
||||
yaml_dict['parts']['sleuthkit']['source-tag'] = sleuthkit_version_tag
|
||||
yaml_dict['parts']['sleuthkit'].pop('source-branch', None)
|
||||
|
||||
yaml_dict['parts']['autopsy']['source'] = autopsy_repo
|
||||
yaml_dict['parts']['autopsy']['source-tag'] = autopsy_version_tag
|
||||
yaml_dict['parts']['autopsy'].pop('source-branch', None)
|
||||
|
||||
with open(snapcraft_yaml_path, "w") as snapcraft_file:
|
||||
yaml.dump(yaml_dict, snapcraft_file)
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Updates snapcraft.yml file with current versions of autopsy and sleuthkit",
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
||||
|
||||
parser.add_argument('-s', '--sleuthkit_tag', required=True, dest='sleuthkit_version_tag', type=str,
|
||||
help='The git tag to use for sleuthkit.')
|
||||
parser.add_argument('-a', '--autopsy_tag', required=True, dest='autopsy_version_tag', type=str,
|
||||
help='The git tag to use for autopsy.')
|
||||
parser.add_argument('-v', '--version', required=True, dest='snapcraft_version', type=str,
|
||||
help='Version for snapcraft metadata.')
|
||||
|
||||
parser.add_argument('-p', '--snapcraft_path', dest='snapcraft_yaml_path', type=str, default=SNAPCRAFT_YAML_PATH,
|
||||
help='Path to snapcraft.yaml.')
|
||||
parser.add_argument('--sleuthkit_repo', dest='sleuthkit_repo', type=str, default=SLEUTHKIT_REPO,
|
||||
help='Location of sleuthkit repo.')
|
||||
parser.add_argument('--autopsy_repo', dest='autopsy_repo', type=str, default=AUTOPSY_REPO,
|
||||
help='Location of sleuthkit repo.')
|
||||
|
||||
args = parser.parse_args()
|
||||
update_versions(
|
||||
sleuthkit_version_tag=args.sleuthkit_version_tag,
|
||||
autopsy_version_tag=args.autopsy_version_tag,
|
||||
snapcraft_version=args.snapcraft_version,
|
||||
snapcraft_yaml_path=args.snapcraft_yaml_path,
|
||||
sleuthkit_repo=args.sleuthkit_repo,
|
||||
autopsy_repo=args.autopsy_repo
|
||||
)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
Loading…
x
Reference in New Issue
Block a user