From 2d5f45149b7769bf833152253096b98654131a92 Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Tue, 1 Feb 2022 15:45:14 -0500 Subject: [PATCH] resolve docker manpage conflicts With this change, docker manpages will be generated at rpm install time via %post only if %{_bindir}/docker isn't found on the system. Signed-off-by: Lokesh Mandvekar --- containers-common.spec | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/containers-common.spec b/containers-common.spec index 947e33a..5615cb2 100644 --- a/containers-common.spec +++ b/containers-common.spec @@ -96,9 +96,6 @@ for FILE in $(ls *.5.md); do done cp man5/containerignore.5 man5/.containerignore.5 -echo .so man5/Containerfile.5 > man5/Dockerfile.5 -echo .so man5/containerignore.5 > man5/.dockerignore.5 -echo .so man5/containerignore.5 > man5/dockerignore.5 %install # install config and policy files for registries @@ -130,6 +127,14 @@ ln -s %{_sysconfdir}/pki/entitlement %{buildroot}%{_datadir}/rhel/secrets/etc-pk ln -s %{_sysconfdir}/rhsm %{buildroot}%{_datadir}/rhel/secrets/rhsm ln -s %{_sysconfdir}/yum.repos.d/redhat.repo %{buildroot}%{_datadir}/rhel/secrets/redhat.repo +%post +if [[ ! -f %{_bindir}/docker ]]; then + echo .so %{_mandir}/man5/Containerfile.5 > %{_mandir}/man5/Dockerfile.5 + echo .so %{_mandir}/man5/containerignore.5 > %{_mandir}/man5/.dockerignore.5 + echo .so %{_mandir}/man5/containerignore.5 > %{_mandir}/man5/dockerignore.5 + gzip %{_mandir}/man5/{Dockerfile,.dockerignore,dockerignore}.5 +fi + %files %dir %{_sysconfdir}/containers %dir %{_sysconfdir}/containers/certs.d @@ -147,8 +152,13 @@ ln -s %{_sysconfdir}/yum.repos.d/redhat.repo %{buildroot}%{_datadir}/rhel/secret %ghost %{_sysconfdir}/containers/storage.conf %ghost %{_sysconfdir}/containers/containers.conf %dir %{_sharedstatedir}/containers/sigstore -%{_mandir}/man5/*.5.* -%{_mandir}/man5/.*.5.* +%ghost %{_mandir}/man5/Dockerfile.5.gz +%ghost %{_mandir}/man5/dockerignore.5.gz +%ghost %{_mandir}/man5/.dockerignore.5.gz +%{_mandir}/man5/Containerfile.5.gz +%{_mandir}/man5/containerignore.5.gz +%{_mandir}/man5/.containerignore.5.gz +%{_mandir}/man5/containers*.5.gz %dir %{_datadir}/containers %{_datadir}/containers/storage.conf %{_datadir}/containers/containers.conf