Skip to content

Commit 07cac00

Browse files
author
alexandr.lushin
committed
Add RPM-packaging scripts and spec file
Signed-off-by: alexandr.lushin <[email protected]>
1 parent 00aefec commit 07cac00

File tree

5 files changed

+74
-1
lines changed

5 files changed

+74
-1
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
# Build directories
66
/target
77
/output
8+
/rpmbuild
9+
10+
# Vendor
11+
/vendor
812

913
# OS Files
1014
.DS_Store

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ authors = ["Christopher Sardegna <[email protected]>"]
33
categories = ["command-line-interface", "command-line-utilities"]
44
description = "A powerful CLI tool that puts log analytics at your fingertips."
55
edition = "2024"
6-
exclude = ["/resources", ".github", "docs", "build.sh"]
6+
exclude = ["/resources", ".github", "docs", "build.sh", "packaging", "build-srpm.sh"]
77
keywords = ["cli", "tui", "logs", "log-parsing", "log-analytics"]
88
license = "GPL-3.0-or-later"
99
name = "logria"

build-srpm.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
#
3+
4+
set -e
5+
6+
source ./version.sh
7+
TARBALL=logria-$VERSION.tar.gz
8+
9+
mkdir -p output
10+
rm -rf rpmbuild
11+
12+
cargo vendor
13+
tar -czf logria-$VERSION-vendor.tar.gz vendor
14+
sed -e "s/@VERSION@/$VERSION/; s/@RELEASE@/$RELEASE/" ./packaging/logria.spec.in > logria.spec
15+
find ./* \
16+
! -name 'packaging' \
17+
! -name 'rpmbuild' \
18+
! -name 'exported-artifacts' \
19+
! -name '.git' \
20+
-type f | tar --files-from /proc/self/fd/0 -czf "$TARBALL" --transform "s,^,logria-$VERSION/,"
21+
22+
mkdir -p rpmbuild/{SPECS,SOURCES,BUILD,BUILDROOT,SRPMS}
23+
mv *.tar.gz rpmbuild/SOURCES
24+
mv logria.spec rpmbuild/SPECS
25+
26+
rpmbuild -bs --define "_topdir `pwd`/rpmbuild" `pwd`/rpmbuild/SPECS/logria.spec
27+
28+
mv rpmbuild/SRPMS/* output

packaging/logria.spec.in

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Name: logria
2+
Version: @VERSION@
3+
Release: @RELEASE@%{?dist}
4+
Summary: A powerful CLI tool that puts log aggregation at your fingertips
5+
6+
License: GPL-3.0
7+
URL: https://github.com/ReagentX/Logria
8+
Source0: %{name}-%{version}.tar.gz
9+
Source1: %{name}-%{version}-vendor.tar.gz
10+
11+
BuildRequires: rust >= 1.88.0
12+
BuildRequires: cargo
13+
14+
%description
15+
Logria is best leveraged to watch live logs from multiple processes and filter them for events you want to see. My most common use case is watching logs from multiple Linode/EC2 instances via ssh or multiple CloudWatch streams using aws logs.
16+
17+
18+
%prep
19+
%autosetup
20+
21+
%build
22+
cargo build --release
23+
24+
%install
25+
mkdir -p %{buildroot}%{_bindir}
26+
install -D -m 0755 target/release/%{name} %{buildroot}%{_bindir}
27+
28+
29+
%files
30+
%{_bindir}/%{name}
31+
%license LICENSE
32+
%doc README.md
33+
34+
35+
%changelog
36+
* Mon Nov 24 2025 Alexander Lushin <[email protected]> - 0.4.2-1
37+
- Initial build

version.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
export VERSION=0.4.2
4+
export RELEASE=1

0 commit comments

Comments
 (0)