Skip to content

Commit b06c7d7

Browse files
committed
[skip-ci] RPM: set buildOrigin in LDFLAG
For Copr builds, it will mention the Copr info from where the rpm is installed. For non-copr builds, it will mention the value of the packager macro if set, and skip this field altogether if not. On local rpm builds, this shows: ``` Build Origin: Lokesh Mandvekar <[email protected]> ``` On koji rpm builds, this shows: ``` Build Origin: Fedora Project ``` On copr rpm builds (for eg. rhcontainerbot/playground), this shows: ``` Build Origin: Copr: rhcontainerbot/playground ``` Signed-off-by: Lokesh Mandvekar <[email protected]>
1 parent 7185d46 commit b06c7d7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

rpm/podman.spec

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@
4545
# podman-machine subpackage will be present only on these architectures
4646
%global machine_arches x86_64 aarch64
4747

48+
%if %{defined copr_build}
49+
%define build_origin Copr: %{?copr_username}/%{?copr_projectname}
50+
%else
51+
%define build_origin %{?packager}
52+
%endif
53+
4854
Name: podman
4955
%if %{defined copr_build}
5056
Epoch: 102
@@ -242,6 +248,7 @@ export CGO_CFLAGS+=" -m64 -mtune=generic -fcf-protection=full"
242248
export GOPROXY=direct
243249

244250
LDFLAGS="-X %{ld_libpod}/define.buildInfo=${SOURCE_DATE_EPOCH:-$(date +%s)} \
251+
-X "%{ld_libpod}/define.buildOrigin=%{build_origin}" \
245252
-X %{ld_libpod}/config._installPrefix=%{_prefix} \
246253
-X %{ld_libpod}/config._etcDir=%{_sysconfdir} \
247254
-X %{ld_project}/pkg/systemd/quadlet._binDir=%{_bindir}"

0 commit comments

Comments
 (0)