github.com/containers/podman/v4@v4.9.4/contrib/pkginstaller/Makefile (about)

     1  SHELL := bash
     2  
     3  ARCH ?= aarch64
     4  ifeq ($(ARCH), aarch64)
     5  	GOARCH:=arm64
     6  else
     7  	GOARCH:=$(ARCH)
     8  endif
     9  GVPROXY_VERSION ?= 0.7.2
    10  QEMU_VERSION ?= 8.2.1-1
    11  GVPROXY_RELEASE_URL ?= https://github.com/containers/gvisor-tap-vsock/releases/download/v$(GVPROXY_VERSION)/gvproxy-darwin
    12  QEMU_RELEASE_URL ?= https://github.com/containers/podman-machine-qemu/releases/download/v$(QEMU_VERSION)/podman-machine-qemu-$(ARCH)-$(QEMU_VERSION).tar.xz
    13  PACKAGE_DIR ?= out/packaging
    14  TMP_DOWNLOAD ?= tmp-download
    15  PACKAGE_ROOT ?= root
    16  PKG_NAME := podman-installer-macos-$(GOARCH).pkg
    17  
    18  default: pkginstaller
    19  
    20  podman_version:
    21  	make -C ../../ test/version/version
    22  
    23  $(TMP_DOWNLOAD)/gvproxy:
    24  	mkdir -p $(TMP_DOWNLOAD)
    25  	cd $(TMP_DOWNLOAD) && curl -sLo gvproxy $(GVPROXY_RELEASE_URL)
    26  
    27  $(TMP_DOWNLOAD)/podman-machine-qemu-$(ARCH)-$(QEMU_VERSION).tar.xz:
    28  	mkdir -p $(TMP_DOWNLOAD)
    29  	cd $(TMP_DOWNLOAD) && curl -sLO $(QEMU_RELEASE_URL)
    30  
    31  packagedir: podman_version package_root Distribution welcome.html
    32  	mkdir -p $(PACKAGE_DIR)
    33  	cp -r Resources $(PACKAGE_DIR)/
    34  	cp welcome.html $(PACKAGE_DIR)/Resources/
    35  	cp Distribution $(PACKAGE_DIR)/
    36  	cp -r scripts $(PACKAGE_DIR)/
    37  	cp -r $(PACKAGE_ROOT) $(PACKAGE_DIR)/
    38  	cp package.sh $(PACKAGE_DIR)/
    39  	cd $(PACKAGE_DIR) && pkgbuild --analyze --root ./root component.plist
    40  	../../test/version/version > $(PACKAGE_DIR)/VERSION
    41  	echo -n $(ARCH) > $(PACKAGE_DIR)/ARCH
    42  	cp ../../LICENSE $(PACKAGE_DIR)/Resources/LICENSE.txt
    43  	cp hvf.entitlements $(PACKAGE_DIR)/
    44  
    45  package_root: clean-pkgroot $(TMP_DOWNLOAD)/podman-machine-qemu-$(ARCH)-$(QEMU_VERSION).tar.xz $(TMP_DOWNLOAD)/gvproxy
    46  	mkdir -p $(PACKAGE_ROOT)/podman/bin $(PACKAGE_ROOT)/podman/qemu
    47  	tar -C $(PACKAGE_ROOT)/podman/qemu -xf $(TMP_DOWNLOAD)/podman-machine-qemu-$(ARCH)-$(QEMU_VERSION).tar.xz
    48  	cp $(TMP_DOWNLOAD)/gvproxy $(PACKAGE_ROOT)/podman/bin/
    49  	chmod a+x $(PACKAGE_ROOT)/podman/bin/*
    50  
    51  %: %.in podman_version
    52  	@sed -e 's/__VERSION__/'$(shell ../../test/version/version)'/g' $< >$@
    53  
    54  pkginstaller: packagedir
    55  	cd $(PACKAGE_DIR) && ./package.sh ..
    56  
    57  _notarize: pkginstaller
    58  	xcrun notarytool submit --apple-id $(NOTARIZE_USERNAME) --password $(NOTARIZE_PASSWORD) --team-id=$(NOTARIZE_TEAM) -f json --wait out/$(PKG_NAME)
    59  
    60  notarize: _notarize
    61  	xcrun stapler staple out/$(PKG_NAME)
    62  
    63  .PHONY: clean clean-pkgroot
    64  clean:
    65  	rm -rf $(TMP_DOWNLOAD) $(PACKAGE_ROOT) $(PACKAGE_DIR) Distribution welcome.html ../../test/version/version
    66  
    67  clean-pkgroot:
    68  	rm -rf $(PACKAGE_ROOT) $(PACKAGE_DIR) Distribution welcome.html