summaryrefslogtreecommitdiff
path: root/contrib/pkginstaller/Makefile
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/Makefile
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/Makefile')
-rw-r--r--contrib/pkginstaller/Makefile50
1 files changed, 50 insertions, 0 deletions
diff --git a/contrib/pkginstaller/Makefile b/contrib/pkginstaller/Makefile
new file mode 100644
index 000000000..19c9b51aa
--- /dev/null
+++ b/contrib/pkginstaller/Makefile
@@ -0,0 +1,50 @@
+SHELL := bash
+
+ARCH ?= aarch64
+PODMAN_VERSION ?= 4.1.0
+GVPROXY_VERSION ?= 0.4.0
+QEMU_VERSION ?= 7.0.0-2
+GVPROXY_RELEASE_URL ?= https://github.com/containers/gvisor-tap-vsock/releases/download/v$(GVPROXY_VERSION)/gvproxy-darwin
+QEMU_RELEASE_URL ?= https://github.com/containers/podman-machine-qemu/releases/download/v$(QEMU_VERSION)/podman-machine-qemu-$(ARCH)-$(QEMU_VERSION).tar.xz
+PACKAGE_DIR ?= out/packaging
+TMP_DOWNLOAD ?= tmp-download
+PACKAGE_ROOT ?= root
+
+default: pkginstaller
+
+get_gvproxy:
+ mkdir -p $(TMP_DOWNLOAD)
+ cd $(TMP_DOWNLOAD) && curl -sLo gvproxy $(GVPROXY_RELEASE_URL)
+
+get_qemu:
+ mkdir -p $(TMP_DOWNLOAD)
+ cd $(TMP_DOWNLOAD) && curl -sLO $(QEMU_RELEASE_URL)
+
+packagedir: package_root Distribution welcome.html
+ mkdir -p $(PACKAGE_DIR)
+ cp -r Resources $(PACKAGE_DIR)/
+ cp welcome.html $(PACKAGE_DIR)/Resources/
+ cp Distribution $(PACKAGE_DIR)/
+ cp -r scripts $(PACKAGE_DIR)/
+ cp -r $(PACKAGE_ROOT) $(PACKAGE_DIR)/
+ cp package.sh $(PACKAGE_DIR)/
+ cd $(PACKAGE_DIR) && pkgbuild --analyze --root ./root component.plist
+ echo -n $(PODMAN_VERSION) > $(PACKAGE_DIR)/VERSION
+ echo -n $(ARCH) > $(PACKAGE_DIR)/ARCH
+ cp ../../LICENSE $(PACKAGE_DIR)/Resources/LICENSE.txt
+
+package_root: get_gvproxy get_qemu
+ mkdir -p $(PACKAGE_ROOT)/podman/bin $(PACKAGE_ROOT)/podman/qemu
+ tar -C $(PACKAGE_ROOT)/podman/qemu -xf $(TMP_DOWNLOAD)/podman-machine-qemu-$(ARCH)-$(QEMU_VERSION).tar.xz
+ cp $(TMP_DOWNLOAD)/gvproxy $(PACKAGE_ROOT)/podman/bin/
+ chmod a+x $(PACKAGE_ROOT)/podman/bin/*
+
+%: %.in
+ @sed -e 's/__VERSION__/'$(PODMAN_VERSION)'/g' $< >$@
+
+pkginstaller: packagedir
+ cd $(PACKAGE_DIR) && ./package.sh ..
+
+.PHONY: clean
+clean:
+ rm -rf $(TMP_DOWNLOAD) $(PACKAGE_ROOT) $(PACKAGE_DIR) Distribution welcome.html