Merge lp:~mikemc/ubuntuone-windows-installer/gimme-u1sdtool into lp:ubuntuone-windows-installer

Proposed by Mike McCracken on 2012-08-28
Status: Superseded
Proposed branch: lp:~mikemc/ubuntuone-windows-installer/gimme-u1sdtool
Merge into: lp:ubuntuone-windows-installer
Diff against target: 132 lines (+66/-2)
3 files modified
scripts/codesign-darwin.sh (+16/-0)
scripts/data/macapp_template.plist (+2/-0)
scripts/setup-mac.py (+48/-2)
To merge this branch: bzr merge lp:~mikemc/ubuntuone-windows-installer/gimme-u1sdtool
Reviewer Review Type Date Requested Status
Ubuntu One hackers 2012-08-28 Pending
Review via email: mp+121679@code.launchpad.net

This proposal has been superseded by a proposal from 2012-08-28.

Commit Message

- Add U1SDTool to the app package as a sub-app. (LP: #1042855)

Description of the Change

- Add U1SDTool to the app package as a sub-app. (LP: #1042855)

To test, build the bundle and try using u1sdtool from the command line thusly:

% ./UbuntuOne.app/Contents/Resources/UbuntuOne\ Syncdaemon\ Debug.app/Contents/MacOS/u1sdtool -h

% ./UbuntuOne.app/Contents/Resources/UbuntuOne\ Syncdaemon\ Debug.app/Contents/MacOS/u1sdtool -s

and &, etc… and so on.

To post a comment you must log in.

Unmerged revisions

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 18:42:20 +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/data/macapp_template.plist'
23--- scripts/data/macapp_template.plist 2012-08-15 21:55:36 +0000
24+++ scripts/data/macapp_template.plist 2012-08-28 18:42:20 +0000
25@@ -12,5 +12,7 @@
26 <string>3.0.0</string>
27 <key>CFBundleVersion</key>
28 <string>3.0.0.1</string>
29+ <key>CFBundleIconFile</key>
30+ <string>u1_mac_icon.icns</string>
31 </dict>
32 </plist>
33
34=== modified file 'scripts/setup-mac.py'
35--- scripts/setup-mac.py 2012-08-15 22:38:28 +0000
36+++ scripts/setup-mac.py 2012-08-28 18:42:20 +0000
37@@ -52,6 +52,8 @@
38 print "or see http://bitbucket.com/ronaldoussoren/py2app/"
39 sys.exit()
40
41+CODESIGN_CN = "Joe Developer"
42+FSEVENTS_DAEMON_NAME = "com.ubuntu.one.fsevents"
43
44 APP_NAMES = {'ubuntu-sso-login': 'Ubuntu SSO Helper',
45 'ubuntu-sso-login-qt': 'Ubuntu Single Sign-On',
46@@ -60,6 +62,7 @@
47 'ubuntuone-syncdaemon': 'UbuntuOne Syncdaemon',
48 'ubuntuone-control-panel-qt': 'UbuntuOne',
49 'ubuntuone-proxy-tunnel': 'UbuntuOne Proxy Tunnel',
50+ 'u1sdtool': 'U1SDTool'
51 }
52
53 LOG_LEVEL = "DEBUG"
54@@ -224,7 +227,7 @@
55
56 shutil.copyfile(os.path.join(self.source_dir, "ubuntuone-client",
57 "bin", "u1sdtool"),
58- os.path.join("bin", "u1sdtool"))
59+ os.path.join("bin", "u1sdtool.py"))
60
61 dest = os.path.join("bin", "ubuntuone-proxy-tunnel.py")
62 shutil.copyfile(os.path.join(self.source_dir, "ubuntuone-client",
63@@ -426,6 +429,25 @@
64 with open(os.path.join("data", "logging.conf"), "wb") as logconf:
65 logconf.write(data)
66
67+ # build fsevents daemon
68+ log_file_name = os.path.join(INSTALL_DIR,
69+ "fsevents-daemon-build.log")
70+ with open(log_file_name, 'w') as logfile:
71+ proj_path = os.path.join(self.source_dir,
72+ "ubuntuone-fsevents-daemon",
73+ "objc")
74+ cmd = ("cd %s && "
75+ "xcodebuild -scheme FsEvents SYMROOT=%r clean build" %
76+ (proj_path, INSTALL_DIR))
77+ retval = subprocess.call(cmd,
78+ shell=True,
79+ stderr=subprocess.STDOUT,
80+ stdout=logfile
81+ )
82+ if retval != 0:
83+ print "error running %r in %r. look in %r for details" %\
84+ (cmd, os.getcwd(), logfile.name)
85+
86 # Install fsevents_daemon client code: required because it is
87 # a subpackage of ubuntuone, which all needs to be in the same
88 # place for py2app to copy it
89@@ -523,6 +545,14 @@
90 CFBundleExecutable=exename,
91 CFBundleName=name)
92
93+ if is_main_app:
94+ req_str = ("identifier %s and "
95+ "certificate leaf[subject.CN] = \"%s\"" %
96+ (FSEVENTS_DAEMON_NAME,
97+ CODESIGN_CN))
98+ req_dict = {FSEVENTS_DAEMON_NAME: req_str}
99+ plist.update(SMPrivilegedExecutables=req_dict)
100+
101 options = copy.deepcopy(master_options)
102 options.update({"plist": plist,
103 "bdist_base": os.path.join("build", exename),
104@@ -565,6 +595,10 @@
105 "com.ubuntu.one.syncdaemon",
106 "ubuntuone-syncdaemon")
107
108+ u1sdtool_app_path = do_setup(True,
109+ "com.ubuntu.one.u1sdtool",
110+ "u1sdtool")
111+
112 control_panel_app_path = do_setup(False,
113 "com.ubuntu.one.controlpanel",
114 "ubuntuone-control-panel-qt",
115@@ -751,4 +785,16 @@
116
117 main_zip.close()
118
119- print "DONE. see dist/ for the .app."
120+ # make a package to send for signing
121+
122+ sign_dir = os.path.join("dist", "build_to_sign")
123+ os.makedirs(sign_dir)
124+
125+ shutil.move(control_panel_app_path, sign_dir)
126+ daemon_build_path = os.path.join(INSTALL_DIR, "Debug",
127+ FSEVENTS_DAEMON_NAME)
128+ shutil.copy(daemon_build_path, sign_dir)
129+ shutil.copy(os.path.join("codesign-darwin.sh"),
130+ sign_dir)
131+
132+ print "Done. See %r for the signing package." % sign_dir

Subscribers

People subscribed via source and target branches