podman-4.0.0-6.el9

- set catatonit cflags after configure step, don't explicitly set ldflags
- Related: #2054115

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
This commit is contained in:
Lokesh Mandvekar 2022-02-24 19:22:50 -05:00
parent 5525e505b2
commit 46b16b0292

View File

@ -25,7 +25,7 @@ GO111MODULE=off go build -buildmode pie -compiler gc -tags="rpm_crashtraceback $
Epoch: 2 Epoch: 2
Name: podman Name: podman
Version: 4.0.0 Version: 4.0.0
Release: 5%{?dist} Release: 6%{?dist}
Summary: Manage Pods, Containers and Container Images Summary: Manage Pods, Containers and Container Images
License: ASL 2.0 and GPLv3+ License: ASL 2.0 and GPLv3+
URL: https://%{name}.io/ URL: https://%{name}.io/
@ -181,6 +181,9 @@ dynamic port forwarding.
%endif %endif
sed -i 's;@@PODMAN@@\;$(BINDIR);@@PODMAN@@\;%{_bindir};' Makefile sed -i 's;@@PODMAN@@\;$(BINDIR);@@PODMAN@@\;%{_bindir};' Makefile
tar fx %{SOURCE1} tar fx %{SOURCE1}
pushd catatonit-%{cataver}
sed -i '$d' configure.ac
popd
tar fx %{SOURCE2} tar fx %{SOURCE2}
tar fx %{SOURCE3} tar fx %{SOURCE3}
tar fx %{SOURCE4} tar fx %{SOURCE4}
@ -191,7 +194,21 @@ mv pkg/hooks/README.md pkg/hooks/README-hooks.md
rm -rf docs/source/markdown/containers-mounts.conf.5.md rm -rf docs/source/markdown/containers-mounts.conf.5.md
%build %build
%set_build_flags # build catatonit first because C code
pushd catatonit-%{cataver}
autoreconf -fi
%configure
CFLAGS="%{optflags} -fPIE -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
%{__make} %{?_smp_mflags}
# Make sure we *always* build a static binary for catatonit. Otherwise we'll break containers
# that don't have the necessary shared libs.
file catatonit | grep 'statically linked'
if [ $? != 0 ]; then
echo "ERROR: catatonit binary must be statically linked!"
exit 1
fi
popd
export GO111MODULE=off export GO111MODULE=off
export GOPATH=$(pwd)/_build:$(pwd) export GOPATH=$(pwd)/_build:$(pwd)
CGO_CFLAGS="%{optflags} -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" CGO_CFLAGS="%{optflags} -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
@ -213,10 +230,11 @@ ln -s vendor src
rm -rf vendor/github.com/containers/storage/drivers/register/register_btrfs.go rm -rf vendor/github.com/containers/storage/drivers/register/register_btrfs.go
unset LDFLAGS
# build date. FIXME: Makefile uses '/v2/libpod', that doesn't work here? # build date. FIXME: Makefile uses '/v2/libpod', that doesn't work here?
LDFLAGS="-X %{import_path}/libpod/define.buildInfo=$(date +%s)" LDFLAGS="-X %{import_path}/libpod/define.buildInfo=$(date +%s)"
# build rootlessport first # build rootlessport
%gobuild -o bin/rootlessport %{import_path}/cmd/rootlessport %gobuild -o bin/rootlessport %{import_path}/cmd/rootlessport
export BUILDTAGS="seccomp btrfs_noversion exclude_graphdriver_devicemapper exclude_graphdriver_btrfs $(hack/libdm_tag.sh) $(hack/selinux_tag.sh) $(hack/systemd_tag.sh) $(hack/libsubid_tag.sh)" export BUILDTAGS="seccomp btrfs_noversion exclude_graphdriver_devicemapper exclude_graphdriver_btrfs $(hack/libdm_tag.sh) $(hack/selinux_tag.sh) $(hack/systemd_tag.sh) $(hack/libsubid_tag.sh)"
@ -228,22 +246,6 @@ export BUILDTAGS="remote $BUILDTAGS"
%{__make} docs %{__make} docs
# build catatonit
LDFLAGS="%__global_ldflags"
CFLAGS="%{optflags} -fPIE -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
pushd catatonit-%{cataver}
autoreconf -fi
%configure
%{__make} %{?_smp_mflags}
# Make sure we *always* build a static binary for catatonit. Otherwise we'll break containers
# that don't have the necessary shared libs.
file catatonit | grep 'statically linked'
if [ $? != 0 ]; then
echo "ERROR: catatonit binary must be statically linked!"
exit 1
fi
popd
# build dnsname plugin # build dnsname plugin
unset LDFLAGS unset LDFLAGS
pushd dnsname-%{commit_dnsname} pushd dnsname-%{commit_dnsname}
@ -412,6 +414,10 @@ exit 0
%{_libexecdir}/%{name}/gvproxy %{_libexecdir}/%{name}/gvproxy
%changelog %changelog
* Tue Feb 22 2022 Lokesh Mandvekar <lsm5@redhat.com> - 2:4.0.0-6
- set catatonit cflags after configure step, don't explicitly set ldflags
- Related: #2054115
* Tue Feb 22 2022 Lokesh Mandvekar <lsm5@redhat.com> - 2:4.0.0-5 * Tue Feb 22 2022 Lokesh Mandvekar <lsm5@redhat.com> - 2:4.0.0-5
- revert previous change and run `set_build_flags` before the build process - revert previous change and run `set_build_flags` before the build process
- Related: #2054115 - Related: #2054115