[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.0' - 4 commits - Makefile.in scp2/source solenv/bin sysui/desktop

Andras Timar andras.timar at collabora.com
Thu Mar 10 08:21:07 UTC 2016


 Makefile.in                           |   20 ++---
 scp2/source/ooo/common_brand.scp      |    4 -
 solenv/bin/macosx-codesign-app-bundle |  123 +++++++++++++++++-----------------
 sysui/desktop/icons/main.icns         |binary
 4 files changed, 75 insertions(+), 72 deletions(-)

New commits:
commit 00191a2a634f6d4c9c9934afe163a6e4ae469286
Author: Andras Timar <andras.timar at collabora.com>
Date:   Thu Mar 10 09:18:48 2016 +0100

    OS X codesign
    
    Change-Id: Ic2ea2851183ce2c0987c3e88113a03e73064a6b8

diff --git a/solenv/bin/macosx-codesign-app-bundle b/solenv/bin/macosx-codesign-app-bundle
index ff6397a..23fe2be 100755
--- a/solenv/bin/macosx-codesign-app-bundle
+++ b/solenv/bin/macosx-codesign-app-bundle
@@ -1,9 +1,8 @@
 #!/bin/bash
 
-# Script to sign dylibs and frameworks in an app bundle plus the
-# bundle itself. Called from
-# installer::simplepackage::create_package() in
-# solenv/bin/modules/installer/simplepackage.pm
+# Script to sign executables, dylibs and frameworks in an app bundle
+# plus the bundle itself. Called from
+# the test-install target in Makefile.in
 
 test `uname` = Darwin || { echo This is for OS X only; exit 1; }
 
@@ -19,91 +18,97 @@ for V in \
     fi
 done
 
-echo "codesigning using MACSOX_CODESIGNING_IDENTITY=[${MACOSX_CODESIGNING_IDENTITY?}]"
-
 APP_BUNDLE="$1"
 
+if test -n "$ENABLE_MACOSX_SANDBOX"; then
+    # In a sandboxed build executables need the entitlements
+    entitlements="--entitlements $BUILDDIR/lo.xcent"
+    # We use --enable-canonical-installation-tree-structure so all
+    # data files in Resources are included in the app bundle signature
+    # through that. I think.
+    other_files=''
+else
+    # In a non-sandboxed build (distributed outside the App Store)
+    # we traditionally have use --resource-rules. Let's not touch that?
+    resource_rules="--resource-rules $SRCDIR/setup_native/source/mac/CodesignRules.plist"
+    # And there we then want to sign data files, too, hmm.
+    other_files="\
+ -or -name '*.fodt' -or -name 'schema.strings' -or -name 'schema.xml' \
+ -or -name '*.jar' -or -name '*.jnilib' -or -name 'LICENSE' -or -name 'LICENSE.html' \
+ -or -name '*.applescript' -or -name '*.odt'"
+fi
+
 # Sign dylibs
 #
-# Executables get signed right after linking, see
-# solenv/gbuild/platform/macosx.mk. But many of our dylibs are built
-# by ad-hoc or 3rd-party mechanisms, so we can't easily sign them
-# right after linking. So do it here.
-#
 # The dylibs in the Python framework are called *.so. Go figure
 #
 # On Mavericks also would like to have data files signed...
 # add some where it makes sense. Make a depth-first search to sign the contents
 # of e.g. the spotlight plugin before attempting to sign the plugin itself
 
-find -d "$APP_BUNDLE" \( -name '*.dylib' -or -name '*.so' -or -name '*.fodt' -or -name '*.odt' \
-        -or -name 'schema.strings' -or -name 'schema.xml' -or -name '*.mdimporter' \
-        -or -name '*.jar' -or -name '*.jnilib' -or -name 'LICENSE' -or -name 'LICENSE.html' \
-        -or -name '*.applescript' \) ! -type l | grep -v "LibreOfficePython\.framework" | \
+find "$APP_BUNDLE" \( -name '*.dylib' -or -name '*.dylib.*' -or -name '*.so' \
+        $other_files \) ! -type l |
 while read file; do
     id=`echo ${file#${APP_BUNDLE}/Contents/} | sed -e 's,/,.,g'`
-    codesign --verbose --identifier=$MACOSX_BUNDLE_IDENTIFIER.$id --sign "$MACOSX_CODESIGNING_IDENTITY" "$file" || exit 1
+    codesign --verbose --identifier=$MACOSX_BUNDLE_IDENTIFIER.$id --sign "$MACOSX_CODESIGNING_IDENTITY" "$file"
 done
 
-find "$APP_BUNDLE" -name '*.dylib.*' ! -type l | \
-while read dylib; do \
-    id=`basename "$dylib"`; \
-    id=`echo $id | sed -e 's/dylib.*/dylib/'`; \
-    codesign --verbose --identifier=$MACOSX_BUNDLE_IDENTIFIER.$id --sign "$MACOSX_CODESIGNING_IDENTITY" "$dylib" || exit 1
+# Sign executables
+
+find "$APP_BUNDLE/Contents/MacOS" -type f |
+while read file; do
+    id=`echo ${file#${APP_BUNDLE}/Contents/} | sed -e 's,/,.,g'`
+    codesign --force --verbose --identifier=$MACOSX_BUNDLE_IDENTIFIER.$id --sign "$MACOSX_CODESIGNING_IDENTITY" $entitlements "$file"
 done
 
-# The executables have already been signed by
-# gb_LinkTarget__command_dynamiclink in
-# solenv/gbuild/platform/macosx.mk, but sign the handful of scripts remaining
-# in MacOS
-# (<https://developer.apple.com/library/mac/technotes/tn2206/_index.html> "OS X
-# Code Signing In Depth" suggests we should get rid of them rather sooner than
-# later, but they appear to be OK for now):
-
-for i in gengal python senddoc unoinfo
-do
-    if [ -f "$APP_BUNDLE/Contents/MacOS/$i" ]
-    then
-        codesign --verbose --identifier="$MACOSX_BUNDLE_IDENTIFIER.$i" \
-            --sign "$MACOSX_CODESIGNING_IDENTITY" "$APP_BUNDLE/Contents/MacOS/$i" \
-        || exit 1
-    fi
+# Sign included bundles. First .app ones (i.e. the Python.app inside
+# the LibreOfficePython.framework. Be generic for kicks...)
+
+find "$APP_BUNDLE" -name '*.app' -type d |
+while read app; do
+    fn=`basename "$app"`
+    fn=${fn%.*}
+    # Assume the app has a XML (and not binary) Info.plist
+    id=`grep -A 1 '<key>CFBundleIdentifier</key>' $app/Contents/Info.plist | tail -1 | sed -e 's,.*<string>,,' -e 's,</string>.*,,'`
+    codesign --verbose --identifier=$id --sign "$MACOSX_CODESIGNING_IDENTITY" $entitlements "$app"
 done
 
-# Sign frameworks.
-#
-# Yeah, we don't bundle any other framework than our Python one, and
-# it has just one version, so this generic search is mostly for
-# completeness.
+# Then .framework ones. Again, be generic just for kicks.
 
-find "$APP_BUNDLE" -name '*.framework' -type d -print0 | \
-while IFS= read -r -d '' framework; do \
-    fn=$(basename "$framework")
+find "$APP_BUNDLE" -name '*.framework' -type d |
+while read framework; do
+    fn=`basename "$framework"`
     fn=${fn%.*}
-    for version in "$framework"/Versions/*; do \
+    for version in "$framework"/Versions/*; do
         if test ! -L "$version" -a -d "$version"; then
-            codesign --force --verbose --prefix=$MACOSX_BUNDLE_IDENTIFIER. --sign "$MACOSX_CODESIGNING_IDENTITY" "$version/$fn" || exit 1
-            codesign --force --verbose --prefix=$MACOSX_BUNDLE_IDENTIFIER. --sign "$MACOSX_CODESIGNING_IDENTITY" "$version" || exit 1
-        fi; \
-    done; \
+	    # Assume the framework has a XML (and not binary) Info.plist
+	    id=`grep -A 1 '<key>CFBundleIdentifier</key>' $version/Resources/Info.plist | tail -1 | sed -e 's,.*<string>,,' -e 's,</string>.*,,'`
+            codesign --verbose --identifier=$id --sign "$MACOSX_CODESIGNING_IDENTITY" "$version"
+        fi
+    done
+done
+
+# Then mdimporters
+
+find "$APP_BUNDLE" -name '*.mdimporter' -type d |
+while read bundle; do
+    codesign --verbose --prefix=$MACOSX_BUNDLE_IDENTIFIER. --sign "$MACOSX_CODESIGNING_IDENTITY" "$bundle"
 done
 
-# Sign the app bundle as a whole which means finally signing the
-# CFBundleExecutable from Info.plist, i.e. soffice (which is exempted from the
-# on-the-go executable signing in gb_LinkTarget__command_dynamiclink in
-# solenv/gbuild/platform/macosx.mk), plus the contents
+# Sign the app bundle as a whole which means (re-)signing the
+# CFBundleExecutable from Info.plist, i.e. soffice, plus the contents
 # of the Resources tree (which unless you used
 # --enable-canonical-installation-tree-structure is not much, far from
 # all of our non-code "resources").
 #
 # At this stage we also attach the entitlements in the sandboxing case
+#
+# Also omit some files from the Bundle's seal via the resource-rules
+# (bootstraprc and similar that the user might adjust and image files)
+# See also https://developer.apple.com/library/mac/technotes/tn2206/
 
 id=`echo ${MACOSX_APP_NAME} | tr ' ' '-'`
 
-if test -n "$ENABLE_MACOSX_SANDBOX"; then
-    entitlements="--entitlements $BUILDDIR/lo.xcent"
-fi
-
-codesign --force --verbose --identifier="${MACOSX_BUNDLE_IDENTIFIER}.$id" --sign "$MACOSX_CODESIGNING_IDENTITY" $entitlements "$APP_BUNDLE" || exit 1
+codesign --force --verbose --identifier="${MACOSX_BUNDLE_IDENTIFIER}" $resource_rules --sign "$MACOSX_CODESIGNING_IDENTITY" $entitlements "$APP_BUNDLE"
 
 exit 0
commit c6237d49cf39a503b58868a20d2076c470c4828b
Author: Andras Timar <andras.timar at collabora.com>
Date:   Thu Mar 10 09:17:18 2016 +0100

    OS X: fix main applicaton icon of Collabora Office
    
    Change-Id: Idf2a81cdb8e3e0d137143e37e7653c5be195391e

diff --git a/sysui/desktop/icons/main.icns b/sysui/desktop/icons/main.icns
index ab165f9..4de9216 100644
Binary files a/sysui/desktop/icons/main.icns and b/sysui/desktop/icons/main.icns differ
commit d701823363236c1976f22dc46116a9b49bf68b24
Author: Andras Timar <andras.timar at collabora.com>
Date:   Sat Aug 22 08:33:11 2015 +0200

    scp2: EULA to Resources on OS X
    
    Change-Id: I87bbb61884d77729832e4d3f36aca29d6dada277

diff --git a/scp2/source/ooo/common_brand.scp b/scp2/source/ooo/common_brand.scp
index 4abe743..8b0b4d3 100644
--- a/scp2/source/ooo/common_brand.scp
+++ b/scp2/source/ooo/common_brand.scp
@@ -1276,10 +1276,8 @@ End
 
 File gid_Eula_Odt
     BIN_FILE_BODY;
-#if defined ENABLE_MACOSX_MACLIKE_APP_STRUCTURE
+#if defined MACOSX
     Dir = gid_Dir_Bundle_Contents_Resources;
-#elif defined MACOSX
-    Dir = gid_Dir_Bundle_Contents;
 #else
     Dir = gid_Dir_Brand_Root;
 #endif
commit 4524204e78b2e9b8b95bce108a2951b530c54051
Author: Andras Timar <andras.timar at collabora.com>
Date:   Tue Mar 8 14:34:24 2016 +0100

    s/LibreOffice/CollaboraOffice/
    
    Change-Id: Ia2de1634657ffd6e456c96042b124f8a6a3bd1d0

diff --git a/Makefile.in b/Makefile.in
index b802121..d32332c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -309,37 +309,37 @@ ifneq ($(MACOSX_CODESIGNING_IDENTITY),)
 #
 # Create Resources/*.lproj directories for languages supported by OS X
 	set -x; for lang in ca cs da de el en es fi fr hr hu id it ja ko ms nl no pl pt pt_PT ro ru sk sv th tr uk vi zh_CN zh_TW; do \
-		lproj=$(TESTINSTALLDIR)/LibreOffice$(if $(ENABLE_RELEASE_BUILD),,Dev).app/Contents/Resources/$$lang.lproj; \
+		lproj=$(TESTINSTALLDIR)/CollaboraOffice$(if $(ENABLE_RELEASE_BUILD),,Dev).app/Contents/Resources/$$lang.lproj; \
 		mkdir $$lproj; \
 	done
 #
 # And remove the "bin" folder which should not be there
-	rm -rf $(TESTINSTALLDIR)/LibreOffice$(if $(ENABLE_RELEASE_BUILD),,Dev).app/Contents/bin
+	rm -rf $(TESTINSTALLDIR)/CollaboraOffice$(if $(ENABLE_RELEASE_BUILD),,Dev).app/Contents/bin
 #
 # Remove unnecessary executables in the LibreOfficePython framework
-	rm -rf $(TESTINSTALLDIR)/LibreOffice$(if $(ENABLE_RELEASE_BUILD),,Dev).app/Contents/Frameworks/LibreOfficePython.framework/Versions/[1-9]*/bin
+	rm -rf $(TESTINSTALLDIR)/CollaboraOffice$(if $(ENABLE_RELEASE_BUILD),,Dev).app/Contents/Frameworks/LibreOfficePython.framework/Versions/[1-9]*/bin
 #
 # Remove the python.o object file which is weird and interferes with app store uploading
 # And with it removed, presumably the other stuff in the Python lib/python3.3/config-3.3m probably does not make sense either.
-	rm -rf $(TESTINSTALLDIR)/LibreOffice$(if $(ENABLE_RELEASE_BUILD),,Dev).app/Contents/Frameworks/LibreOfficePython.framework/Versions/[1-9]*/lib/python[1-9]*/config-[1-9]*
+	rm -rf $(TESTINSTALLDIR)/CollaboraOffice$(if $(ENABLE_RELEASE_BUILD),,Dev).app/Contents/Frameworks/LibreOfficePython.framework/Versions/[1-9]*/lib/python[1-9]*/config-[1-9]*
 #
 ifneq ($ENABLE_MACOSX_SANDBOX),)
 # Remove the gengal.bin binary and unopkg script that we don't want
-	rm $(TESTINSTALLDIR)/LibreOffice$(if $(ENABLE_RELEASE_BUILD),,Dev).app/Contents/MacOS/gengal.bin
-	rm $(TESTINSTALLDIR)/LibreOffice$(if $(ENABLE_RELEASE_BUILD),,Dev).app/Contents/MacOS/unopkg
+	rm $(TESTINSTALLDIR)/CollaboraOffice$(if $(ENABLE_RELEASE_BUILD),,Dev).app/Contents/MacOS/gengal.bin
+	rm $(TESTINSTALLDIR)/CollaboraOffice$(if $(ENABLE_RELEASE_BUILD),,Dev).app/Contents/MacOS/unopkg
 endif
 #
 # Then use the macosx-codesign-app-bundle script
-	@$(SRCDIR)/solenv/bin/macosx-codesign-app-bundle $(TESTINSTALLDIR)/LibreOffice$(if $(ENABLE_RELEASE_BUILD),,Dev).app
+	@$(SRCDIR)/solenv/bin/macosx-codesign-app-bundle $(TESTINSTALLDIR)/CollaboraOffice$(if $(ENABLE_RELEASE_BUILD),,Dev).app
 endif
 endif
 	@$(call gb_Top_InstallFinished,Test Installation,$(TESTINSTALLDIR))
 
 mac-app-store-package: test-install
 ifneq ($(MACOSX_PACKAGE_SIGNING_IDENTITY),)
-	rm -rf "$(MACOSX_APP_NAME).app"
-	mv "$(TESTINSTALLDIR)/$(PRODUCTNAME).app" "$(MACOSX_APP_NAME).app"
-	productbuild --component "$(MACOSX_APP_NAME).app" /Applications --sign $(MACOSX_PACKAGE_SIGNING_IDENTITY) $(shell echo "$(MACOSX_APP_NAME)" | tr ' ' '-').pkg
+	rm -rf CollaboraOffice.app
+	mv "$(TESTINSTALLDIR)/CollaboraOffice.app" "CollaboraOffice.app"
+	productbuild --component "CollaboraOffice.app" /Applications --sign $(MACOSX_PACKAGE_SIGNING_IDENTITY) CollaboraOffice.pkg
 else
 	@echo You did not provide an installer signing identity with --enable-macosx-package-signing
 	@exit 1


More information about the Libreoffice-commits mailing list