[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.1' - 2 commits - solenv/bin

Tor Lillqvist tml at collabora.com
Mon Feb 10 14:33:42 PST 2014


 solenv/bin/macosx-codesign-app-bundle         |   33 ++++++++++++++++----------
 solenv/bin/modules/installer/simplepackage.pm |    4 +--
 2 files changed, 23 insertions(+), 14 deletions(-)

New commits:
commit c8e0e5858f7cb5d6269d2b71b735ca14dad10921
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Feb 11 00:30:23 2014 +0200

    Handle app bundles with space in name, also sign the mdimporter properly
    
    Just like the Python framework, also the Spotlight importer needs to
    be signed specially, it seems.
    
    I wondoer if we could get rid of all the hair in this script by simply
    just signing the app bundle, with the --deep option?
    
    Change-Id: I722b4403e74560f6555a7528005ed7aa0c94352b

diff --git a/solenv/bin/macosx-codesign-app-bundle b/solenv/bin/macosx-codesign-app-bundle
index 4197780..48454a3 100755
--- a/solenv/bin/macosx-codesign-app-bundle
+++ b/solenv/bin/macosx-codesign-app-bundle
@@ -19,7 +19,7 @@ for V in \
     fi
 done
 
-APP_BUNDLE=$1
+APP_BUNDLE="$1"
 
 # Sign dylibs
 #
@@ -34,8 +34,8 @@ APP_BUNDLE=$1
 # 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 $APP_BUNDLE \( -name '*.dylib' -or -name '*.dylib.*' -or -name '*.so' \
-        -or -name '*.fodt' -or -name 'schema.strings' -or -name 'schema.xml' -or -name '*.mdimporter' \
+find "$APP_BUNDLE" \( -name '*.dylib' -or -name '*.dylib.*' -or -name '*.so' \
+        -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' \) ! -type l | grep -v "LibreOfficePython\.framework" |
 while read dylib; do
@@ -47,23 +47,31 @@ done
 # gb_LinkTarget__command_dynamiclink in
 # solenv/gbuild/platform/macosx.mk.
 
-# Sign frameworks.
-#
+# Sign included bundles. First 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.
 
-for framework in `find $APP_BUNDLE -name '*.framework' -type d`; 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
-        if test ! -L $version -a -d $version; then
-            codesign --verbose --prefix=$MACOSX_BUNDLE_IDENTIFIER. --sign "$MACOSX_CODESIGNING_IDENTITY" $version/$fn
-	    codesign --verbose --prefix=$MACOSX_BUNDLE_IDENTIFIER. --sign "$MACOSX_CODESIGNING_IDENTITY" $version
+    for version in "$framework"/Versions/*; do
+        if test ! -L "$version" -a -d "$version"; then
+            codesign --verbose --prefix=$MACOSX_BUNDLE_IDENTIFIER. --sign "$MACOSX_CODESIGNING_IDENTITY" "$version/$fn"
+            codesign --verbose --prefix=$MACOSX_BUNDLE_IDENTIFIER. --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 (re-)signing the
 # CFBundleExecutable from Info.plist, i.e. soffice, plus the contents
 # of the Resources tree (which unless you used
@@ -80,6 +88,7 @@ if test "$ENABLE_MACOSX_SANDBOX" = "YES"; then
     entitlements="--entitlements $BUILDDIR/lo.xcent"
 fi
 
-codesign --force --verbose --identifier="${MACOSX_BUNDLE_IDENTIFIER}.$(basename ${APP_BUNDLE})" --resource-rules "$SRCDIR/setup_native/source/mac/CodesignRules.plist" --sign "$MACOSX_CODESIGNING_IDENTITY" $entitlements $APP_BUNDLE
+id=`basename "$APP_BUNDLE"`
+codesign --force --verbose --identifier="${MACOSX_BUNDLE_IDENTIFIER}.$id" --resource-rules "$SRCDIR/setup_native/source/mac/CodesignRules.plist" --sign "$MACOSX_CODESIGNING_IDENTITY" $entitlements "$APP_BUNDLE"
 
 exit 0
commit 40f4ec95acb1e28b1ba08a3a8259e5877bfc8c16
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Feb 10 18:56:40 2014 +0200

    Hardcode app bundle name here, too
    
    Change-Id: I69cabd516e7c40b7ee75e311d725f6db78519855

diff --git a/solenv/bin/modules/installer/simplepackage.pm b/solenv/bin/modules/installer/simplepackage.pm
index b2ef9f4..23a1f7b 100644
--- a/solenv/bin/modules/installer/simplepackage.pm
+++ b/solenv/bin/modules/installer/simplepackage.pm
@@ -401,10 +401,10 @@ sub create_package
         }
         else
         {
-            if (($volume_name_classic_app eq 'LibreOffice' || $volume_name_classic_app eq 'LibreOfficeDev') &&
+            if (($volume_name_classic_app eq 'LibreOffice from Collabora' || $volume_name_classic_app eq 'LibreOfficeDev') &&
                 defined($ENV{'MACOSX_CODESIGNING_IDENTITY'}) && $ENV{'MACOSX_CODESIGNING_IDENTITY'} ne "" )
             {
-                $systemcall = "$ENV{'SRCDIR'}/solenv/bin/macosx-codesign-app-bundle $localtempdir/$folder/$volume_name_classic_app.app";
+                $systemcall = "$ENV{'SRCDIR'}/solenv/bin/macosx-codesign-app-bundle \"$localtempdir/$folder/$volume_name_classic_app.app\"";
                 print "... $systemcall ...\n";
                 my $returnvalue = system($systemcall);
                 $infoline = "Systemcall: $systemcall\n";


More information about the Libreoffice-commits mailing list