1
0
mirror of https://gitlab.com/openlp/packaging.git synced 2024-12-22 13:02:50 +00:00

Add codesigning(OS X). Add apple help file(OS X). Add missed ssl runtime hook(OS X).

bzr-revno: 24
This commit is contained in:
Jonathan Springer 2015-08-28 21:31:35 +02:00 committed by Raoul Snyman
commit a4fbaa6d7f
2 changed files with 36 additions and 2 deletions

View File

@ -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>

View File

@ -98,7 +98,7 @@ import plistlib
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
@ -568,12 +568,41 @@ class MacosxBuilder(object):
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):
"""
@ -731,6 +760,7 @@ class MacosxBuilder(object):
if self.args.update_translations:
self.update_translations()
self.compile_translations()
self.code_sign()
self.create_dmg_file()
self._print('Done.')