Skip to content

Commit

Permalink
Changes for building artifacts rpm (log2timeline#1223)
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz authored Mar 3, 2024
1 parent 11c69fe commit e0f843c
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
3 changes: 3 additions & 0 deletions data/projects.ini
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ description_long: A library for parsing ISO 8601 strings.

[artifacts]
version: >=20150409
homepage_url: https://artifacts.readthedocs.io/en/latest/
download_url: https://github.com/ForensicArtifacts/artifacts/releases
git_url: https://github.com/ForensicArtifacts/artifacts.git
rpm_template_spec: artifacts.spec

[asn1crypto]
dpkg_name: python-asn1crypto
Expand Down
77 changes: 77 additions & 0 deletions data/rpm_templates/artifacts.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
%define name artifacts
%define version {version}
%define release 1

Summary: ForensicArtifacts.com Artifact Repository.
Name: %{{name}}
Version: %{{version}}
Release: %{{release}}
Source0: %{{name}}-%{{version}}.tar.gz
License: Apache License, Version 2.0
Group: Development/Libraries
BuildRoot: %{{_tmppath}}/%{{name}}-%{{version}}-%{{release}}-buildroot
Prefix: %{{_prefix}}
BuildArch: noarch
Vendor: Forensic artifacts <[email protected]>
Packager: Forensic artifacts <[email protected]>
Url: https://github.com/ForensicArtifacts/artifacts
BuildRequires: python3-devel, python3-setuptools

%description
A free, community-sourced, machine-readable knowledge base of forensic artifacts that the world can use both as an information source and within other tools.

%package -n %{{name}}-data
Summary: Data files for ForensicArtifacts.com Artifact Repository.

%description -n %{{name}}-data
A free, community-sourced, machine-readable knowledge base of forensic artifacts that the world can use both as an information source and within other tools.

%package -n python3-%{{name}}
Requires: artifacts-data == %{{version}}, {rpm_requires}
Summary: Python 3 module of ForensicArtifacts.com Artifact Repository.

%description -n python3-%{{name}}
A free, community-sourced, machine-readable knowledge base of forensic artifacts that the world can use both as an information source and within other tools.

%package -n %{{name}}-tools
Requires: python3-artifacts >= %{{version}}
Summary: Tools for ForensicArtifacts.com Artifact Repository.

%description -n %{{name}}-tools
A free, community-sourced, machine-readable knowledge base of forensic artifacts that the world can use both as an information source and within other tools.

%prep
%autosetup -n %{{name}}-%{{version}}

%build
%py3_build

%install
%py3_install
rm -rf %{{buildroot}}/usr/lib/python*/site-packages/*.egg-info/requires.txt
rm -rf %{{buildroot}}/usr/share/doc/%{{name}}/
mkdir -p %{{buildroot}}/usr/share/artifacts/
mv %{{buildroot}}/usr/lib/python*/site-packages/artifacts/data/* %{{buildroot}}/usr/share/artifacts/
rmdir %{{buildroot}}/usr/lib/python*/site-packages/artifacts/data
for FILENAME in %{{buildroot}}/usr/bin/*; do mv ${{FILENAME}} ${{FILENAME}}.py; done

%clean
rm -rf %{{buildroot}}

%files -n %{{name}}-data
%license LICENSE
%doc ACKNOWLEDGEMENTS AUTHORS README
%{{_datadir}}/%{{name}}/*

%files -n python3-%{{name}}
%license LICENSE
%doc README
%{{python3_sitelib}}/artifacts
%{{python3_sitelib}}/artifacts*.egg-info

%files -n %{{name}}-tools
%{{_bindir}}/*

%changelog
* {date_time} log2timeline development team <[email protected]> {version}-1
- Auto-generated

0 comments on commit e0f843c

Please sign in to comment.