Merge lp:~mikemc/ubuntuone-windows-installer/fix-signing-certname into lp:ubuntuone-windows-installer

Proposed by Mike McCracken
Status: Merged
Approved by: dobey
Approved revision: 162
Merged at revision: 160
Proposed branch: lp:~mikemc/ubuntuone-windows-installer/fix-signing-certname
Merge into: lp:ubuntuone-windows-installer
Diff against target: 94 lines (+36/-10)
3 files modified
scripts/codesign-darwin-verify.sh (+9/-4)
scripts/codesign-darwin.sh (+8/-2)
scripts/setup-mac.py (+19/-4)
To merge this branch: bzr merge lp:~mikemc/ubuntuone-windows-installer/fix-signing-certname
Reviewer Review Type Date Requested Status
dobey (community) Approve
Brian Curtin (community) Approve
Review via email: mp+144820@code.launchpad.net

Commit message

- Allow code signing on macos with different certs, embed CN into fseventsd during build phase.

Description of the change

- Allow code signing on macos with different certs, embed CN into fseventsd during build phase.

To post a comment you must log in.
Revision history for this message
Brian Curtin (brian.curtin) :
review: Approve
Revision history for this message
dobey (dobey) :
review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :

Attempt to merge into lp:ubuntuone-windows-installer failed due to conflicts:

duplicate in scripts/data/update.conf.moved

162. By Mike McCracken

merge with trunk, fix conflict

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scripts/codesign-darwin-verify.sh'
2--- scripts/codesign-darwin-verify.sh 2012-11-20 22:37:34 +0000
3+++ scripts/codesign-darwin-verify.sh 2013-02-01 21:15:49 +0000
4@@ -25,9 +25,14 @@
5 rm tmp.req
6
7 echo "\nChecking that the app satisfies the helper's SMAuthorizedClients requirement"
8-otool -s __TEXT __info_plist $helper | grep "^[0-9a-f]\{8,16\}" | xxd -r - - > tmp.plist
9-perl -nle 'print "identifier $1 and certificate leaf[subject.CN] = \"$2\"" if /identifier (.*) and certificate leaf\[subject.CN\] = "(.*)"/;' tmp.plist > tmp.req
10-$codesign -v -v -R tmp.req Ubuntu\ One.app
11-rm tmp.plist tmp.req
12+
13+echo "\nActually skipping that because xxd is really slow for some reason"
14+# otool -s __TEXT __info_plist $helper | grep "^[0-9a-f]\{8,16\}" | xxd -r - - > tmp.plist
15+# perl -nle 'print "identifier $1 and certificate leaf[subject.CN] = \"$2\"" if /identifier (.*) and certificate leaf\[subject.CN\] = "(.*)"/;' tmp.plist > tmp.req
16+# $codesign -v -v -R tmp.req Ubuntu\ One.app
17+# rm tmp.plist tmp.req
18+
19+echo "\nChecking spctl rule output, look for 'Developer ID' "
20+find ./Ubuntu\ One.app -name "*.app" -print0 | xargs -0 spctl -a --verbose=9
21
22 echo Done.
23
24=== modified file 'scripts/codesign-darwin.sh'
25--- scripts/codesign-darwin.sh 2012-11-20 22:37:34 +0000
26+++ scripts/codesign-darwin.sh 2013-02-01 21:15:49 +0000
27@@ -3,7 +3,7 @@
28 codesign=/usr/bin/codesign
29
30 set -x
31-set -e
32+
33
34 $codesign -f -s "$@" com.ubuntu.one.fsevents
35
36@@ -11,6 +11,12 @@
37
38 cp com.ubuntu.one.fsevents "Ubuntu One.app/Contents/Library/LaunchServices/"
39
40-$codesign -f -s "$@" "Ubuntu One.app"
41+find Ubuntu\ One.app -name "*.dylib" -exec $codesign -f -s "$@" {} \;
42+
43+find Ubuntu\ One.app -iname "python" -type f -exec $codesign -f -s "$@" {} \;
44+
45+find Ubuntu\ One.app/Contents -name "*.app" -exec $codesign -f -s "$@" {} \;
46+
47+$codesign -f -s "$@" Ubuntu\ One.app
48
49 echo Done.
50
51=== modified file 'scripts/setup-mac.py'
52--- scripts/setup-mac.py 2012-12-10 18:17:41 +0000
53+++ scripts/setup-mac.py 2013-02-01 21:15:49 +0000
54@@ -57,7 +57,12 @@
55 # NOTE - this needs to be the full CN, not just a substring.
56 # /usr/bin/codesign will find the right cert if you pass it a
57 # substring, but the rest of the system wants an exact match.
58-CODESIGN_CN = "Mac Developer: Michael McCracken (GP72FH8MSU)"
59+if "U1_CODESIGN_CN" not in os.environ:
60+ print "Must set U1_CODESIGN_CN to the CN of the cert to use in the helper"
61+ print "Exiting."
62+ sys.exit()
63+
64+CODESIGN_CN = os.environ["U1_CODESIGN_CN"]
65
66 FSEVENTS_DAEMON_NAME = "com.ubuntu.one.fsevents"
67
68@@ -481,13 +486,23 @@
69 print "building fsevents daemon"
70 log_file_name = os.path.join(INSTALL_DIR,
71 "fsevents-daemon-build.log")
72+
73 with open(log_file_name, 'w') as logfile:
74 proj_path = os.path.join(self.source_dir,
75- "ubuntuone-fsevents-daemon",
76- "objc")
77+ "ubuntuone-fsevents-daemon")
78+ objc_path = os.path.join(proj_path, "objc")
79+ data_path = os.path.join(proj_path, "data")
80+ plist_file_name = os.path.join(data_path,
81+ "fseventsd-Info.plist")
82+ with open(plist_file_name + ".tmpl", "rb") as infoplist_tmpl:
83+ plist_tmpl_data = infoplist_tmpl.read()
84+ plist_data = plist_tmpl_data.replace("@CODESIGN_CN@", CODESIGN_CN)
85+ with open(plist_file_name, "wb") as infoplist:
86+ infoplist.write(plist_data)
87+
88 cmd = ("cd %s && "
89 "xcodebuild -scheme FsEvents SYMROOT=%r clean build" %
90- (proj_path, INSTALL_DIR))
91+ (objc_path, INSTALL_DIR))
92 retval = subprocess.call(cmd,
93 shell=True,
94 stderr=subprocess.STDOUT,

Subscribers

People subscribed via source and target branches