Use using content::PermissionType and other cleanup.
[chromium-blink-merge.git] / chrome / chrome_installer.gypi
blob80763c3e1222c1a656f0abe8575b0395f070fe77
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6   'variables': {
7     'lastchange_path': '../build/util/LASTCHANGE',
8     'libpeer_target_type%': 'static_library',
9     'branding_dir': 'app/theme/<(branding_path_component)',
10     'branding_dir_100': 'app/theme/default_100_percent/<(branding_path_component)',
11   },
12   'conditions': [
13     ['OS=="win"', {
14       'targets': [
15         {
16           'target_name': 'gcapi_dll',
17           'type': 'loadable_module',
18           'dependencies': [
19             'gcapi_lib',
20           ],
21           'include_dirs': [
22             '..',
23           ],
24           'sources': [
25             'installer/gcapi/gcapi.def',
26             'installer/gcapi/gcapi_dll.cc',
27           ],
28         },
29         {
30           'target_name': 'gcapi_lib',
31           'type': 'static_library',
32           'dependencies': [
33             'installer_util',
34             '../base/base.gyp:base',
35             '../chrome/chrome.gyp:launcher_support',
36             '../google_update/google_update.gyp:google_update',
37           ],
38           'include_dirs': [
39             '..',
40           ],
41           'sources': [
42             'installer/gcapi/gcapi.cc',
43             'installer/gcapi/gcapi.h',
44             'installer/gcapi/gcapi_omaha_experiment.cc',
45             'installer/gcapi/gcapi_omaha_experiment.h',
46             'installer/gcapi/gcapi_reactivation.cc',
47             'installer/gcapi/gcapi_reactivation.h',
48           ],
49           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
50           'msvs_disabled_warnings': [ 4267, ],
51         },
52         {
53           'target_name': 'gcapi_test',
54           'type': 'executable',
55           'dependencies': [
56             'common',
57             'gcapi_dll',
58             'gcapi_lib',
59             'installer_util',
60             '../base/base.gyp:base',
61             '../base/base.gyp:test_support_base',
62             '../testing/gtest.gyp:gtest',
63           ],
64           'include_dirs': [
65             '..',
66           ],
67           'sources': [
68             'installer/gcapi/gcapi_last_run_test.cc',
69             'installer/gcapi/gcapi_omaha_experiment_test.cc',
70             'installer/gcapi/gcapi_reactivation_test.cc',
71             'installer/gcapi/gcapi_test.cc',
72             'installer/gcapi/gcapi_test.rc',
73             'installer/gcapi/gcapi_test_registry_overrider.cc',
74             'installer/gcapi/gcapi_test_registry_overrider.h',
75             'installer/gcapi/resource.h',
76           ],
77         },
78         {
79           # GN version: //chrome/installer/util:installer_util_unittests
80           'target_name': 'installer_util_unittests',
81           'type': 'executable',
82           'dependencies': [
83             'installer_util',
84             'installer_util_strings',
85             'installer/upgrade_test.gyp:alternate_version_generator_lib',
86             '../base/base.gyp:base',
87             '../base/base.gyp:base_i18n',
88             '../base/base.gyp:test_support_base',
89             '../chrome/chrome.gyp:chrome_version_resources',
90             '../content/content.gyp:content_common',
91             '../testing/gmock.gyp:gmock',
92             '../testing/gtest.gyp:gtest',
93           ],
94           'include_dirs': [
95             '..',
96           ],
97           'sources': [
98             # List duplicated in GN build.
99             '<(SHARED_INTERMEDIATE_DIR)/chrome_version/other_version.rc',
100             '<(SHARED_INTERMEDIATE_DIR)/chrome/installer/util/installer_util_strings.rc',
101             'installer/setup/compat_checks_unittest.cc',
102             'installer/setup/setup_constants.cc',
103             'installer/util/advanced_firewall_manager_win_unittest.cc',
104             'installer/util/callback_work_item_unittest.cc',
105             'installer/util/channel_info_unittest.cc',
106             'installer/util/copy_tree_work_item_unittest.cc',
107             'installer/util/create_dir_work_item_unittest.cc',
108             'installer/util/create_reg_key_work_item_unittest.cc',
109             'installer/util/delete_after_reboot_helper_unittest.cc',
110             'installer/util/delete_reg_key_work_item_unittest.cc',
111             'installer/util/delete_reg_value_work_item_unittest.cc',
112             'installer/util/delete_tree_work_item_unittest.cc',
113             'installer/util/duplicate_tree_detector_unittest.cc',
114             'installer/util/fake_installation_state.h',
115             'installer/util/fake_product_state.h',
116             'installer/util/google_update_settings_unittest.cc',
117             'installer/util/install_util_unittest.cc',
118             'installer/util/installation_validation_helper.cc',
119             'installer/util/installation_validation_helper.h',
120             'installer/util/installation_validator_unittest.cc',
121             'installer/util/installer_state_unittest.cc',
122             'installer/util/installer_util_test_common.cc',
123             'installer/util/installer_util_test_common.h',
124             'installer/util/language_selector_unittest.cc',
125             'installer/util/legacy_firewall_manager_win_unittest.cc',
126             'installer/util/logging_installer_unittest.cc',
127             'installer/util/lzma_util_unittest.cc',
128             'installer/util/master_preferences_unittest.cc',
129             'installer/util/move_tree_work_item_unittest.cc',
130             'installer/util/product_state_unittest.cc',
131             'installer/util/product_unittest.cc',
132             'installer/util/product_unittest.h',
133             'installer/util/registry_key_backup_unittest.cc',
134             'installer/util/registry_test_data.cc',
135             'installer/util/registry_test_data.h',
136             'installer/util/run_all_unittests.cc',
137             'installer/util/self_cleaning_temp_dir_unittest.cc',
138             'installer/util/set_reg_value_work_item_unittest.cc',
139             'installer/util/shell_util_unittest.cc',
140             'installer/util/uninstall_metrics_unittest.cc',
141             'installer/util/wmi_unittest.cc',
142             'installer/util/work_item_list_unittest.cc',
143           ],
144           'msvs_settings': {
145             'VCManifestTool': {
146               'AdditionalManifestFiles': [
147                 '$(ProjectDir)\\installer\\mini_installer\\mini_installer.exe.manifest',
148               ],
149             },
150           },
151         },
152         {
153           # GN version: //chrome/installer/util:strings
154           'target_name': 'installer_util_strings',
155           'type': 'none',
156           'actions': [
157             {
158               'action_name': 'installer_util_strings',
159               'variables': {
160                 'create_string_rc_py': 'installer/util/prebuild/create_string_rc.py',
161                 'brand_strings': '<(branding_path_component)_strings',
162                 'gen_dir': '<(SHARED_INTERMEDIATE_DIR)/chrome/installer/util',
163               },
165               'inputs': [
166                 '<(create_string_rc_py)',
167                 'app/<(brand_strings).grd',
168               ],
169               'outputs': [
170                 '<(gen_dir)/installer_util_strings.h',
171                 '<(gen_dir)/installer_util_strings.rc',
172               ],
173               'action': ['python',
174                          '<(create_string_rc_py)',
175                          '-i', 'app/<(brand_strings).grd:resources',
176                          '-n', 'installer_util_strings',
177                          '-o', '<(gen_dir)',],
178               'message': 'Generating installer_util_strings',
179             },
180           ],
181           'direct_dependent_settings': {
182             'include_dirs': [
183               '<(SHARED_INTERMEDIATE_DIR)',
184             ],
185           },
186         },
187         {
188           # GN version: //chrome/installer/launcher_support
189           'target_name': 'launcher_support',
190           'type': 'static_library',
191           'include_dirs': [
192             '..',
193           ],
194           'direct_dependent_settings': {
195             'include_dirs': [
196               '..',
197             ],
198           },
199           'dependencies': [
200             '<(DEPTH)/base/base.gyp:base',
201           ],
202           'sources': [
203             'installer/launcher_support/chrome_launcher_support.cc',
204             'installer/launcher_support/chrome_launcher_support.h',
205           ],
206         },
207         {
208           'target_name': 'setup',
209           'type': 'executable',
210           'dependencies': [
211             'installer_util',
212             'installer_util_strings',
213             '../base/base.gyp:base',
214             '../breakpad/breakpad.gyp:breakpad_handler',
215             '../chrome/common_constants.gyp:common_constants',
216             '../chrome_elf/chrome_elf.gyp:chrome_elf_constants',
217             '../rlz/rlz.gyp:rlz_lib',
218             '../third_party/zlib/zlib.gyp:zlib',
219           ],
220           'include_dirs': [
221             '..',
222             '<(INTERMEDIATE_DIR)',
223             '<(SHARED_INTERMEDIATE_DIR)/setup',
224           ],
225           'direct_dependent_settings': {
226             'include_dirs': [
227               '<(SHARED_INTERMEDIATE_DIR)/setup',
228             ],
229           },
230           'sources': [
231             '<(SHARED_INTERMEDIATE_DIR)/chrome/installer/util/installer_util_strings.rc',
232             'installer/mini_installer/chrome.release',
233             'installer/setup/app_launcher_installer.cc',
234             'installer/setup/app_launcher_installer.h',
235             'installer/setup/archive_patch_helper.cc',
236             'installer/setup/archive_patch_helper.h',
237             'installer/setup/install.cc',
238             'installer/setup/install.h',
239             'installer/setup/install_worker.cc',
240             'installer/setup/install_worker.h',
241             'installer/setup/setup.ico',
242             'installer/setup/setup.rc',
243             'installer/setup/setup_constants.cc',
244             'installer/setup/setup_constants.h',
245             'installer/setup/setup_exe_version.rc.version',
246             'installer/setup/setup_main.cc',
247             'installer/setup/setup_main.h',
248             'installer/setup/setup_resource.h',
249             'installer/setup/setup_util.cc',
250             'installer/setup/setup_util.h',
251             'installer/setup/uninstall.cc',
252             'installer/setup/uninstall.h',
253           ],
254           'msvs_settings': {
255             'VCLinkerTool': {
256               'SubSystem': '2',     # Set /SUBSYSTEM:WINDOWS
257             },
258             'VCManifestTool': {
259               'AdditionalManifestFiles': [
260                 '$(ProjectDir)\\installer\\setup\\setup.exe.manifest',
261               ],
262             },
263           },
264           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
265           'msvs_disabled_warnings': [ 4267, ],
266           'rules': [
267             {
268               'rule_name': 'setup_version',
269               'extension': 'version',
270               'variables': {
271                 'version_py_path': '<(DEPTH)/build/util/version.py',
272                 'template_input_path': 'installer/setup/setup_exe_version.rc.version',
273               },
274               'inputs': [
275                 '<(template_input_path)',
276                 '<(version_path)',
277                 '<(lastchange_path)',
278                 '<(branding_dir)/BRANDING',
279               ],
280               'outputs': [
281                 '<(SHARED_INTERMEDIATE_DIR)/setup/setup_exe_version.rc',
282               ],
283               'action': [
284                 'python', '<(version_py_path)',
285                 '-f', '<(version_path)',
286                 '-f', '<(lastchange_path)',
287                 '-f', '<(branding_dir)/BRANDING',
288                 '<(template_input_path)',
289                 '<@(_outputs)',
290               ],
291               'process_outputs_as_sources': 1,
292               'message': 'Generating version information'
293             },
294           ],
295           'conditions': [
296             ['target_arch=="ia32"', {
297               'msvs_settings': {
298                 'VCCLCompilerTool': {
299                   'EnableEnhancedInstructionSet': '4',  # NoExtensions
300                 },
301               },
302             }],
303           ],
304         },
305         {
306           'target_name': 'setup_unittests',
307           'type': 'executable',
308           'dependencies': [
309             'installer_util',
310             'installer_util_strings',
311             '../base/base.gyp:base',
312             '../base/base.gyp:base_i18n',
313             '../base/base.gyp:test_support_base',
314             '../testing/gmock.gyp:gmock',
315             '../testing/gtest.gyp:gtest',
316           ],
317           'include_dirs': [
318             '..',
319             '<(INTERMEDIATE_DIR)',
320           ],
321           # TODO(robertshield): Move the items marked with "Move to lib"
322           # below into a separate lib and then link both setup.exe and
323           # setup_unittests.exe against that.
324           'sources': [
325             'installer/mini_installer/chrome.release',  # Move to lib
326             'installer/mini_installer/appid.h',
327             'installer/mini_installer/chrome_appid.cc',
328             'installer/mini_installer/configuration.cc',
329             'installer/mini_installer/configuration.h',
330             'installer/mini_installer/configuration_test.cc',
331             'installer/mini_installer/decompress.cc',
332             'installer/mini_installer/decompress.h',
333             'installer/mini_installer/decompress_test.cc',
334             'installer/mini_installer/mini_string.cc',
335             'installer/mini_installer/mini_string.h',
336             'installer/mini_installer/mini_string_test.cc',
337             'installer/setup/app_launcher_installer.cc',  # Move to lib
338             'installer/setup/app_launcher_installer.h',  # Move to lib
339             'installer/setup/archive_patch_helper.cc',  # Move to lib
340             'installer/setup/archive_patch_helper.h',   # Move to lib
341             'installer/setup/archive_patch_helper_unittest.cc',
342             'installer/setup/install.cc',               # Move to lib
343             'installer/setup/install.h',                # Move to lib
344             'installer/setup/install_unittest.cc',
345             'installer/setup/install_worker.cc',        # Move to lib
346             'installer/setup/install_worker.h',         # Move to lib
347             'installer/setup/install_worker_unittest.cc',
348             'installer/setup/run_all_unittests.cc',
349             'installer/setup/setup_constants.cc',       # Move to lib
350             'installer/setup/setup_constants.h',        # Move to lib
351             'installer/setup/setup_unittests.rc',
352             'installer/setup/setup_unittests_resource.h',
353             'installer/setup/setup_util.cc',
354             'installer/setup/setup_util_unittest.cc',
355             'installer/setup/setup_util_unittest.h',
356           ],
357           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
358           'msvs_disabled_warnings': [ 4267, ],
359         },
360       ],
361     }],
362     ['OS=="win" and target_arch=="ia32"', {
363       'targets': [
364         {
365           'target_name': 'launcher_support64',
366           'type': 'static_library',
367           'include_dirs': [
368             '..',
369           ],
370           'direct_dependent_settings': {
371             'include_dirs': [
372               '..',
373             ],
374           },
375           'defines': [
376               '<@(nacl_win64_defines)',
377           ],
378               'dependencies': [
379               '<(DEPTH)/base/base.gyp:base_win64',
380           ],
381           'configurations': {
382             'Common_Base': {
383               'msvs_target_platform': 'x64',
384             },
385           },
386           'sources': [
387             'installer/launcher_support/chrome_launcher_support.cc',
388             'installer/launcher_support/chrome_launcher_support.h',
389           ],
390         },
391       ],
392     }],
393     ['OS=="linux" and branding=="Chrome"', {
394       'variables': {
395         # Always google_chrome since this only applies to branding==Chrome.
396         'branding_dir': 'app/theme/google_chrome',
397         'branding_dir_100': 'app/theme/default_100_percent/google_chrome',
398         'version' : '<!(python <(version_py_path) -f ../chrome/VERSION -t "@MAJOR@.@MINOR@.@BUILD@.@PATCH@")',
399         'revision' : '<!(python ../build/util/lastchange.py --revision-only)',
400         'packaging_files_common': [
401           'installer/linux/common/apt.include',
402           'installer/linux/common/default-app.template',
403           'installer/linux/common/default-app-block.template',
404           'installer/linux/common/desktop.template',
405           'installer/linux/common/google-chrome/google-chrome.info',
406           'installer/linux/common/installer.include',
407           'installer/linux/common/postinst.include',
408           'installer/linux/common/prerm.include',
409           'installer/linux/common/repo.cron',
410           'installer/linux/common/rpm.include',
411           'installer/linux/common/rpmrepo.cron',
412           'installer/linux/common/symlinks.include',
413           'installer/linux/common/variables.include',
414           'installer/linux/common/wrapper',
415         ],
416         'packaging_files_deb': [
417           'installer/linux/debian/build.sh',
418           'installer/linux/debian/changelog.template',
419           'installer/linux/debian/control.template',
420           'installer/linux/debian/debian.menu',
421           'installer/linux/debian/expected_deps_ia32',
422           'installer/linux/debian/expected_deps_x64',
423           'installer/linux/debian/postinst',
424           'installer/linux/debian/postrm',
425           'installer/linux/debian/prerm',
426         ],
427         'packaging_files_rpm': [
428           'installer/linux/rpm/build.sh',
429           'installer/linux/rpm/chrome.spec.template',
430           'installer/linux/rpm/expected_deps_i386',
431           'installer/linux/rpm/expected_deps_x86_64',
432         ],
433         'packaging_files_binaries': [
434           # TODO(mmoss) Any convenient way to get all the relevant build
435           # files? (e.g. all locales, resources, etc.)
436           '<(PRODUCT_DIR)/chrome',
437           '<(PRODUCT_DIR)/chrome_sandbox',
438           '<(PRODUCT_DIR)/libffmpegsumo.so',
439           '<(PRODUCT_DIR)/xdg-mime',
440           '<(PRODUCT_DIR)/xdg-settings',
441           '<(PRODUCT_DIR)/locales/en-US.pak',
442           '<(PRODUCT_DIR)/nacl_helper',
443           '<(PRODUCT_DIR)/nacl_helper_bootstrap',
444           '<(PRODUCT_DIR)/PepperFlash/libpepflashplayer.so',
445           '<(PRODUCT_DIR)/PepperFlash/manifest.json',
446           '<@(default_apps_list_linux_dest)',
447         ],
448         'flock_bash': ['flock', '--', '/tmp/linux_package_lock', 'bash'],
449         'deb_build': '<(PRODUCT_DIR)/installer/debian/build.sh',
450         'rpm_build': '<(PRODUCT_DIR)/installer/rpm/build.sh',
451         'deb_cmd': ['<@(flock_bash)', '<(deb_build)', '-o' '<(PRODUCT_DIR)',
452                     '-b', '<(PRODUCT_DIR)', '-a', '<(target_arch)'],
453         'rpm_cmd': ['<@(flock_bash)', '<(rpm_build)', '-o' '<(PRODUCT_DIR)',
454                     '-b', '<(PRODUCT_DIR)', '-a', '<(target_arch)'],
455         'conditions': [
456           ['target_arch=="ia32"', {
457             'deb_arch': 'i386',
458             'rpm_arch': 'i386',
459             'packaging_files_binaries': [
460               '<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
461               '<(PRODUCT_DIR)/libwidevinecdmadapter.so',
462               '<(PRODUCT_DIR)/libwidevinecdm.so',
463             ],
464             'packaging_files_common': [
465               '<(DEPTH)/build/linux/bin/eu-strip',
466             ],
467           }],
468           ['target_arch=="x64"', {
469             'deb_arch': 'amd64',
470             'rpm_arch': 'x86_64',
471             'packaging_files_binaries': [
472               '<(PRODUCT_DIR)/nacl_irt_x86_64.nexe',
473               '<(PRODUCT_DIR)/libwidevinecdmadapter.so',
474               '<(PRODUCT_DIR)/libwidevinecdm.so',
475             ],
476             'packaging_files_common': [
477               '<!(which eu-strip)',
478             ],
479           }],
480           ['target_arch=="arm"', {
481             'deb_arch': 'arm',
482             'rpm_arch': 'arm',
483           }],
484           ['libpeer_target_type!="static_library"', {
485             'packaging_files_binaries': [
486               '<(PRODUCT_DIR)/lib/libpeerconnection.so',
487             ],
488           }],
489           ['asan==1', {
490             'packaging_files_binaries': [
491               '<(PRODUCT_DIR)/lib/libc++.so',
492             ],
493           }],
494         ],
495       },
496       'targets': [
497         {
498           'target_name': 'linux_installer_configs',
499           'type': 'none',
500           # Add these files to the build output so the build archives will be
501           # "hermetic" for packaging. This is only for branding="Chrome" since
502           # we only create packages for official builds.
503           'copies': [
504             {
505               'destination': '<(PRODUCT_DIR)/installer/debian/',
506               'files': [
507                 '<@(packaging_files_deb)',
508               ]
509             },
510             {
511               'destination': '<(PRODUCT_DIR)/installer/rpm/',
512               'files': [
513                 '<@(packaging_files_rpm)',
514               ]
515             },
516             {
517               'destination': '<(PRODUCT_DIR)/installer/common/',
518               'files': [
519                 '<@(packaging_files_common)',
520               ]
521             },
522             # Additional theme resources needed for package building.
523             {
524               'destination': '<(PRODUCT_DIR)/installer/theme/',
525               'files': [
526                 '<(branding_dir_100)/product_logo_16.png',
527                 '<(branding_dir)/product_logo_22.png',
528                 '<(branding_dir)/product_logo_24.png',
529                 '<(branding_dir_100)/product_logo_32.png',
530                 '<(branding_dir)/product_logo_48.png',
531                 '<(branding_dir)/product_logo_64.png',
532                 '<(branding_dir)/product_logo_128.png',
533                 '<(branding_dir)/product_logo_256.png',
534                 '<(branding_dir)/product_logo_32.xpm',
535                 '<(branding_dir)/BRANDING',
536               ],
537             },
538           ],
539           'actions': [
540             {
541               'action_name': 'save_build_info',
542               'inputs': [
543                 '<(branding_dir)/BRANDING',
544                 '<(version_path)',
545                 '<(lastchange_path)',
546               ],
547               'outputs': [
548                 '<(PRODUCT_DIR)/installer/version.txt',
549               ],
550               # Just output the default version info variables.
551               'action': [
552                 'python', '<(version_py_path)',
553                 '-f', '<(branding_dir)/BRANDING',
554                 '-f', '<(version_path)',
555                 '-f', '<(lastchange_path)',
556                 '-o', '<@(_outputs)'
557               ],
558             },
559           ],
560         },
561         {
562           'target_name': 'linux_packages_all',
563           'suppress_wildcard': 1,
564           'type': 'none',
565           'dependencies': [
566             'linux_packages_unstable',
567             'linux_packages_beta',
568             'linux_packages_stable',
569           ],
570         },
571         {
572           # 'asan' is a developer, testing-only package, so it shouldn't be
573           # included in the 'linux_packages_all' collection.
574           'target_name': 'linux_packages_asan',
575           'suppress_wildcard': 1,
576           'type': 'none',
577           'dependencies': [
578             'linux_packages_asan_deb',
579           ],
580           # ChromeOS doesn't care about RPM packages.
581           'conditions': [
582             ['chromeos==0', {
583               'dependencies': [
584                 'linux_packages_asan_rpm',
585               ],
586             }],
587           ],
588         },
589         {
590           # 'trunk' is a developer, testing-only package, so it shouldn't be
591           # included in the 'linux_packages_all' collection.
592           'target_name': 'linux_packages_trunk',
593           'suppress_wildcard': 1,
594           'type': 'none',
595           'dependencies': [
596             'linux_packages_trunk_deb',
597           ],
598           # ChromeOS doesn't care about RPM packages.
599           'conditions': [
600             ['chromeos==0', {
601               'dependencies': [
602                 'linux_packages_trunk_rpm',
603               ],
604             }],
605           ],
606         },
607         {
608           'target_name': 'linux_packages_unstable',
609           'suppress_wildcard': 1,
610           'type': 'none',
611           'dependencies': [
612             'linux_packages_unstable_deb',
613           ],
614           # ChromeOS doesn't care about RPM packages.
615           'conditions': [
616             ['chromeos==0', {
617               'dependencies': [
618                 'linux_packages_unstable_rpm',
619               ],
620             }],
621           ],
622         },
623         {
624           'target_name': 'linux_packages_beta',
625           'suppress_wildcard': 1,
626           'type': 'none',
627           'dependencies': [
628             'linux_packages_beta_deb',
629           ],
630           # ChromeOS doesn't care about RPM packages.
631           'conditions': [
632             ['chromeos==0', {
633               'dependencies': [
634                 'linux_packages_beta_rpm',
635               ],
636             }],
637           ],
638         },
639         {
640           'target_name': 'linux_packages_stable',
641           'suppress_wildcard': 1,
642           'type': 'none',
643           'dependencies': [
644             'linux_packages_stable_deb',
645           ],
646           # ChromeOS doesn't care about RPM packages.
647           'conditions': [
648             ['chromeos==0', {
649               'dependencies': [
650                 'linux_packages_stable_rpm',
651               ],
652             }],
653           ],
654         },
655         # TODO(mmoss) gyp looping construct would be handy here ...
656         # These package actions are the same except for the 'channel' variable.
657         {
658           'target_name': 'linux_packages_asan_deb',
659           'suppress_wildcard': 1,
660           'type': 'none',
661           'dependencies': [
662             'chrome',
663             'linux_installer_configs',
664           ],
665           'actions': [
666             {
667               'variables': {
668                 'channel': 'asan',
669               },
670               'action_name': 'deb_packages_<(channel)',
671               'process_outputs_as_sources': 1,
672               'inputs': [
673                 '<(deb_build)',
674                 '<@(packaging_files_binaries)',
675                 '<@(packaging_files_common)',
676                 '<@(packaging_files_deb)',
677               ],
678               'outputs': [
679                 '<(PRODUCT_DIR)/google-chrome-<(channel)_<(version)-1_<(deb_arch).deb',
680               ],
681               'action': [ '<@(deb_cmd)', '-c', '<(channel)', ],
682             },
683           ],
684         },
685         {
686           'target_name': 'linux_packages_trunk_deb',
687           'suppress_wildcard': 1,
688           'type': 'none',
689           'dependencies': [
690             'chrome',
691             'linux_installer_configs',
692           ],
693           'actions': [
694             {
695               'variables': {
696                 'channel': 'trunk',
697               },
698               'action_name': 'deb_packages_<(channel)',
699               'process_outputs_as_sources': 1,
700               'inputs': [
701                 '<(deb_build)',
702                 '<@(packaging_files_binaries)',
703                 '<@(packaging_files_common)',
704                 '<@(packaging_files_deb)',
705               ],
706               'outputs': [
707                 '<(PRODUCT_DIR)/google-chrome-<(channel)_<(version)-1_<(deb_arch).deb',
708               ],
709               'action': [ '<@(deb_cmd)', '-c', '<(channel)', ],
710             },
711           ],
712         },
713         {
714           'target_name': 'linux_packages_unstable_deb',
715           'suppress_wildcard': 1,
716           'type': 'none',
717           'dependencies': [
718             'chrome',
719             'linux_installer_configs',
720           ],
721           'actions': [
722             {
723               'variables': {
724                 'channel': 'unstable',
725               },
726               'action_name': 'deb_packages_<(channel)',
727               'process_outputs_as_sources': 1,
728               'inputs': [
729                 '<(deb_build)',
730                 '<@(packaging_files_binaries)',
731                 '<@(packaging_files_common)',
732                 '<@(packaging_files_deb)',
733               ],
734               'outputs': [
735                 '<(PRODUCT_DIR)/google-chrome-<(channel)_<(version)-1_<(deb_arch).deb',
736               ],
737               'action': [ '<@(deb_cmd)', '-c', '<(channel)', ],
738             },
739           ],
740         },
741         {
742           'target_name': 'linux_packages_beta_deb',
743           'suppress_wildcard': 1,
744           'type': 'none',
745           'dependencies': [
746             'chrome',
747             'linux_installer_configs',
748           ],
749           'actions': [
750             {
751               'variables': {
752                 'channel': 'beta',
753               },
754               'action_name': 'deb_packages_<(channel)',
755               'process_outputs_as_sources': 1,
756               'inputs': [
757                 '<(deb_build)',
758                 '<@(packaging_files_binaries)',
759                 '<@(packaging_files_common)',
760                 '<@(packaging_files_deb)',
761               ],
762               'outputs': [
763                 '<(PRODUCT_DIR)/google-chrome-<(channel)_<(version)-1_<(deb_arch).deb',
764               ],
765               'action': [ '<@(deb_cmd)', '-c', '<(channel)', ],
766             },
767           ],
768         },
769         {
770           'target_name': 'linux_packages_stable_deb',
771           'suppress_wildcard': 1,
772           'type': 'none',
773           'dependencies': [
774             'chrome',
775             'linux_installer_configs',
776           ],
777           'actions': [
778             {
779               'variables': {
780                 'channel': 'stable',
781               },
782               'action_name': 'deb_packages_<(channel)',
783               'process_outputs_as_sources': 1,
784               'inputs': [
785                 '<(deb_build)',
786                 '<@(packaging_files_binaries)',
787                 '<@(packaging_files_common)',
788                 '<@(packaging_files_deb)',
789               ],
790               'outputs': [
791                 '<(PRODUCT_DIR)/google-chrome-<(channel)_<(version)-1_<(deb_arch).deb',
792               ],
793               'action': [ '<@(deb_cmd)', '-c', '<(channel)', ],
794             },
795           ],
796         },
797         {
798           'target_name': 'linux_packages_asan_rpm',
799           'suppress_wildcard': 1,
800           'type': 'none',
801           'dependencies': [
802             'chrome',
803             'linux_installer_configs',
804           ],
805           'actions': [
806             {
807               'variables': {
808                 'channel': 'asan',
809               },
810               'action_name': 'rpm_packages_<(channel)',
811               'process_outputs_as_sources': 1,
812               'inputs': [
813                 '<(rpm_build)',
814                 '<(PRODUCT_DIR)/installer/rpm/chrome.spec.template',
815                 '<@(packaging_files_binaries)',
816                 '<@(packaging_files_common)',
817                 '<@(packaging_files_rpm)',
818               ],
819               'outputs': [
820                 '<(PRODUCT_DIR)/google-chrome-<(channel)-<(version)-1.<(rpm_arch).rpm',
821               ],
822               'action': [ '<@(rpm_cmd)', '-c', '<(channel)', ],
823             },
824           ],
825         },
826         {
827           'target_name': 'linux_packages_trunk_rpm',
828           'suppress_wildcard': 1,
829           'type': 'none',
830           'dependencies': [
831             'chrome',
832             'linux_installer_configs',
833           ],
834           'actions': [
835             {
836               'variables': {
837                 'channel': 'trunk',
838               },
839               'action_name': 'rpm_packages_<(channel)',
840               'process_outputs_as_sources': 1,
841               'inputs': [
842                 '<(rpm_build)',
843                 '<(PRODUCT_DIR)/installer/rpm/chrome.spec.template',
844                 '<@(packaging_files_binaries)',
845                 '<@(packaging_files_common)',
846                 '<@(packaging_files_rpm)',
847               ],
848               'outputs': [
849                 '<(PRODUCT_DIR)/google-chrome-<(channel)-<(version)-1.<(rpm_arch).rpm',
850               ],
851               'action': [ '<@(rpm_cmd)', '-c', '<(channel)', ],
852             },
853           ],
854         },
855         {
856           'target_name': 'linux_packages_unstable_rpm',
857           'suppress_wildcard': 1,
858           'type': 'none',
859           'dependencies': [
860             'chrome',
861             'linux_installer_configs',
862           ],
863           'actions': [
864             {
865               'variables': {
866                 'channel': 'unstable',
867               },
868               'action_name': 'rpm_packages_<(channel)',
869               'process_outputs_as_sources': 1,
870               'inputs': [
871                 '<(rpm_build)',
872                 '<(PRODUCT_DIR)/installer/rpm/chrome.spec.template',
873                 '<@(packaging_files_binaries)',
874                 '<@(packaging_files_common)',
875                 '<@(packaging_files_rpm)',
876               ],
877               'outputs': [
878                 '<(PRODUCT_DIR)/google-chrome-<(channel)-<(version)-1.<(rpm_arch).rpm',
879               ],
880               'action': [ '<@(rpm_cmd)', '-c', '<(channel)', ],
881             },
882           ],
883         },
884         {
885           'target_name': 'linux_packages_beta_rpm',
886           'suppress_wildcard': 1,
887           'type': 'none',
888           'dependencies': [
889             'chrome',
890             'linux_installer_configs',
891           ],
892           'actions': [
893             {
894               'variables': {
895                 'channel': 'beta',
896               },
897               'action_name': 'rpm_packages_<(channel)',
898               'process_outputs_as_sources': 1,
899               'inputs': [
900                 '<(rpm_build)',
901                 '<(PRODUCT_DIR)/installer/rpm/chrome.spec.template',
902                 '<@(packaging_files_binaries)',
903                 '<@(packaging_files_common)',
904                 '<@(packaging_files_rpm)',
905               ],
906               'outputs': [
907                 '<(PRODUCT_DIR)/google-chrome-<(channel)-<(version)-1.<(rpm_arch).rpm',
908               ],
909               'action': [ '<@(rpm_cmd)', '-c', '<(channel)', ],
910             },
911           ],
912         },
913         {
914           'target_name': 'linux_packages_stable_rpm',
915           'suppress_wildcard': 1,
916           'type': 'none',
917           'dependencies': [
918             'chrome',
919             'linux_installer_configs',
920           ],
921           'actions': [
922             {
923               'variables': {
924                 'channel': 'stable',
925               },
926               'action_name': 'rpm_packages_<(channel)',
927               'process_outputs_as_sources': 1,
928               'inputs': [
929                 '<(rpm_build)',
930                 '<(PRODUCT_DIR)/installer/rpm/chrome.spec.template',
931                 '<@(packaging_files_binaries)',
932                 '<@(packaging_files_common)',
933                 '<@(packaging_files_rpm)',
934               ],
935               'outputs': [
936                 '<(PRODUCT_DIR)/google-chrome-<(channel)-<(version)-1.<(rpm_arch).rpm',
937               ],
938               'action': [ '<@(rpm_cmd)', '-c', '<(channel)', ],
939             },
940           ],
941         },
942       ],
943     }],
944     ['OS=="mac"', {
945       'variables': {
946         'mac_packaging_dir':
947             '<(PRODUCT_DIR)/<(mac_product_name) Packaging',
948         # <(PRODUCT_DIR) expands to $(BUILT_PRODUCTS_DIR), which doesn't
949         # work properly in a shell script, where ${BUILT_PRODUCTS_DIR} is
950         # needed.
951         'mac_packaging_sh_dir':
952             '${BUILT_PRODUCTS_DIR}/<(mac_product_name) Packaging',
953       }, # variables
954       'targets': [
955         {
956           'target_name': 'installer_packaging',
957           'type': 'none',
958           'dependencies': [
959             'installer/mac/third_party/bsdiff/goobsdiff.gyp:*',
960             'installer/mac/third_party/xz/xz.gyp:*',
961           ],
962           'conditions': [
963             ['buildtype=="Official"', {
964               'actions': [
965                 {
966                   # Create sign.sh, the script that the packaging system will
967                   # use to sign the .app bundle.
968                   'action_name': 'Make sign.sh',
969                   'variables': {
970                     'make_signers_sh_path': 'installer/mac/make_signers.sh',
971                   },
972                   'inputs': [
973                     '<(make_signers_sh_path)',
974                     'installer/mac/sign_app.sh.in',
975                     'installer/mac/sign_versioned_dir.sh.in',
976                     'installer/mac/app_resource_rules.plist.in',
977                     '<(version_path)',
978                   ],
979                   'outputs': [
980                     '<(mac_packaging_dir)/sign_app.sh',
981                     '<(mac_packaging_dir)/sign_versioned_dir.sh',
982                     '<(mac_packaging_dir)/app_resource_rules.plist',
983                   ],
984                   'action': [
985                     '<(make_signers_sh_path)',
986                     '<(mac_packaging_sh_dir)',
987                     '<(mac_product_name)',
988                     '<(version_full)',
989                   ],
990                 },
991               ],  # actions
992             }],  # buildtype=="Official"
993           ],  # conditions
994           'copies': [
995             {
996               # Put the files where the packaging system will find them. The
997               # packager will use these when building the "full installer"
998               # disk images and delta/differential update disk images.
999               'destination': '<(mac_packaging_dir)',
1000               'files': [
1001                 '<(PRODUCT_DIR)/goobsdiff',
1002                 '<(PRODUCT_DIR)/goobspatch',
1003                 '<(PRODUCT_DIR)/liblzma_decompress.dylib',
1004                 '<(PRODUCT_DIR)/xz',
1005                 '<(PRODUCT_DIR)/xzdec',
1006                 'installer/mac/dirdiffer.sh',
1007                 'installer/mac/dirpatcher.sh',
1008                 'installer/mac/dmgdiffer.sh',
1009                 'installer/mac/pkg-dmg',
1010               ],
1011               'conditions': [
1012                 ['mac_keystone==1', {
1013                   'files': [
1014                     'installer/mac/keystone_install.sh',
1015                   ],
1016                 }],  # mac_keystone
1017                 ['branding=="Chrome" and buildtype=="Official"', {
1018                   'files': [
1019                     'app/theme/google_chrome/mac/app_canary.icns',
1020                     'app/theme/google_chrome/mac/document_canary.icns',
1021                     'installer/mac/internal/chrome_canary_dmg_dsstore',
1022                     'installer/mac/internal/chrome_canary_dmg_icon.icns',
1023                     'installer/mac/internal/chrome_dmg_background.png',
1024                     'installer/mac/internal/chrome_dmg_dsstore',
1025                     'installer/mac/internal/chrome_dmg_icon.icns',
1026                     'installer/mac/internal/generate_dmgs',
1027                   ],
1028                 }],  # branding=="Chrome" and buildtype=="Official"
1029               ],  # conditions
1030             },
1031           ],  # copies
1032         },  # target: installer_packaging
1033         {
1034           'target_name': 'gcapi_lib',
1035           'type': 'static_library',
1036           'include_dirs': [
1037             '..',
1038           ],
1039           'sources': [
1040             'installer/gcapi_mac/gcapi.h',
1041             'installer/gcapi_mac/gcapi.mm',
1042           ],
1043           'link_settings': {
1044             'libraries': [
1045               '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework',
1046             ],
1047           },
1048           'xcode_settings': {
1049             'ARCHS': [ 'i386', 'x86_64' ],
1050             'MACOSX_DEPLOYMENT_TARGET': '10.5',
1051             'GCC_ENABLE_OBJC_GC': 'supported',
1052           },
1053         },
1054         {
1055           'target_name': 'gcapi_example',
1056           'type': 'executable',
1057           'dependencies': [
1058             'gcapi_lib',
1059           ],
1060           'include_dirs': [
1061             '..',
1062           ],
1063           'sources': [
1064             'installer/gcapi_mac/gcapi_example_client.mm',
1065           ],
1066         },
1067       ],  # targets
1068     }],  # OS=="mac"
1069   ],