aboutsummaryrefslogtreecommitdiff
path: root/macos
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2020-03-22 10:26:01 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2020-03-22 10:26:20 -0700
commit4d3ade03472f9bcbfb778c27c74f3c492b8e91e8 (patch)
treec97a3a180ecbbc84e2ba45d840ec45e34955776f /macos
parent667af847a24c683a2d517f8aad343008ef658c09 (diff)
downloadpandoc-4d3ade03472f9bcbfb778c27c74f3c492b8e91e8.tar.gz
Add new distribution-creating Makefile to macos directory.
Diffstat (limited to 'macos')
-rw-r--r--macos/Makefile30
1 files changed, 30 insertions, 0 deletions
diff --git a/macos/Makefile b/macos/Makefile
new file mode 100644
index 000000000..678ae3b76
--- /dev/null
+++ b/macos/Makefile
@@ -0,0 +1,30 @@
+VERSION=$(shell cat version.txt)
+BASE=pandoc-$(VERSION)
+DEST=pandoc/usr/local
+ALL=$(BASE)-macOS.pkg $(BASE)-macOS.zip
+
+all: $(ALL)
+
+signed.txt: $(DEST)
+ chmod +x $(DEST)/bin/pandoc $(DEST)/bin/pandoc-citeproc
+ codesign -v $(DEST)/bin/pandoc || codesign -s "5U2WKE6DES" $(DEST)/bin/pandoc
+ codesign -v $(DEST)/bin/pandoc-citeproc || codesign -s "5U2WKE6DES" $(DEST)/bin/pandoc-citeproc
+ echo "SIGNED" > signed.txt
+
+pandoc.pkg: signed.txt
+ pkgbuild --root pandoc --identifier net.johnmacfarlane.pandoc --version $(VERSION) --ownership recommended $@
+
+$(BASE)-macOS.pkg: pandoc.pkg
+ productbuild --distribution distribution.xml --resources Resources --package-path $< --version $(VERSION) --sign 'Developer ID Installer: John Macfarlane' $@
+
+$(BASE)-macOS.zip: signed.txt
+ ln -s $(DEST) $(BASE)
+ zip -r $@ $(BASE)
+
+clean:
+ rm signed.txt $(BASE) pandoc.pkg
+
+distclean: clean
+ rm $(ALL)
+
+.PHONY: all clean distclean