From 1ca5ab6e9c5436efbc9b81ed74efbe31a73ab5e8 Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Thu, 5 Dec 2024 13:56:58 -0600 Subject: [PATCH] Add man pages to Mac installer This PR adds the man1 pages to the mac installer. It also sticks a small configuration file into /usr/local/etc/man.d that allows macos and the man binary to look for the podman pages in /opt/podman/docs/man. Fixes #24756 Signed-off-by: Brent Baude --- contrib/pkginstaller/package.sh | 5 +++++ contrib/pkginstaller/scripts/postinstall | 4 ++++ contrib/pkginstaller/scripts/preinstall | 6 ++++++ 3 files changed, 15 insertions(+) diff --git a/contrib/pkginstaller/package.sh b/contrib/pkginstaller/package.sh index 4d2cd7cd48..42528c96c5 100755 --- a/contrib/pkginstaller/package.sh +++ b/contrib/pkginstaller/package.sh @@ -14,6 +14,7 @@ tmpBin="contrib/pkginstaller/tmp-bin" binDir="${BASEDIR}/root/podman/bin" libDir="${BASEDIR}/root/podman/lib" +docDir="${BASEDIR}/root/podman/docs/man/man1" version=$(cat "${BASEDIR}/VERSION") arch=$(cat "${BASEDIR}/ARCH") @@ -21,6 +22,10 @@ arch=$(cat "${BASEDIR}/ARCH") function build_podman() { pushd "$1" + make podman-remote-darwin-docs + mkdir -p "contrib/pkginstaller/out/packaging/${docDir}" + cp -v docs/build/remote/darwin/*.1 "contrib/pkginstaller/out/packaging/${docDir}" + case ${goArch} in universal) build_fat diff --git a/contrib/pkginstaller/scripts/postinstall b/contrib/pkginstaller/scripts/postinstall index 6c90488819..5cf1a053db 100755 --- a/contrib/pkginstaller/scripts/postinstall +++ b/contrib/pkginstaller/scripts/postinstall @@ -6,3 +6,7 @@ echo "/opt/podman/bin" > /etc/paths.d/podman-pkg # make sure to ignore errors, this is not a hard requirement to use podman /opt/podman/bin/podman-mac-helper install || : + +# Add pointer to podman docs in manpath +mkdir -p /usr/local/etc/man.d/ +echo "MANPATH /opt/podman/docs/man" > /usr/local/etc/man.d/podman.man.conf diff --git a/contrib/pkginstaller/scripts/preinstall b/contrib/pkginstaller/scripts/preinstall index 22336222fb..281820f3ec 100755 --- a/contrib/pkginstaller/scripts/preinstall +++ b/contrib/pkginstaller/scripts/preinstall @@ -7,3 +7,9 @@ rm -rf /opt/podman if [ ! -d "/etc/paths.d" ]; then mkdir -p /etc/paths.d fi + +# Create directory to be able to add podman +# man pages into the "man" path +if [ ! -d "/usr/local/etc/man.d" ]; then + mkdir -p /usr/local/etc/man.d +fi