From cbc6145c4118b7b4d97ad360869b8aaf6c712985 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Jul 16 2024 16:18:36 +0000 Subject: Add support for building from a specific branch For our nightly systemd build for the CentOS Hyperscale build it would be very useful to download sources straight from git main on github so let's allow defining the "branch" macro to do just that. --- diff --git a/systemd.spec b/systemd.spec index 8ce14eb..4fadd5f 100644 --- a/systemd.spec +++ b/systemd.spec @@ -57,7 +57,9 @@ License: LGPL-2.1-or-later AND MIT AND GPL-2.0-or-later Summary: System and Service Manager # download tarballs with "spectool -g systemd.spec" -%if %{defined commit} +%if %{defined branch} +Source0: https://github.com/systemd/systemd/archive/refs/heads/%{branch}.tar.gz +%elif %{defined commit} Source0: https://github.com/systemd/systemd/archive/%{commit}/%{name}-%{shortcommit}.tar.gz %else Source0: https://github.com/systemd/systemd/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz @@ -671,7 +673,13 @@ other libraries from systemd-libs. This package conflicts with the main systemd package and is meant for use in exitrds. %prep -%autosetup -n %{?commit:%{name}-%{commit}}%{!?commit:%{name}-%{version_no_tilde}} -p1 +%if %{defined branch} +%autosetup -n %{name}-%{branch} +%elif %{defined commit} +%autosetup -n %{name}-%{commit} +%else +%autosetup -n %{name}-%{version_no_tilde} -p1 +%endif %build %global ntpvendor %(source /etc/os-release; echo ${ID})