mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
[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 <lsm5@fedoraproject.org> ``` 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 <lsm5@fedoraproject.org>
This commit is contained in:
@ -45,6 +45,12 @@
|
|||||||
# podman-machine subpackage will be present only on these architectures
|
# podman-machine subpackage will be present only on these architectures
|
||||||
%global machine_arches x86_64 aarch64
|
%global machine_arches x86_64 aarch64
|
||||||
|
|
||||||
|
%if %{defined copr_build}
|
||||||
|
%define build_origin Copr: %{?copr_username}/%{?copr_projectname}
|
||||||
|
%else
|
||||||
|
%define build_origin %{?packager}
|
||||||
|
%endif
|
||||||
|
|
||||||
Name: podman
|
Name: podman
|
||||||
%if %{defined copr_build}
|
%if %{defined copr_build}
|
||||||
Epoch: 102
|
Epoch: 102
|
||||||
@ -242,6 +248,7 @@ export CGO_CFLAGS+=" -m64 -mtune=generic -fcf-protection=full"
|
|||||||
export GOPROXY=direct
|
export GOPROXY=direct
|
||||||
|
|
||||||
LDFLAGS="-X %{ld_libpod}/define.buildInfo=${SOURCE_DATE_EPOCH:-$(date +%s)} \
|
LDFLAGS="-X %{ld_libpod}/define.buildInfo=${SOURCE_DATE_EPOCH:-$(date +%s)} \
|
||||||
|
-X "%{ld_libpod}/define.buildOrigin=%{build_origin}" \
|
||||||
-X %{ld_libpod}/config._installPrefix=%{_prefix} \
|
-X %{ld_libpod}/config._installPrefix=%{_prefix} \
|
||||||
-X %{ld_libpod}/config._etcDir=%{_sysconfdir} \
|
-X %{ld_libpod}/config._etcDir=%{_sysconfdir} \
|
||||||
-X %{ld_project}/pkg/systemd/quadlet._binDir=%{_bindir}"
|
-X %{ld_project}/pkg/systemd/quadlet._binDir=%{_bindir}"
|
||||||
|
Reference in New Issue
Block a user