Merge lp:~mikemc/ubuntuone-windows-installer/build-sign-daemon into lp:ubuntuone-windows-installer

Proposed by Mike McCracken on 2012-08-28
Status: Merged
Approved by: Mike McCracken on 2012-08-28
Approved revision: 143
Merged at revision: 134
Proposed branch: lp:~mikemc/ubuntuone-windows-installer/build-sign-daemon
Merge into: lp:ubuntuone-windows-installer
Diff against target: 92 lines (+58/-1)
2 files modified
scripts/codesign-darwin.sh (+16/-0)
scripts/setup-mac.py (+42/-1)
To merge this branch: bzr merge lp:~mikemc/ubuntuone-windows-installer/build-sign-daemon
Reviewer Review Type Date Requested Status
Roberto Alsina (community) 2012-08-28 Approve on 2012-08-28
Review via email: mp+121668@code.launchpad.net

Commit Message

- Prepare step now includes a clean daemon build step and makes a bundle to send for signing. (LP: #1026235)

Description of the Change

- Prepare step now includes a clean daemon build step and makes a bundle to send for signing. (LP: #1026235)

To post a comment you must log in.
Roberto Alsina (ralsina) :
review: Approve
Mike McCracken (mikemc) wrote :

NOTE about Joe Developer - this is just the name used for Apple's signing cert in the SMJobBless example. It'll do for now, until we know what the real cert ID will be.

https://developer.apple.com/library/mac/#samplecode/SMJobBless/Listings/ReadMe_txt.html#//apple_ref/doc/uid/DTS40010071-ReadMe_txt-DontLinkElementID_3

Look at the section "building the sample"

it's important to name the cert "Joe Developer" - the code currently expects that name.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'scripts/codesign-darwin.sh'
2--- scripts/codesign-darwin.sh 1970-01-01 00:00:00 +0000
3+++ scripts/codesign-darwin.sh 2012-08-28 17:25:21 +0000
4@@ -0,0 +1,16 @@
5+#!/bin/bash
6+
7+set -x
8+set -e
9+
10+/usr/bin/codesign -f -s "$@" com.ubuntu.one.fsevents
11+
12+mkdir -p UbuntuOne.app/Contents/Library/LaunchServices
13+
14+mv com.ubuntu.one.fsevents UbuntuOne.app/Contents/Library/LaunchServices/
15+
16+/usr/bin/codesign -f -s "$@" UbuntuOne.app
17+
18+/usr/bin/codesign -vvvv -d UbuntuOne.app
19+
20+echo Done.
21
22=== modified file 'scripts/setup-mac.py'
23--- scripts/setup-mac.py 2012-08-15 22:38:28 +0000
24+++ scripts/setup-mac.py 2012-08-28 17:25:21 +0000
25@@ -52,6 +52,8 @@
26 print "or see http://bitbucket.com/ronaldoussoren/py2app/"
27 sys.exit()
28
29+CODESIGN_CN = "Joe Developer"
30+FSEVENTS_DAEMON_NAME = "com.ubuntu.one.fsevents"
31
32 APP_NAMES = {'ubuntu-sso-login': 'Ubuntu SSO Helper',
33 'ubuntu-sso-login-qt': 'Ubuntu Single Sign-On',
34@@ -426,6 +428,25 @@
35 with open(os.path.join("data", "logging.conf"), "wb") as logconf:
36 logconf.write(data)
37
38+ # build fsevents daemon
39+ log_file_name = os.path.join(INSTALL_DIR,
40+ "fsevents-daemon-build.log")
41+ with open(log_file_name, 'w') as logfile:
42+ proj_path = os.path.join(self.source_dir,
43+ "ubuntuone-fsevents-daemon",
44+ "objc")
45+ cmd = ("cd %s && "
46+ "xcodebuild -scheme FsEvents SYMROOT=%r clean build" %
47+ (proj_path, INSTALL_DIR))
48+ retval = subprocess.call(cmd,
49+ shell=True,
50+ stderr=subprocess.STDOUT,
51+ stdout=logfile
52+ )
53+ if retval != 0:
54+ print "error running %r in %r. look in %r for details" %\
55+ (cmd, os.getcwd(), logfile.name)
56+
57 # Install fsevents_daemon client code: required because it is
58 # a subpackage of ubuntuone, which all needs to be in the same
59 # place for py2app to copy it
60@@ -523,6 +544,14 @@
61 CFBundleExecutable=exename,
62 CFBundleName=name)
63
64+ if is_main_app:
65+ req_str = ("identifier %s and "
66+ "certificate leaf[subject.CN] = \"%s\"" %
67+ (FSEVENTS_DAEMON_NAME,
68+ CODESIGN_CN))
69+ req_dict = {FSEVENTS_DAEMON_NAME: req_str}
70+ plist.update(SMPrivilegedExecutables=req_dict)
71+
72 options = copy.deepcopy(master_options)
73 options.update({"plist": plist,
74 "bdist_base": os.path.join("build", exename),
75@@ -751,4 +780,16 @@
76
77 main_zip.close()
78
79- print "DONE. see dist/ for the .app."
80+ # make a package to send for signing
81+
82+ sign_dir = os.path.join("dist", "build_to_sign")
83+ os.makedirs(sign_dir)
84+
85+ shutil.move(control_panel_app_path, sign_dir)
86+ daemon_build_path = os.path.join(INSTALL_DIR, "Debug",
87+ FSEVENTS_DAEMON_NAME)
88+ shutil.copy(daemon_build_path, sign_dir)
89+ shutil.copy(os.path.join("codesign-darwin.sh"),
90+ sign_dir)
91+
92+ print "Done. See %r for the signing package." % sign_dir

Subscribers

People subscribed via source and target branches