← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~springermac/openlp/packaging into lp:openlp/packaging

 

Jonathan Springer has proposed merging lp:~springermac/openlp/packaging into lp:openlp/packaging with lp:~springermac/openlp/documentation-applehelp as a prerequisite.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~springermac/openlp/packaging/+merge/268965

Add codesigning(OS X).
Add apple help file(OS X).
-- 
Your team OpenLP Core is requested to review the proposed merge of lp:~springermac/openlp/packaging into lp:openlp/packaging.
=== modified file 'osx/Info.plist'
--- osx/Info.plist	2015-05-26 02:50:06 +0000
+++ osx/Info.plist	2015-08-24 19:35:10 +0000
@@ -120,5 +120,9 @@
 	<true/>
 	<key>NSHighResolutionCapable</key>
 	<true/>
+	<key>CFBundleHelpBookFolder</key>
+	<string>OpenLP.help</string>
+	<key>CFBundleHelpBookName</key>
+	<string>org.openlp.OpenLP.help</string>
 </dict>
 </plist>

=== modified file 'osx/macosx-builder.py'
--- osx/macosx-builder.py	2015-08-24 00:53:43 +0000
+++ osx/macosx-builder.py	2015-08-24 19:35:10 +0000
@@ -98,7 +98,7 @@
 import signal
 import subprocess
 import sys
-from shutil import copy, rmtree
+from shutil import copy, copytree, rmtree
 from subprocess import Popen, PIPE
 from configparser import ConfigParser
 from argparse import ArgumentParser
@@ -567,12 +567,41 @@
             rmtree(self.manual_build_path)
         self._print('Running Sphinx...')
         os.chdir(self.manual_path)
-        sphinx = Popen((self.sphinx, '-b', 'htmlhelp', '-d', 'build/doctrees', 'source', 'build/htmlhelp'), stdout=PIPE)
+        sphinx = Popen((self.sphinx, '-b', 'applehelp', '-d', 'build/doctrees', 'source', 'build/applehelp'),
+                       stdout=PIPE)
         output, error = sphinx.communicate()
         code = sphinx.wait()
         if code != 0:
             self._print(output)
             raise Exception('Error running Sphinx')
+        self._print('Copying help file...')
+        source = os.path.join(self.manual_build_path, 'applehelp')
+        files = os.listdir(source)
+        for filename in files:
+            if filename.endswith('.help'):
+                self._print_verbose('... %s', filename)
+                copytree(os.path.join(source, filename),
+                         os.path.join(self.dist_app_path, 'Contents', 'Resources', filename))
+
+    def code_sign(self):
+        certificate = self.config.get('codesigning', 'certificate')
+        self._print('Checking for certificate...')
+        security = Popen(('security', 'find-certificate', '-c', certificate),
+                         stdout=PIPE)
+        output, error = security.communicate()
+        code = security.wait()
+        if code != 0:
+            self._print('Could not find certificate \"%s\" in Keychain...', certificate)
+            self._print('Codesigning will not work without a certificate!!')
+            self._print(output)
+        else:
+            self._print('Codesigning app...')
+            codesign = Popen(('codesign', '--deep', '-s', certificate, self.dist_app_path))
+            output, error = codesign.communicate()
+            code = codesign.wait()
+            if code != 0:
+                self._print(output)
+                raise Exception('Error running codesign')
 
     def create_dmg_file(self):
         """
@@ -730,6 +759,7 @@
             if self.args.update_translations:
                 self.update_translations()
             self.compile_translations()
+        self.code_sign()
         self.create_dmg_file()
 
         self._print('Done.')