[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-launcher/master] Support packaging as a standalone XUL application.



commit 4c1ef941aa146671f751ad7f696103da902c865b
Author: Tails developers <amnesia@xxxxxxxx>
Date:   Tue Feb 11 00:02:22 2014 +0100

    Support packaging as a standalone XUL application.
---
 Makefile           |   29 +++++++++++++++++++++++++----
 application.ini.in |   13 +++++++++++++
 2 files changed, 38 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 9c3e853..3d3a857 100644
--- a/Makefile
+++ b/Makefile
@@ -2,14 +2,19 @@
 ### See src/LICENSE for licensing information.
 
 EXT_NAME=tor-launcher
-XPI_NAME:=$(shell echo "$(EXT_NAME)-`grep em:version src/install.rdf | sed -e 's/[<>]/	/g' | cut -f3`.xpi")
+VERSION:=`grep em:version src/install.rdf | sed -e 's/[<>]/	/g' | cut -f3`
+XPI_NAME:=$(shell echo "$(EXT_NAME)-$(VERSION).xpi")
+STANDALONE_NAME=$(EXT_NAME)-standalone
+STANDALONE_TARBALL=$(shell echo "$(STANDALONE_NAME)-$(VERSION).tar.gz")
 
-AVAIL_TARGETS=help package clean
+AVAIL_TARGETS=help package standalone clean
 
 ifeq ($(VERBOSE),1)
 	ZIP=zip
+	TAR=tar -v
 else
 	ZIP=zip -q
+	TAR=tar
 endif
  
 help:
@@ -18,13 +23,29 @@ help:
 		echo "  make $$t";													\
 	done
 
-package:	clean
+pkg-prepare:	clean
 	@mkdir -p pkg
+
+package:	pkg-prepare
 	@(cd src; $(ZIP) -X9r "../pkg/$(XPI_NAME)" ./ -x "*.diff")
 	@echo "Created package pkg/$(XPI_NAME)"
 
+standalone:	pkg-prepare
+	$(eval TMP="$(shell mktemp -d "/tmp/$(STANDALONE_NAME).XXXXXX")")
+	@mkdir -p "$(TMP)/$(STANDALONE_NAME)"
+	@cp -a "src/"* "$(TMP)/$(STANDALONE_NAME)"
+	@cp application.ini.in "$(TMP)/$(STANDALONE_NAME)/application.ini"
+	@sed -i	-e "s/__VERSION__/$(VERSION)/" \
+		-e "s/__DATE__/`date '+%Y%m%d'`/" \
+		"$(TMP)/$(STANDALONE_NAME)/application.ini"
+	@$(TAR) --exclude "*.diff" -czf "pkg/$(STANDALONE_TARBALL)" \
+		-C "$(TMP)" "$(STANDALONE_NAME)"
+	@rm -rf "$(TMP)"
+	@echo "Created standalone package pkg/$(STANDALONE_TARBALL)"
+
 clean:
-	@rm -f "pkg/$(XPI_NAME)"
+	@rm -f	"pkg/$(XPI_NAME)" \
+		"pkg/$(STANDALONE_TARBALL)"
 
 zip:
 	@TMPFILE=/tmp/$(EXT_NAME)-`date '+%Y-%m-%d-%s'`.zip;			 		\
diff --git a/application.ini.in b/application.ini.in
new file mode 100644
index 0000000..00d66d1
--- /dev/null
+++ b/application.ini.in
@@ -0,0 +1,13 @@
+[App]
+Vendor=TorProject
+Name=TorLauncher
+Version=__VERSION__
+BuildID=__DATE__
+ID=tor-launcher@xxxxxxxxxxxxxx
+
+[Gecko]
+MinVersion=24.0.0
+MaxVersion=*.*.*
+
+[Shell]
+Icon=icon.png

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits