fix(packaging): use version from spec file for RPM builds
Some checks failed
Build RPM Package / Build RPM Packages (CentOS 7, Rocky 8/9/10) (push) Has been cancelled

- Update Makefile to extract PKG_VERSION from spec file
  Reads '%define spec_version 1.0.2' as default version
- Update spec file with proper version macro logic
  Version field now uses %{spec_version}
  Supports override via --define 'build_version X.Y.Z'
  Falls back to 1.0.2 when build_version is not defined

This ensures RPM packages are built with the correct version
defined in the spec file (1.0.2) instead of hardcoded 1.0.0.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
Jacquin Antoine
2026-03-01 00:38:21 +01:00
parent 9ff0e7f9d2
commit 78c9102602
2 changed files with 10 additions and 6 deletions

View File

@ -20,11 +20,8 @@ BUILD_DIR=build
# RPM build directory
RPM_DIR=$(DIST_DIR)/rpm
# Package version (strip 'v' prefix from git tags)
# Set to explicit version for release builds, or use git-based version for dev builds
PKG_VERSION ?= 1.0.0
# Alternative git-based version (uncomment for dev builds):
# PKG_VERSION=$(shell git describe --tags --always --dirty 2>/dev/null | sed 's/^v//')
# Package version (extract default from spec file, can be overridden)
PKG_VERSION ?= $(shell grep '^%define spec_version' packaging/rpm/ja4sentinel.spec | tail -1 | awk '{print $$3}')
# Build flags
VERSION=$(PKG_VERSION)

View File

@ -1,11 +1,18 @@
Name: ja4sentinel
Version: %{?build_version}%{!?build_version:1.0.0}
Version: %{spec_version}
Release: 1%{?dist}
Summary: JA4 TLS fingerprinting daemon for network monitoring
License: MIT
URL: https://github.com/your-repo/ja4sentinel
BuildArch: x86_64
# Override version from command line: rpmbuild --define "build_version X.Y.Z"
%if %{defined build_version}
%define spec_version %{build_version}
%else
%define spec_version 1.0.2
%endif
# Distribution-agnostic dependencies
# systemd is available on all target distros (Rocky 8/9/10, AlmaLinux)
Requires: systemd