From 4df2711a9f69c979dd8731d8bcd05872afae4a20 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Jan 08 2025 12:14:30 +0000 Subject: Add bcond for OBS-specific quirks The version substitution system is not able to fully subst the current Version field due to the inline use of macros, so you end up with like: 257-123-gabcd257.1 instead of: 257-123-gabcd I.e., the hard-coded 257.1 gets appended to the OBS-specified version. If it was simply hardcoded as 257.1 it would work, but the inline macros throw it off. [skip changelog] --- diff --git a/systemd.spec b/systemd.spec index b526871..0b19b99 100644 --- a/systemd.spec +++ b/systemd.spec @@ -32,6 +32,9 @@ # Build from git main %bcond upstream 0 +# Build with OBS-specific quirks +%bcond obs 0 + # When bootstrap, libcryptsetup is disabled # but auto-features causes many options to be turned on # that depend on libcryptsetup (e.g. libcryptsetup-plugins, homed) @@ -47,7 +50,13 @@ Name: systemd Url: https://systemd.io # Allow users to specify the version and release when building the rpm by # setting the %%version_override and %%release_override macros. +# But don't do that on OBS, otherwise the version subst fails, and will be +# like 257-123-gabcd257.1 instead of 257-123-gabcd +%if %{without obs} Version: %{?version_override}%{!?version_override:257.1} +%else +Version: %{?version_override}%{!?version_override:%(cat meson.version)} +%endif Release: %autorelease %global stable %(c="%version"; [ "$c" = "${c#*.*}" ]; echo $?)