+
+
Thanks for installing Podman!
+
You can now start using the 'podman' command. First run 'podman machine init'.
+
+
+
diff --git a/contrib/pkginstaller/package.sh b/contrib/pkginstaller/package.sh
new file mode 100755
index 0000000000..b7b33954d2
--- /dev/null
+++ b/contrib/pkginstaller/package.sh
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+set -euxo pipefail
+
+BASEDIR=$(dirname "$0")
+OUTPUT=$1
+CODESIGN_IDENTITY=${CODESIGN_IDENTITY:-mock}
+PRODUCTSIGN_IDENTITY=${PRODUCTSIGN_IDENTITY:-mock}
+NO_CODESIGN=${NO_CODESIGN:-0}
+HELPER_BINARIES_DIR="/opt/podman/qemu/bin"
+
+binDir="${BASEDIR}/root/podman/bin"
+
+function build_podman() {
+ pushd "$1"
+ make podman-remote HELPER_BINARIES_DIR="${HELPER_BINARIES_DIR}"
+ make podman-mac-helper
+ cp bin/darwin/podman "contrib/pkginstaller/out/packaging/${binDir}/podman"
+ cp bin/darwin/podman-mac-helper "contrib/pkginstaller/out/packaging/${binDir}/podman-mac-helper"
+ popd
+}
+
+function sign() {
+ if [ "${NO_CODESIGN}" -eq "1" ]; then
+ return
+ fi
+ local opts=""
+ entitlements="${BASEDIR}/$(basename "$1").entitlements"
+ if [ -f "${entitlements}" ]; then
+ opts="--entitlements ${entitlements}"
+ fi
+ codesign --deep --sign "${CODESIGN_IDENTITY}" --options runtime --force --timestamp "${opts}" "$1"
+}
+
+version=$(cat "${BASEDIR}/VERSION")
+arch=$(cat "${BASEDIR}/ARCH")
+
+build_podman "../../../../"
+sign "${binDir}/podman"
+sign "${binDir}/gvproxy"
+sign "${binDir}/podman-mac-helper"
+
+pkgbuild --identifier com.redhat.podman --version "${version}" \
+ --scripts "${BASEDIR}/scripts" \
+ --root "${BASEDIR}/root" \
+ --install-location /opt \
+ --component-plist "${BASEDIR}/component.plist" \
+ "${OUTPUT}/podman.pkg"
+
+productbuild --distribution "${BASEDIR}/Distribution" \
+ --resources "${BASEDIR}/Resources" \
+ --package-path "${OUTPUT}" \
+ "${OUTPUT}/podman-unsigned.pkg"
+rm "${OUTPUT}/podman.pkg"
+
+if [ ! "${NO_CODESIGN}" -eq "1" ]; then
+ productsign --timestamp --sign "${PRODUCTSIGN_IDENTITY}" "${OUTPUT}/podman-unsigned.pkg" "${OUTPUT}/podman-installer-macos-${arch}.pkg"
+else
+ mv "${OUTPUT}/podman-unsigned.pkg" "${OUTPUT}/podman-installer-macos-${arch}.pkg"
+fi
diff --git a/contrib/pkginstaller/scripts/postinstall b/contrib/pkginstaller/scripts/postinstall
new file mode 100755
index 0000000000..db17eede83
--- /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
diff --git a/contrib/pkginstaller/scripts/preinstall b/contrib/pkginstaller/scripts/preinstall
new file mode 100755
index 0000000000..a381868fcc
--- /dev/null
+++ b/contrib/pkginstaller/scripts/preinstall
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+set -e
+
+rm -rf /opt/podman
diff --git a/contrib/pkginstaller/welcome.html.in b/contrib/pkginstaller/welcome.html.in
new file mode 100644
index 0000000000..b061987167
--- /dev/null
+++ b/contrib/pkginstaller/welcome.html.in
@@ -0,0 +1,16 @@
+
+
+
+
+
+
This will install Podman __VERSION__
+ on your computer. You will be guided through the steps necessary to install this software.
+
+
Click “Continue" to continue the
+ setup
+
+
+