fix: Support Rocky Linux 9 pour le package RPM

Cible: Rocky Linux 9 (compatible RHEL/CentOS)

Changes:
- packaging/Dockerfile.rpm: Build pour Rocky Linux
- packaging/build-rpm.sh: Ajout paramètre distribution (rocky/rhel/centos)
- packaging/rpm/ja4sentinel.spec:
  * Condition %if 0%{?rhel} >= 8 pour compatibilité RHEL
  * Description mise à jour avec Rocky Linux
- packaging/test/Dockerfile.rpm: Test sur Rocky Linux 9
- packaging/test/test-*.sh: Tests spécifiques Rocky Linux
- .github/workflows/build-rpm.yml:
  * Nom du job: 'Build RPM Package (Rocky Linux)'
  * TARGET_DIST: rockylinux:9
  * Simplification du build via Docker

Documentation:
- README.md: Instructions d'installation pour .rpm (Rocky/RHEL) et .deb (Debian/Ubuntu)
- Remplacement des instructions de build par installation via packages

Compatibilité:
- Rocky Linux 8.x et 9.x
- RHEL 8.x et 9.x
- CentOS Stream 8 et 9
- AlmaLinux 8.x et 9.x

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
Jacquin Antoine
2026-02-25 21:17:37 +01:00
parent 61bf05454e
commit 6f7c5450f8
8 changed files with 61 additions and 44 deletions

View File

@ -1,4 +1,4 @@
# Dockerfile for building RPM packages
# Dockerfile for building RPM packages for Rocky Linux
# Use Go 1.24 as base to ensure correct Go version
FROM golang:1.24-bookworm AS builder
@ -21,10 +21,10 @@ RUN mkdir -p dist && \
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 \
go build -buildvcs=false -o dist/ja4sentinel-linux-amd64 ./cmd/ja4sentinel
# Build RPM
# Build RPM for Rocky Linux (RHEL compatible)
ARG ARCH=x86_64
RUN mkdir -p /app/packages && \
./packaging/build-rpm.sh "${VERSION}" "${ARCH}" && \
./packaging/build-rpm.sh "${VERSION}" "${ARCH}" "rocky" && \
cp /app/build/rpm/*.rpm /app/packages/
# Final stage - minimal image with just the RPM

View File

@ -1,12 +1,14 @@
#!/bin/bash
# Build script for .rpm package
# Usage: ./build-rpm.sh [version] [architecture]
# Usage: ./build-rpm.sh [version] [architecture] [distribution]
# distribution: rocky, rhel, centos (default: rocky)
set -e
# Sanitize version for RPM package (must start with digit)
VERSION="${1:-1.0.0}"
ARCH="${2:-x86_64}"
DIST="${3:-rocky}"
PACKAGE_NAME="ja4sentinel"
# Convert git version to RPM-compatible format
@ -18,7 +20,7 @@ else
RPM_VERSION="0.0.0.${VERSION//[^a-zA-Z0-9.]/_}"
fi
echo "=== Building ${PACKAGE_NAME} ${RPM_VERSION} for ${ARCH} ==="
echo "=== Building ${PACKAGE_NAME} ${RPM_VERSION} for ${DIST} (${ARCH}) ==="
# Directories
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

View File

@ -6,9 +6,12 @@ License: MIT
URL: https://github.com/your-repo/ja4sentinel
BuildArch: x86_64
# Runtime dependencies
# Rocky Linux / RHEL compatibility
# Requires EPEL for some dependencies if not in base repos
%if 0%{?rhel} >= 8
Requires: systemd
Requires: libpcap
%endif
%description
JA4Sentinel is a Go-based tool for capturing network traffic on Linux servers,
@ -22,6 +25,7 @@ Features:
- IP/TCP metadata enrichment
- Multiple output formats (stdout, file, UNIX socket)
- Structured JSON logging for systemd/journald
- Compatible with Rocky Linux, RHEL, CentOS
%prep
# No source to unpack, binary is pre-built

View File

@ -1,7 +1,7 @@
# Dockerfile for testing RPM package installation
FROM fedora:39
# Dockerfile for testing RPM package installation on Rocky Linux
FROM rockylinux:9
# Install dependencies
# Install dependencies (libpcap is in base repo on Rocky 9)
RUN dnf install -y \
libpcap \
systemd \

View File

@ -1,9 +1,10 @@
#!/bin/bash
# Test script for RPM package installation
# Test script for RPM package installation on Rocky Linux
set -e
echo "=========================================="
echo " JA4Sentinel RPM Package Installation Test"
echo " Target: Rocky Linux 9"
echo "=========================================="
# Colors for output

View File

@ -1,5 +1,5 @@
#!/bin/bash
# Test RPM package installation in Docker container
# Test RPM package installation in Rocky Linux container
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"