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

Changes for building plaso rpm #1202

Merged
merged 4 commits into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion data/projects.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1599,9 +1599,10 @@ description_short: Interface Python with pkg-config
description_long: Interface Python with pkg-config

[plaso]
homepage_url: http://plaso.kiddaland.net
homepage_url: https://plaso.readthedocs.io/en/latest
download_url: https://github.com/log2timeline/plaso/releases
git_url: https://github.com/log2timeline/plaso.git
rpm_template_spec: plaso.spec

[prometheus_flask_exporter]
version: >=0.18.1
Expand Down
77 changes: 77 additions & 0 deletions data/rpm_templates/plaso.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
%define name plaso
%define version {version}
%define release 1

Summary: Plaso (log2timeline) - Super timeline all the things
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: Log2Timeline maintainers <[email protected]>
Packager: Log2Timeline maintainers <[email protected]>
Url: https://github.com/log2timeline/plaso
BuildRequires: python3-devel, python3-setuptools

%description
Plaso (log2timeline) is a framework to create super timelines. Its purpose is to extract timestamps from various files found on typical computer systems and aggregate them.

%package -n %{{name}}-data
Summary: Data files for Plaso (log2timeline).

%description -n %{{name}}-data
Plaso (log2timeline) is a framework to create super timelines. Its purpose is to extract timestamps from various files found on typical computer systems and aggregate them.

%package -n python3-%{{name}}
Requires: plaso-data == %{{version}}, {rpm_requires}
Summary: Python 3 module of Plaso (log2timeline) - Super timeline all the things

%description -n python3-%{{name}}
Plaso (log2timeline) is a framework to create super timelines. Its purpose is to extract timestamps from various files found on typical computer systems and aggregate them.

%package -n %{{name}}-tools
Requires: python3-plaso == %{{version}}
Summary: Tools for Plaso (log2timeline).

%description -n %{{name}}-tools
Plaso (log2timeline) is a framework to create super timelines. Its purpose is to extract timestamps from various files found on typical computer systems and aggregate them.

%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/plaso/
mv %{{buildroot}}/usr/lib/python*/site-packages/plaso/data/* %{{buildroot}}/usr/share/plaso/
rmdir %{{buildroot}}/usr/lib/python*/site-packages/plaso/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}}/plaso
%{{python3_sitelib}}/plaso*.egg-info

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

%changelog
* {date_time} log2timeline development team <[email protected]> {version}-1
- Auto-generated
14 changes: 2 additions & 12 deletions l2tdevtools/build_helpers/rpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,11 +458,6 @@ def _GenerateSpecFile(

spec_file_generator = spec_file.RPMSpecFileGenerator(self._data_path)

log_file_path = os.path.join('..', self.LOG_FILENAME)
if not spec_file_generator.GenerateWithSetupPy(
source_directory, log_file_path):
return None

if project_name.startswith('python-'):
project_name = project_name[7:]

Expand All @@ -473,7 +468,7 @@ def _GenerateSpecFile(
output_file_path = os.path.join(self._rpmbuild_specs_path, spec_filename)

try:
result = spec_file_generator.RewriteSetupPyGeneratedFile(
result = spec_file_generator.Generate(
self._project_definition, source_directory, source_package_filename,
project_name, project_version, input_file_path, output_file_path)
except FileNotFoundError:
Expand Down Expand Up @@ -741,11 +736,6 @@ def _GenerateSpecFile(

spec_file_generator = spec_file.RPMSpecFileGenerator(self._data_path)

log_file_path = os.path.join('..', self.LOG_FILENAME)
if not spec_file_generator.GenerateWithSetupPy(
source_directory, log_file_path):
return None

if project_name.startswith('python-'):
project_name = project_name[7:]

Expand All @@ -756,7 +746,7 @@ def _GenerateSpecFile(
output_file_path = os.path.join(self._rpmbuild_specs_path, spec_filename)

try:
result = spec_file_generator.RewriteSetupPyGeneratedFile(
result = spec_file_generator.Generate(
self._project_definition, source_directory, source_package_filename,
project_name, project_version, input_file_path, output_file_path)
except FileNotFoundError:
Expand Down
Loading
Loading