summaryrefslogtreecommitdiff
path: root/src/xpi.mk
diff options
context:
space:
mode:
Diffstat (limited to 'src/xpi.mk')
-rw-r--r--src/xpi.mk10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/xpi.mk b/src/xpi.mk
index d4f6579..680a56a 100644
--- a/src/xpi.mk
+++ b/src/xpi.mk
@@ -66,6 +66,12 @@
# stripped prefixes is used. This value is used to determine
# xpi:Provides.
#
+# MOZ_XPI_PRESERVE_PERMISSIONS (OPTIONAL):
+# if defined (set to 1), the permission of the installed files
+# will not be changed. If not defined or set to $(null), the
+# permission of the files will be set to 644 and the permissions
+# of scripts (files containing a shebang) will be set to 755.
+#
# Deprecated variables:
#
# MOZ_XPI_MOZILLA_DIRS /deprecated/ (OPTIONAL/NODEFAULT - see "Note:"):
@@ -184,6 +190,10 @@ ifeq ($(origin MOZ_XPI_DOCUMENTED_LICENSE_FILES),undefined)
cd $(install_dir) && find \( -iname copying -o -iname gpl.txt -o -iname licen[cs]e -o -iname licen[cs]e.txt \) -printf "xpi.mk: deleted %p\n" -delete
endif
endif
+ifeq (,$(MOZ_XPI_PRESERVE_PERMISSIONS))
+ find $(install_dir) -type d -exec chmod 755 {} \;
+ cd $(install_dir) && find * -type f | while read fn; do head -n1 "$$fn" | grep -q "^\#\!" && echo "xpi.mk: Made $$fn executable." && chmod 755 "$$fn" || chmod 644 "$$fn"; done
+endif
touch $@
installlinks-%-stamp: $(patsubst %,install-%-stamp,$(XPI_BASE_FILE))