From 9b702460e1d8b53d6f7df8de1e49fd2d04c4ce88 Mon Sep 17 00:00:00 2001
From: Ashley Cui <acui@redhat.com>
Date: Tue, 6 Dec 2022 15:14:34 -0500
Subject: [PATCH] Makefile: Add podman-mac-helper to darwin client zip

As well as as small fix for zipping the correct folder when building on Mac

Signed-off-by: Ashley Cui <acui@redhat.com>
---
 Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 71c0d045fa..d06ecbd361 100644
--- a/Makefile
+++ b/Makefile
@@ -728,11 +728,14 @@ podman-remote-release-%.zip: test/version/version ## Build podman-remote for %=$
 	if [[ "$(GOOS)" == "windows" ]]; then \
 		$(MAKE) $(GOPLAT) TMPDIR="" win-sshproxy; \
 	fi
+	if [[ "$(GOOS)" == "darwin" ]]; then \
+		$(MAKE) $(GOPLAT) podman-mac-helper;\
+	fi
 	cp -r ./docs/build/remote/$(GOOS) "$(TMPDIR)/$(SUBDIR)/docs/"
 	cp ./contrib/remote/containers.conf "$(TMPDIR)/$(SUBDIR)/"
 	$(MAKE) $(GOPLAT) $(_DSTARGS) SELINUXOPT="" install.remote
 	cd "$(TMPDIR)" && \
-		zip --recurse-paths "$(CURDIR)/$@" "./"
+		zip --recurse-paths "$(CURDIR)/$@" "./$(SUBDIR)"
 	if [[ "$(GOARCH)" != "$(NATIVE_GOARCH)" ]]; then $(MAKE) clean-binaries; fi
 	-rm -rf "$(TMPDIR)"
 
@@ -795,6 +798,8 @@ install.remote:
 		$(DESTDIR)$(BINDIR)/podman$(BINSFX)
 	test "${GOOS}" != "windows" || \
 		install -m 755 $(SRCBINDIR)/win-sshproxy.exe $(DESTDIR)$(BINDIR)
+	test "${GOOS}" != "darwin" || \
+		install -m 755 $(SRCBINDIR)/podman-mac-helper $(DESTDIR)$(BINDIR)
 	test -z "${SELINUXOPT}" || \
 		chcon --verbose --reference=$(DESTDIR)$(BINDIR)/podman-remote \
 		bin/podman-remote