OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # | 2 # |
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # TODO(mmoss) This currently only works with official builds, since non-official | 7 # TODO(mmoss) This currently only works with official builds, since non-official |
8 # builds don't add the "${BUILDDIR}/installer/" files needed for packaging. | 8 # builds don't add the "${BUILDDIR}/installer/" files needed for packaging. |
9 | 9 |
10 set -e | 10 set -e |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 if [ "$CHANNEL" != "stable" ]; then | 56 if [ "$CHANNEL" != "stable" ]; then |
57 # This would ideally be compiled into the app, but that's a bit too | 57 # This would ideally be compiled into the app, but that's a bit too |
58 # intrusive of a change for these limited use channels, so we'll just hack | 58 # intrusive of a change for these limited use channels, so we'll just hack |
59 # it into the wrapper script. The user can still override since it seems to | 59 # it into the wrapper script. The user can still override since it seems to |
60 # work to specify --user-data-dir multiple times on the command line, with | 60 # work to specify --user-data-dir multiple times on the command line, with |
61 # the last occurrence winning. | 61 # the last occurrence winning. |
62 local SXS_USER_DATA_DIR="\${XDG_CONFIG_HOME:-\${HOME}/.config}/${PACKAGE}-${
CHANNEL}" | 62 local SXS_USER_DATA_DIR="\${XDG_CONFIG_HOME:-\${HOME}/.config}/${PACKAGE}-${
CHANNEL}" |
63 local DEFAULT_FLAGS="--user-data-dir=\"${SXS_USER_DATA_DIR}\"" | 63 local DEFAULT_FLAGS="--user-data-dir=\"${SXS_USER_DATA_DIR}\"" |
64 | 64 |
65 # Avoid file collisions between channels. | 65 # Avoid file collisions between channels. |
| 66 local INSTALLDIR="${INSTALLDIR}-${CHANNEL}" |
| 67 |
66 # TODO(phajdan.jr): Do that for all packages for SxS, | 68 # TODO(phajdan.jr): Do that for all packages for SxS, |
67 # http://crbug.com/38598 . | 69 # http://crbug.com/38598 . |
68 # We can't do this for now for all packages because of | |
69 # http://crbug.com/295103 , and ultimately http://crbug.com/22703 . | |
70 # Also see https://groups.google.com/a/chromium.org/d/msg/chromium-dev/DBEqO
ORaRiw/pE0bNI6h0kcJ . | |
71 if [ "$CHANNEL" = "trunk" ] || [ "$CHANNEL" = "asan" ]; then | 70 if [ "$CHANNEL" = "trunk" ] || [ "$CHANNEL" = "asan" ]; then |
72 local PACKAGE="${PACKAGE}-${CHANNEL}" | 71 local PACKAGE="${PACKAGE}-${CHANNEL}" |
73 local INSTALLDIR="${INSTALLDIR}-${CHANNEL}" | |
74 fi | 72 fi |
75 | 73 |
76 # Make it possible to distinguish between menu entries | 74 # Make it possible to distinguish between menu entries |
77 # for different channels. | 75 # for different channels. |
78 local MENUNAME="${MENUNAME} (${CHANNEL})" | 76 local MENUNAME="${MENUNAME} (${CHANNEL})" |
79 fi | 77 fi |
80 prep_staging_debian | 78 prep_staging_debian |
81 stage_install_common | 79 stage_install_common |
82 echo "Staging Debian install files in '${STAGEDIR}'..." | 80 echo "Staging Debian install files in '${STAGEDIR}'..." |
83 install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/cron" | 81 install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/cron" |
84 process_template "${BUILDDIR}/installer/common/repo.cron" \ | 82 process_template "${BUILDDIR}/installer/common/repo.cron" \ |
85 "${STAGEDIR}/${INSTALLDIR}/cron/${PACKAGE}" | 83 "${STAGEDIR}/${INSTALLDIR}/cron/${PACKAGE}" |
86 chmod 755 "${STAGEDIR}/${INSTALLDIR}/cron/${PACKAGE}" | 84 chmod 755 "${STAGEDIR}/${INSTALLDIR}/cron/${PACKAGE}" |
87 pushd "${STAGEDIR}/etc/cron.daily/" | 85 pushd "${STAGEDIR}/etc/cron.daily/" |
88 ln -snf "${INSTALLDIR}/cron/${PACKAGE}" "${PACKAGE}" | 86 ln -snf "${INSTALLDIR}/cron/${PACKAGE}" "${PACKAGE}" |
89 popd | 87 popd |
90 process_template "${BUILDDIR}/installer/debian/debian.menu" \ | 88 process_template "${BUILDDIR}/installer/debian/debian.menu" \ |
91 "${STAGEDIR}/usr/share/menu/${PACKAGE}.menu" | 89 "${STAGEDIR}/usr/share/menu/${PACKAGE}.menu" |
92 chmod 644 "${STAGEDIR}/usr/share/menu/${PACKAGE}.menu" | 90 chmod 644 "${STAGEDIR}/usr/share/menu/${PACKAGE}.menu" |
93 process_template "${BUILDDIR}/installer/debian/postinst" \ | 91 process_template "${BUILDDIR}/installer/debian/postinst" \ |
94 "${STAGEDIR}/DEBIAN/postinst" | 92 "${STAGEDIR}/DEBIAN/postinst" |
95 chmod 755 "${STAGEDIR}/DEBIAN/postinst" | 93 chmod 755 "${STAGEDIR}/DEBIAN/postinst" |
96 process_template "${BUILDDIR}/installer/debian/prerm" \ | 94 process_template "${BUILDDIR}/installer/debian/prerm" \ |
97 "${STAGEDIR}/DEBIAN/prerm" | 95 "${STAGEDIR}/DEBIAN/prerm" |
98 chmod 755 "${STAGEDIR}/DEBIAN/prerm" | 96 chmod 755 "${STAGEDIR}/DEBIAN/prerm" |
99 process_template "${BUILDDIR}/installer/debian/postrm" \ | 97 process_template "${BUILDDIR}/installer/debian/postrm" \ |
100 "${STAGEDIR}/DEBIAN/postrm" | 98 "${STAGEDIR}/DEBIAN/postrm" |
101 chmod 755 "${STAGEDIR}/DEBIAN/postrm" | 99 chmod 755 "${STAGEDIR}/DEBIAN/postrm" |
| 100 |
| 101 # Compatibility symlinks to avoid breaking Chrome on update. |
| 102 # TODO(phajdan.jr): Remove before enabling SxS (obvious file collisions). |
| 103 # See http://crbug.com/295103 , and ultimately http://crbug.com/22703 . |
| 104 # Also see https://groups.google.com/a/chromium.org/d/msg/chromium-dev/DBEqOOR
aRiw/pE0bNI6h0kcJ . |
| 105 if [ "${CHANNEL}" != "stable" ] && \ |
| 106 [ "${CHANNEL}" != "trunk" ] && \ |
| 107 [ "${CHANNEL}" != "asan" ]; then |
| 108 mkdir -p "${STAGEDIR}/opt/google/chrome" |
| 109 for x in chrome chrome-sandbox locales; do |
| 110 ln -s "${INSTALLDIR}/${x}" "${STAGEDIR}/opt/google/chrome/${x}" |
| 111 done |
| 112 pushd "${STAGEDIR}/${INSTALLDIR}" |
| 113 for x in *.pak; do |
| 114 ln -s "${INSTALLDIR}/${x}" "${STAGEDIR}/opt/google/chrome/${x}" |
| 115 done |
| 116 popd |
| 117 fi |
102 } | 118 } |
103 | 119 |
104 # Actually generate the package file. | 120 # Actually generate the package file. |
105 do_package() { | 121 do_package() { |
106 echo "Packaging ${ARCHITECTURE}..." | 122 echo "Packaging ${ARCHITECTURE}..." |
107 PREDEPENDS="$COMMON_PREDEPS" | 123 PREDEPENDS="$COMMON_PREDEPS" |
108 DEPENDS="${COMMON_DEPS}" | 124 DEPENDS="${COMMON_DEPS}" |
109 # Trunk is a special package, mostly for development testing, so don't make | 125 # Trunk is a special package, mostly for development testing, so don't make |
110 # it replace any installed release packages. | 126 # it replace any installed release packages. |
111 if [ "$CHANNEL" != "trunk" ] && [ "$CHANNEL" != "asan" ]; then | 127 if [ "$CHANNEL" != "trunk" ] && [ "$CHANNEL" != "asan" ]; then |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 ;; | 348 ;; |
333 * ) | 349 * ) |
334 echo | 350 echo |
335 echo "ERROR: Don't know how to build DEBs for '$TARGETARCH'." | 351 echo "ERROR: Don't know how to build DEBs for '$TARGETARCH'." |
336 echo | 352 echo |
337 exit 1 | 353 exit 1 |
338 ;; | 354 ;; |
339 esac | 355 esac |
340 | 356 |
341 do_package | 357 do_package |
OLD | NEW |