mirror of
https://gitlab.com/openlp/packaging.git
synced 2024-12-22 04:52:50 +00:00
Add codesigning(OS X).
Add apple help file(OS X).
This commit is contained in:
parent
3bd987ffcf
commit
a31003335a
@ -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>
|
||||
|
@ -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
|
||||
@ -567,12 +567,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):
|
||||
"""
|
||||
@ -730,6 +759,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.')
|
||||
|
Loading…
Reference in New Issue
Block a user