[Pkg-anonymity-tools] [onionshare] 47/57: codesign for OSX (#151)

Ulrike Uhlig u-guest at moszumanska.debian.org
Tue May 19 18:18:57 UTC 2015


This is an automated email from the git hooks/post-receive script.

u-guest pushed a commit to annotated tag 0.7
in repository onionshare.

commit d6aafd88e7b21f28fadcdda3aef87b5bc9c7aba2
Author: Micah Lee <micah at micahflee.com>
Date:   Fri May 15 18:09:09 2015 -0700

    codesign for OSX (#151)
---
 install/build_osx.sh            | 16 ++++++++++++++++
 install/prepare_for_codesign.py | 36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+)

diff --git a/install/build_osx.sh b/install/build_osx.sh
index 54c6bfe..b7f375e 100755
--- a/install/build_osx.sh
+++ b/install/build_osx.sh
@@ -3,6 +3,9 @@
 ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"
 cd $ROOT
 
+SIGNING_IDENTITY_APP="Developer ID Application: Micah Lee"
+SIGNING_IDENTITY_INSTALLER="Developer ID Installer: Micah Lee"
+
 # deleting dist
 echo Deleting dist folder
 rm -rf $ROOT/dist &>/dev/null 2>&1
@@ -12,3 +15,16 @@ echo Building OnionShare.app
 python setup.py py2app
 
 # codesign the .app
+python $ROOT/install/prepare_for_codesign.py
+cd dist
+
+# for some reason --deep fails, so sign each binary individually
+codesign -vvvv -s "Developer ID Application: Micah Lee" OnionShare.app/Contents/Frameworks/QtCore.framework
+codesign -vvvv -s "Developer ID Application: Micah Lee" OnionShare.app/Contents/Frameworks/QtGui.framework
+codesign -vvvv -s "Developer ID Application: Micah Lee" OnionShare.app/Contents/Frameworks/Python.framework
+codesign -vvvv -s "Developer ID Application: Micah Lee" OnionShare.app/Contents/Frameworks/libssl.1.0.0.dylib
+codesign -vvvv -s "Developer ID Application: Micah Lee" OnionShare.app/Contents/Frameworks/libcrypto.1.0.0.dylib
+codesign -vvvv -s "Developer ID Application: Micah Lee" OnionShare.app/Contents/MacOS/python
+codesign -vvvv -s "Developer ID Application: Micah Lee" OnionShare.app
+
+productbuild --component OnionShare.app /Applications OnionShare.pkg --sign "$SIGNING_IDENTITY_INSTALLER"
diff --git a/install/prepare_for_codesign.py b/install/prepare_for_codesign.py
new file mode 100644
index 0000000..3e99eec
--- /dev/null
+++ b/install/prepare_for_codesign.py
@@ -0,0 +1,36 @@
+"""
+This script is from https://github.com/kamillus/py2app-pyqt-codesign-fix-os-x
+and slightly modified.
+"""
+
+import os
+import re
+import shutil
+
+path_to_app = "dist/OnionShare.app"
+
+def move_func(file):
+    print "moving %s to %s " % (os.path.join(dir_name, file), os.path.join(dir_name, 'Versions', "Current"))
+    try:
+        shutil.move(os.path.join(dir_name, file), os.path.join(dir_name, 'Versions', "Current"))
+    except Exception as e:
+        print e
+    return file
+
+def filter_func(x):
+    return x != "Versions"
+
+
+dir = path_to_app + "/Contents/Frameworks/"
+p = re.compile('^Qt(.+)\.framework$')
+
+for dir_name, subdir_list, file_list in os.walk(dir):
+    dir_name_short = dir_name.replace(dir, "")
+
+    if p.match(dir_name_short):
+        print('Found directory: %s' % dir_name_short)
+        print file_list
+        if os.path.islink(os.path.join(dir_name, file_list[0])):
+            os.unlink(os.path.join(dir_name, file_list[0]))
+        list(map(move_func, file_list[1:]))
+        list(map(move_func, filter(filter_func, subdir_list)))

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/onionshare.git



More information about the Pkg-anonymity-tools mailing list