-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
38 lines (28 loc) · 1.2 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
CURDIR := $(shell pwd)
MUNKIPKG := /usr/local/bin/munkipkg
PKG_SIGN := $(CURDIR)/../jamf-upload/sign_pkg.py
DEV_ID := 9Z623UDZ5L
PYTHON_PATH := /usr/local/autopkg/python
SCRIPTS := $(CURDIR)/pkg/Rosetta-2-install/scripts
PKG_BUILD := $(CURDIR)/pkg/Rosetta-2-install/build
PKG_VERSION := $(shell defaults read $(CURDIR)/pkg/Rosetta-2-install/build-info.plist version)
objects = $(SCRIPTS)/postinstall
default : $(PKG_BUILD)/Rosetta-2-install-$(PKG_VERSION).pkg
@echo "Building Rosetta-2-install pkg"
$(PKG_BUILD)/Rosetta-2-install-$(PKG_VERSION).pkg: $(objects)
cd $(CURDIR)/pkg && $(MUNKIPKG) Rosetta-2-install
$(SCRIPTS)/postinstall:
@echo "Copying Rosetta-2-install.sh into scripts directory as postinstall"
mkdir -p "$(SCRIPTS)"
cp "$(CURDIR)/Rosetta-2-install.sh" "$(SCRIPTS)/postinstall"
chmod 755 "$(SCRIPTS)/postinstall"
.PHONY : clean
clean :
@echo "Cleaning up package build folders"
rm "$(SCRIPTS)/postinstall" ||:
rm $(CURDIR)/pkg/Rosetta-2-install/build/*.pkg ||:
sign:
@echo "Signing the package"
rm $(CURDIR)/pkg/Rosetta-2-install/build/*.signed.pkg ||:
${PYTHON_PATH} ${PKG_SIGN} --developer $(DEV_ID) $(CURDIR)/pkg/Rosetta-2-install/build/*.pkg
open $(CURDIR)/pkg/Rosetta-2-install/build