diff --git a/podman.spec b/podman.spec index 9253a2c..784eb34 100644 --- a/podman.spec +++ b/podman.spec @@ -7,6 +7,7 @@ GO111MODULE=off go build -buildmode pie -compiler gc -tags="rpm_crashtraceback $ #%%global branch v4.1.1-rhel %global commit0 7fe5a419cfd2880df2028ad3d7fd9378a88a04f4 %global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) +%global cataver 0.1.7 #%%global dnsnamever 1.3.0 %global commit_dnsname 18822f9a4fb35d1349eb256f4cd2bfd372474d84 %global shortcommit_dnsname %(c=%{commit_dnsname}; echo ${c:0:7}) @@ -18,7 +19,7 @@ GO111MODULE=off go build -buildmode pie -compiler gc -tags="rpm_crashtraceback $ Epoch: 2 Name: podman Version: 4.2.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Manage Pods, Containers and Container Images License: ASL 2.0 and GPLv3+ URL: https://%{name}.io/ @@ -27,6 +28,7 @@ Source0: https://%{import_path}/tarball/%{commit0}/%{branch}-%{shortcommit0}.tar %else Source0: https://%{import_path}/archive/%{commit0}/%{name}-%{version}-%{shortcommit0}.tar.gz %endif +Source1: https://github.com/openSUSE/catatonit/archive/v%{cataver}.tar.gz #Source2: https://github.com/containers/dnsname/archive/v%%{dnsnamever}.tar.gz Source2: https://github.com/containers/dnsname/archive/%{commit_dnsname}/dnsname-%{shortcommit_dnsname}.tar.gz Source3: https://github.com/containers/%{name}-machine-cni/archive/%{commit_mcni}/%{name}-machine-cni-%{shortcommit_mcni}.tar.gz @@ -64,8 +66,9 @@ Requires: (container-selinux if selinux-policy) Requires: slirp4netns >= 0.4.0-1 Recommends: crun Requires: fuse-overlayfs -Suggests: catatonit >= 3:0.1.7-2 +Requires: %{name}-catatonit >= %{epoch}:%{version}-%{release} Requires: oci-runtime +Conflicts: catatonit %description %{name} (Pod Manager) is a fully featured container engine that is a simple @@ -105,6 +108,25 @@ service activated. Credentials for this session can be passed in using flags, environment variables, or in containers.conf. +%package catatonit +Summary: A signal-forwarding process manager for containers +Requires: %{name} = %{epoch}:%{version}-%{release} +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: file +BuildRequires: gcc +BuildRequires: libtool + +%description catatonit +Catatonit is a /sbin/init program for use within containers. It +forwards (almost) all signals to the spawned child, tears down +the container when the spawned child exits, and otherwise +cleans up other exited processes (zombies). + +This is a reimplementation of other container init programs (such as +"tini" or "dumb-init"), but uses modern Linux facilities (such as +signalfd(2)) and has no additional features. + %package plugins Summary: Plugins for %{name} Requires: dnsmasq @@ -155,6 +177,10 @@ dynamic port forwarding. %endif sed -i 's;@@PODMAN@@\;$(BINDIR);@@PODMAN@@\;%{_bindir};' Makefile sed -i 's,-Werror,,' pkg/rootless/rootless_linux.go +tar fx %{SOURCE1} +pushd catatonit-%{cataver} +sed -i '$d' configure.ac +popd tar fx %{SOURCE2} tar fx %{SOURCE3} tar fx %{SOURCE4} @@ -163,6 +189,21 @@ tar fx %{SOURCE4} rm -rf docs/source/markdown/containers-mounts.conf.5.md %build +# 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 GOPATH=$(pwd)/_build:$(pwd) CGO_CFLAGS="%{optflags} -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" @@ -255,6 +296,14 @@ for file in `find %{buildroot}%{_mandir}/man[15] -type f | sed "s,%{buildroot},, echo "$file*" >> podman.file-list done +# install catatonit +install -dp %{buildroot}%{_libexecdir}/catatonit +install -p catatonit-%{cataver}/catatonit %{buildroot}%{_libexecdir}/catatonit +install -dp %{buildroot}%{_libexecdir}/podman +install -dp %{buildroot}%{_datadir}/licenses/podman-catatonit +install -p catatonit-%{cataver}/COPYING %{buildroot}%{_datadir}/licenses/podman-catatonit/COPYING +ln -s %{_libexecdir}/catatonit/catatonit %{buildroot}%{_libexecdir}/podman/catatonit + # install dnsname plugin pushd dnsname-%{commit_dnsname} %{__make} PREFIX=%{_prefix} DESTDIR=%{buildroot} install @@ -344,6 +393,14 @@ fi %dir %{_datadir}/zsh/site-functions %{_datadir}/zsh/site-functions/_%{name}-remote +%files catatonit +%license COPYING +%doc README.md +%dir %{_libexecdir}/catatonit +%{_libexecdir}/catatonit/catatonit +%dir %{_libexecdir}/podman +%{_libexecdir}/podman/catatonit + %files plugins %license dnsname-%{commit_dnsname}/LICENSE %doc dnsname-%{commit_dnsname}/{README.md,README_PODMAN.md} @@ -361,6 +418,10 @@ fi %{_libexecdir}/%{name}/gvproxy %changelog +* Mon Aug 22 2022 Jindrich Novy - 2:4.2.0-2 +- readd catatonit +- Related: #2061316 + * Thu Aug 11 2022 Jindrich Novy - 2:4.2.0-1 - update to latest content of https://github.com/containers/podman/releases/tag/4.2.0 (https://github.com/containers/podman/commit/7fe5a419cfd2880df2028ad3d7fd9378a88a04f4) diff --git a/sources b/sources index e378d86..d95d3bc 100644 --- a/sources +++ b/sources @@ -1,4 +1,5 @@ SHA512 (dnsname-18822f9.tar.gz) = de371722fbf18cd23b31485ee7ba36bb41d0d9a932d15e50872989c3ca1ff7246da63143c3725d81089fadda3821a54c18b22150d9d16005b07df6824f5f71f8 SHA512 (podman-4.2.0-7fe5a41.tar.gz) = 387837d56267de5ec3be394ca0c754d95df368b3744d36f3f58814b634c9f4484492a174e0a8d15f8daadbec61e00e28a20156ebb0d0546bbeb3327b10c5d029 SHA512 (podman-machine-cni-0749884.tar.gz) = fe5f6a69118c0d3475c76c61bf1b50f1d5772fe9a4d20b23e59010e72f8cbd7fb7d4091ce8ab43af8becf77e5234b63191e3e01932f30f8386235822de2e42f4 +SHA512 (v0.1.7.tar.gz) = 7d3174c60e1c8bd1f4b95b7751ccbe01cac63265060f18914b53311f68f7b4c63c693604f348ccfac5db4a96939169f835fbbbd614803b18062053d94f7dca67 SHA512 (v0.2.0.tar.gz) = 75c71f874d624b0cfe8a3df347072a90a7e3f73a519bbd80296f7ca8ff4ed8cf09167c43a6d3c1c4c19bd074c11a506c2fd7e020ba4289e96419ee7d799ddc83