aboutsummaryrefslogtreecommitdiff
path: root/contrib/pkginstaller/scripts/postinstall
diff options
context:
space:
mode:
authorAnjan Nath <kaludios@gmail.com>2022-06-08 14:38:20 +0530
committerAshley Cui <acui@redhat.com>2022-08-04 09:44:36 -0400
commit9a820b480a63f7453512622bc053264c6f1c34fb (patch)
tree789aefe78673f8e3788b43926bdad9ce51c2c737 /contrib/pkginstaller/scripts/postinstall
parent49ae6cfed67dbc38408c85b3be52af69fa8f031d (diff)
downloadpodman-9a820b480a63f7453512622bc053264c6f1c34fb.tar.gz
podman-9a820b480a63f7453512622bc053264c6f1c34fb.tar.bz2
podman-9a820b480a63f7453512622bc053264c6f1c34fb.zip
Add support for building macOS pkg installer
it installs podman and supporting binaries along with qemu to have a functioning podman install using a pkg podman and podman-mac-helper is compiled from source gvproxy binary is downloaded from its github releases and qemu from github release of containers/podman-machine-qemu [NO NEW TESTS NEEDED] Signed-off-by: Anjan Nath <kaludios@gmail.com>
Diffstat (limited to 'contrib/pkginstaller/scripts/postinstall')
-rwxr-xr-xcontrib/pkginstaller/scripts/postinstall27
1 files changed, 27 insertions, 0 deletions
diff --git a/contrib/pkginstaller/scripts/postinstall b/contrib/pkginstaller/scripts/postinstall
new file mode 100755
index 000000000..db17eede8
--- /dev/null
+++ b/contrib/pkginstaller/scripts/postinstall
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+set -e
+
+BZSH_PODMAN_PATH_EXP='PATH="/opt/podman/bin:$PATH"'
+FISH_PODMAN_PATH_EXP='set PATH "/opt/podman/bin $PATH"'
+BASHRC_PATH="$HOME/.bash_profile"
+ZSHENV_PATH="$HOME/.zshenv"
+ZSHRC_PATH="$HOME/.zshrc"
+FSHCFG_PATH="$HOME/.config/fish/config.fish"
+
+# append /Applications/podman/bin to $PATH
+if [ -f "$BASHRC_PATH" ]; then
+ grep -Fxq "$BZSH_PODMAN_PATH_EXP" "$BASHRC_PATH" || echo "$BZSH_PODMAN_PATH_EXP" >> "$BASHRC_PATH"
+fi
+if [ -f "$ZSHENV_PATH" ]; then
+ grep -Fxq "$BZSH_PODMAN_PATH_EXP" "$ZSHENV_PATH" || echo "$BZSH_PODMAN_PATH_EXP" >> "$ZSHENV_PATH"
+fi
+if [ -f "$ZSHRC_PATH" ]; then
+ grep -Fxq "$BZSH_PODMAN_PATH_EXP" "$ZSHRC_PATH" || echo "$BZSH_PODMAN_PATH_EXP" >> "$ZSHRC_PATH"
+fi
+if [ -f "$FSHCFG_PATH" ]; then
+ grep -Fxq "$FISH_PODMAN_PATH_EXP" "$FSHCFG_PATH" || echo "$FISH_PODMAN_PATH_EXP" >> "$FSHCFG_PATH"
+fi
+
+ln -s /opt/podman/bin/podman-mac-helper /opt/podman/qemu/bin/podman-mac-helper
+ln -s /opt/podman/bin/gvproxy /opt/podman/qemu/bin/gvproxy