From cf25628836d345ba4f46563d23ac1cbec95e6ff969b6333e8324decc20d6aa63 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Fri, 23 Feb 2024 08:10:09 +0000 Subject: [PATCH] - When building systemd rpms in place (i.e. rpmbuild --build-in-place), the version of systemd is now retrieved from the file "meson.version" by default. This file is supposed to contain a string that described the full version of the systemd project. - Overriding of %systemd_version/%systemd_release is now limited to builds of rpms in place cases. OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1496 --- files.systemd | 4 ++-- systemd.changes | 12 ++++++++++++ systemd.spec | 24 ++++++++++++------------ 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/files.systemd b/files.systemd index 4838f6ba..361e6afc 100644 --- a/files.systemd +++ b/files.systemd @@ -209,8 +209,8 @@ %{_libdir}/libnss_myhostname.so.2 %{_libdir}/libnss_systemd.so.2 %endif -%{_libdir}/systemd/libsystemd-core-*.so -%{_libdir}/systemd/libsystemd-shared-*.so +%{_libdir}/systemd/libsystemd-core-%{systemd_major}.so +%{_libdir}/systemd/libsystemd-shared-%{systemd_major}.so %if %{without bootstrap} %{_mandir}/man1/busctl.1.gz %{_mandir}/man1/hostnamectl.1.gz diff --git a/systemd.changes b/systemd.changes index 8f2452b3..8163e39c 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Fri Feb 23 07:51:50 UTC 2024 - Franck Bui + +- When building systemd rpms in place (i.e. rpmbuild --build-in-place), the + version of systemd is now retrieved from the file "meson.version" by + default. This file is supposed to contain a string that described the full + version of the systemd project. + +- Overriding of %systemd_version/%systemd_release is now limited to builds of + rpms in place cases. + ------------------------------------------------------------------- Thu Feb 22 09:47:41 UTC 2024 - Franck Bui @@ -16,6 +27,7 @@ Tue Feb 20 12:22:42 UTC 2024 - Daan De Meyer as well. By building the rpms using the opensuse packaging specs, the idea is to catch more issues ahead of time as the mkosi environment will behave more like a regular opensuse system. + - Add new %version_override and %version_release macros to allow overriding the version and release of the rpm respectively. diff --git a/systemd.spec b/systemd.spec index bfd83789..ed46d348 100644 --- a/systemd.spec +++ b/systemd.spec @@ -18,18 +18,20 @@ %global flavor @BUILD_FLAVOR@%{nil} -%define archive_version +suse.30.g31f1148f75 +%define systemd_version 254.9 +%define systemd_release 0 +%define archive_version +suse.30.g31f1148f75 -%if 0%{?version_override} -%define systemd_major %version_override -%define systemd_minor %{nil} -%else -%define systemd_major 254 -%define systemd_minor 9 +%if 0%{?_build_in_place} +# Allow users to specify the version and the release when building the rpm in +# place. When not provided we look for the version in meson.version (introduced +# in v256). +%define systemd_version %{?version_override}%{!?version_override:%(cat meson.version)} +%define systemd_release %{?release_override}%{!?release_override:0} +%define archive_version %{nil} %endif -%define systemd_version %{systemd_major}%{?systemd_minor:.%{systemd_minor}} -%define systemd_release %{?release_override}%{!?release_override:0} +%define systemd_major %{sub %systemd_version 1 3} %define _testsuitedir %{_systemd_util_dir}/tests %define xinitconfdir %{?_distconfdir}%{!?_distconfdir:%{_sysconfdir}}/X11/xinit @@ -92,8 +94,6 @@ fi \ Name: systemd%{?mini} URL: http://www.freedesktop.org/wiki/Software/systemd -# Allow users to specify the version and release when building the rpm by -# setting the %%version_override and %%release_override macros. Version: %systemd_version Release: %systemd_release Summary: A System and Session Manager @@ -750,7 +750,7 @@ export CFLAGS="%{optflags} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2" %meson \ -Dmode=release \ - -Dversion-tag=%{version}%[%{without upstream}?"%{archive_version}":""] \ + -Dversion-tag=%{version}%{archive_version} \ -Ddocdir=%{_docdir}/systemd \ %if %{with split_usr} -Drootprefix=/usr \