Replace inplace macro with upstream macro

Currently, the inplace macro only influences whether we use
tools/meson-vcs-tag.sh to figure out the version instead of using
the predefined one. But doing an inplace build shouldn't really
affect the version, since it's possible to do an inplace builds that's
not a git main upstream build, so the two concepts are disjoint.

Instead, let's replace the "inplace" macro with an "upstream" macro
to indicate that we're building from systemd git upstream. Aside from
influencing the version, this also disables various patches and adds
a libarchive dependency that was added upstream recently but isn't in
an official release yet.
This commit is contained in:
Daan De Meyer 2024-02-11 12:52:56 +01:00
parent a9172a2e9c
commit a95f14a72e
2 changed files with 16 additions and 5 deletions

View File

@ -7,7 +7,7 @@ and his [talk during ASG2019](https://www.youtube.com/watch?v=fVM1kJrymRM).
git clone https://github.com/systemd/systemd
fedpkg clone systemd fedora-systemd
cd systemd
rpmbuild -bb --build-in-place --noprep --define "_sourcedir $PWD/../fedora-systemd" --define "_rpmdir $PWD/rpms" --with inplace ../fedora-systemd/systemd.spec
rpmbuild -bb --build-in-place --noprep --define "_sourcedir $PWD/../fedora-systemd" --define "_rpmdir $PWD/rpms" --with upstream ../fedora-systemd/systemd.spec
sudo dnf upgrade --setopt install_weak_deps=False rpms/*/*.rpm
```

View File

@ -28,13 +28,12 @@
%bcond tests 1
%bcond lto 1
# Support for quick builds with rpmbuild --build-in-place.
# See README.build-in-place.
%bcond inplace 0
# Build from git main
%bcond upstream 0
Name: systemd
Url: https://systemd.io
%if %{without inplace}
%if %{without upstream}
Version: 255.3
%else
# determine the build information from local checkout
@ -100,6 +99,8 @@ GIT_DIR=../../src/systemd/.git git diffab -M v233..master@{2017-06-15} -- hwdb/[
# than in the next section. Packit CI will drop any patches in this range before
# applying upstream pull requests.
%if %{without upstream}
# Work-around for dracut issue: run generators directly when we are in initrd
# https://bugzilla.redhat.com/show_bug.cgi?id=2164404
# Drop when dracut-060 is available.
@ -115,6 +116,8 @@ Patch0491: https://github.com/systemd/systemd/pull/30846.patch
# Adjust upstream config to use our shared stack
Patch0499: fedora-use-system-auth-in-pam-systemd-user.patch
%endif
%ifarch %{ix86} x86_64 aarch64
%global want_bootloader 1
%endif
@ -206,6 +209,10 @@ BuildRequires: pkgconfig(bash-completion)
BuildRequires: perl
BuildRequires: perl(IPC::SysV)
%if %{with upstream}
BuildRequires: pkgconfig(libarchive)
%endif
%ifnarch %ix86
# bpftool is not built for i368
BuildRequires: bpftool
@ -282,6 +289,10 @@ Recommends: libelf.so.1(ELFUTILS_1.7)%{?elf_bits}
Recommends: libcryptsetup.so.12%{?elf_suffix}
Recommends: libcryptsetup.so.12(CRYPTSETUP_2.4)%{?elf_bits}
%if %{with upstream}
Recommends: libarchive.so.13%{?elf_suffix}
%endif
%description
systemd is a system and service manager that runs as PID 1 and starts the rest
of the system. It provides aggressive parallelization capabilities, uses socket