From 46142e61c1d823eb1e39c1bdc71a095da9f70296 Mon Sep 17 00:00:00 2001
From: Daira Hopwood <daira@jacaranda.org>
Date: Mon, 6 Oct 2014 23:46:29 +0100
Subject: [PATCH] New make target for OS X package creation.

Author: Ramakrishnan Muthukrishnan <ram@leastauthority.com>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
---
 Makefile | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/Makefile b/Makefile
index 3905a8de..1404bdff 100644
--- a/Makefile
+++ b/Makefile
@@ -31,6 +31,28 @@ build:
 	$(PYTHON) setup.py build
 	touch .built
 
+# build OS X pkg packages
+.PHONY: build-osx-pkg
+build-osx-pkg:
+	$(PYTHON) setup.py build
+	touch .built
+
+# create component pkg
+	pkgbuild --root $(shell pwd) \
+	--identifier com.leastauthority.tahoe \
+	--version $(shell $(PYTHON) ./setup.py --version) \
+	--ownership recommended \
+	--install-location /Applications/tahoe.app \
+	--scripts $(shell pwd)/misc/build_helpers/osx/scripts \
+	tahoe-lafs.pkg
+
+# create product archive
+	productbuild --distribution $(shell pwd)/misc/build_helpers/osx/Distribution.xml \
+	--package-path . \
+	tahoe-lafs-osx.pkg
+
+# remove intermediate pkg
+	rm -f tahoe-lafs.pkg
 
 # TESTING
 
-- 
2.45.2