| 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 |
| 11 if [ "$VERBOSE" ]; then | 11 if [ "$VERBOSE" ]; then |
| 12 set -x | 12 set -x |
| 13 fi | 13 fi |
| 14 set -u | 14 set -u |
| 15 | 15 |
| 16 # Create the Debian changelog file needed by dpkg-gencontrol. This just adds a | 16 # Create the Debian changelog file needed by dpkg-gencontrol. This just adds a |
| 17 # placeholder change, indicating it is the result of an automatic build. | 17 # placeholder change, indicating it is the result of an automatic build. |
| 18 # TODO(mmoss) Release packages should create something meaningful for a | 18 # TODO(mmoss) Release packages should create something meaningful for a |
| 19 # changelog, but simply grabbing the actual 'svn log' is way too verbose. Do we | 19 # changelog, but simply grabbing the actual 'svn log' is way too verbose. Do we |
| 20 # have any type of "significant/visible changes" log that we could use for this? | 20 # have any type of "significant/visible changes" log that we could use for this? |
| 21 gen_changelog() { | 21 gen_changelog() { |
| 22 rm -f "${DEB_CHANGELOG}" | 22 rm -f "${DEB_CHANGELOG}" |
| 23 process_template "${SCRIPTDIR}/changelog.template" "${DEB_CHANGELOG}" | 23 process_template "${SCRIPTDIR}/changelog.template" "${DEB_CHANGELOG}" |
| 24 debchange -a --nomultimaint -m --changelog "${DEB_CHANGELOG}" \ | 24 debchange -a --nomultimaint -m --changelog "${DEB_CHANGELOG}" \ |
| 25 "Release Notes: ${RELEASENOTES}" | 25 "Release Notes: ${RELEASENOTES}" |
| 26 # Trunk packages need to install to a custom path and with custom filenames | 26 GZLOG="${STAGEDIR}/usr/share/doc/${PACKAGE}-${CHANNEL}/changelog.gz" |
| 27 # (e.g. not /usr/bin/google-chrome) so they don't conflict with release | |
| 28 # channel packages. | |
| 29 if [ "$CHANNEL" = "trunk" ] || [ "$CHANNEL" = "asan" ]; then | |
| 30 local PACKAGE="${PACKAGE}-${CHANNEL}" | |
| 31 fi | |
| 32 GZLOG="${STAGEDIR}/usr/share/doc/${PACKAGE}/changelog.gz" | |
| 33 mkdir -p "$(dirname "${GZLOG}")" | 27 mkdir -p "$(dirname "${GZLOG}")" |
| 34 gzip -9 -c "${DEB_CHANGELOG}" > "${GZLOG}" | 28 gzip -9 -c "${DEB_CHANGELOG}" > "${GZLOG}" |
| 35 chmod 644 "${GZLOG}" | 29 chmod 644 "${GZLOG}" |
| 36 } | 30 } |
| 37 | 31 |
| 38 # Create the Debian control file needed by dpkg-deb. | 32 # Create the Debian control file needed by dpkg-deb. |
| 39 gen_control() { | 33 gen_control() { |
| 40 dpkg-gencontrol -v"${VERSIONFULL}" -c"${DEB_CONTROL}" -l"${DEB_CHANGELOG}" \ | 34 dpkg-gencontrol -v"${VERSIONFULL}" -c"${DEB_CONTROL}" -l"${DEB_CHANGELOG}" \ |
| 41 -f"${DEB_FILES}" -p"${PACKAGE}-${CHANNEL}" -P"${STAGEDIR}" \ | 35 -f"${DEB_FILES}" -p"${PACKAGE}-${CHANNEL}" -P"${STAGEDIR}" \ |
| 42 -O > "${STAGEDIR}/DEBIAN/control" | 36 -O > "${STAGEDIR}/DEBIAN/control" |
| 43 rm -f "${DEB_CONTROL}" | 37 rm -f "${DEB_CONTROL}" |
| 44 } | 38 } |
| 45 | 39 |
| 46 # Setup the installation directory hierachy in the package staging area. | 40 # Setup the installation directory hierachy in the package staging area. |
| 47 prep_staging_debian() { | 41 prep_staging_debian() { |
| 48 prep_staging_common | 42 prep_staging_common |
| 49 install -m 755 -d "${STAGEDIR}/DEBIAN" \ | 43 install -m 755 -d "${STAGEDIR}/DEBIAN" \ |
| 50 "${STAGEDIR}/etc/cron.daily" \ | 44 "${STAGEDIR}/etc/cron.daily" \ |
| 51 "${STAGEDIR}/usr/share/menu" \ | 45 "${STAGEDIR}/usr/share/menu" \ |
| 52 "${STAGEDIR}/usr/share/doc/${PACKAGE}" | 46 "${STAGEDIR}/usr/share/doc/${PACKAGE}" |
| 53 } | 47 } |
| 54 | 48 |
| 55 # Put the package contents in the staging area. | 49 # Put the package contents in the staging area. |
| 56 stage_install_debian() { | 50 stage_install_debian() { |
| 57 # Trunk packages need to install to a custom path and with custom filenames | 51 # Always use a different name for /usr/bin symlink depending on channel. |
| 58 # (e.g. not /usr/bin/google-chrome) so they don't conflict with release | 52 # First, to avoid file collisions. Second, to make it possible to |
| 59 # channel packages. | 53 # use update-alternatives for /usr/bin/google-chrome. |
| 60 if [ "$CHANNEL" = "trunk" ] || [ "$CHANNEL" = "asan" ]; then | 54 local USR_BIN_SYMLINK_NAME="${PACKAGE}-${CHANNEL}" |
| 61 local PACKAGE="${PACKAGE}-${CHANNEL}" | 55 |
| 62 local INSTALLDIR="${INSTALLDIR}-${CHANNEL}" | 56 if [ "$CHANNEL" != "stable" ]; then |
| 63 # 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 |
| 64 # 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 |
| 65 # 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 |
| 66 # 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 |
| 67 # the last occurrence winning. | 61 # the last occurrence winning. |
| 68 local DEFAULT_FLAGS="--user-data-dir=\"\${HOME}/.config/${PACKAGE}\"" | 62 local SXS_USER_DATA_DIR="\${XDG_CONFIG_HOME:-\${HOME}/.config}/${PACKAGE}-${
CHANNEL}" |
| 63 local DEFAULT_FLAGS="--user-data-dir=\"${SXS_USER_DATA_DIR}\"" |
| 64 |
| 65 # Avoid file collisions between channels. |
| 66 # TODO(phajdan.jr): Do that for all packages for SxS, |
| 67 # 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 |
| 72 local PACKAGE="${PACKAGE}-${CHANNEL}" |
| 73 local INSTALLDIR="${INSTALLDIR}-${CHANNEL}" |
| 74 fi |
| 75 |
| 76 # Make it possible to distinguish between menu entries |
| 77 # for different channels. |
| 69 local MENUNAME="${MENUNAME} (${CHANNEL})" | 78 local MENUNAME="${MENUNAME} (${CHANNEL})" |
| 70 fi | 79 fi |
| 71 prep_staging_debian | 80 prep_staging_debian |
| 72 stage_install_common | 81 stage_install_common |
| 73 echo "Staging Debian install files in '${STAGEDIR}'..." | 82 echo "Staging Debian install files in '${STAGEDIR}'..." |
| 74 install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/cron" | 83 install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/cron" |
| 75 process_template "${BUILDDIR}/installer/common/repo.cron" \ | 84 process_template "${BUILDDIR}/installer/common/repo.cron" \ |
| 76 "${STAGEDIR}/${INSTALLDIR}/cron/${PACKAGE}" | 85 "${STAGEDIR}/${INSTALLDIR}/cron/${PACKAGE}" |
| 77 chmod 755 "${STAGEDIR}/${INSTALLDIR}/cron/${PACKAGE}" | 86 chmod 755 "${STAGEDIR}/${INSTALLDIR}/cron/${PACKAGE}" |
| 78 pushd "${STAGEDIR}/etc/cron.daily/" | 87 pushd "${STAGEDIR}/etc/cron.daily/" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 VERSIONFULL="${VERSION}-${PACKAGE_RELEASE}" | 236 VERSIONFULL="${VERSION}-${PACKAGE_RELEASE}" |
| 228 | 237 |
| 229 if [ "$CHROMIUM_BUILD" = "_google_chrome" ]; then | 238 if [ "$CHROMIUM_BUILD" = "_google_chrome" ]; then |
| 230 source "${BUILDDIR}/installer/common/google-chrome.info" | 239 source "${BUILDDIR}/installer/common/google-chrome.info" |
| 231 else | 240 else |
| 232 source "${BUILDDIR}/installer/common/chromium-browser.info" | 241 source "${BUILDDIR}/installer/common/chromium-browser.info" |
| 233 fi | 242 fi |
| 234 eval $(sed -e "s/^\([^=]\+\)=\(.*\)$/export \1='\2'/" \ | 243 eval $(sed -e "s/^\([^=]\+\)=\(.*\)$/export \1='\2'/" \ |
| 235 "${BUILDDIR}/installer/theme/BRANDING") | 244 "${BUILDDIR}/installer/theme/BRANDING") |
| 236 | 245 |
| 237 REPOCONFIG="deb http://dl.google.com/linux/${PACKAGE#google-}/deb/ stable main" | 246 REPOCONFIG="deb http://dl.google.com/linux/chrome/deb/ stable main" |
| 238 verify_channel | 247 verify_channel |
| 239 | 248 |
| 240 # Some Debian packaging tools want these set. | 249 # Some Debian packaging tools want these set. |
| 241 export DEBFULLNAME="${MAINTNAME}" | 250 export DEBFULLNAME="${MAINTNAME}" |
| 242 export DEBEMAIL="${MAINTMAIL}" | 251 export DEBEMAIL="${MAINTMAIL}" |
| 243 | 252 |
| 244 # We'd like to eliminate more of these deps by relying on the 'lsb' package, but | 253 # We'd like to eliminate more of these deps by relying on the 'lsb' package, but |
| 245 # that brings in tons of unnecessary stuff, like an mta and rpm. Until that full | 254 # that brings in tons of unnecessary stuff, like an mta and rpm. Until that full |
| 246 # 'lsb' package is installed by default on DEB distros, we'll have to stick with | 255 # 'lsb' package is installed by default on DEB distros, we'll have to stick with |
| 247 # the LSB sub-packages, to avoid pulling in all that stuff that's not installed | 256 # the LSB sub-packages, to avoid pulling in all that stuff that's not installed |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 ;; | 332 ;; |
| 324 * ) | 333 * ) |
| 325 echo | 334 echo |
| 326 echo "ERROR: Don't know how to build DEBs for '$TARGETARCH'." | 335 echo "ERROR: Don't know how to build DEBs for '$TARGETARCH'." |
| 327 echo | 336 echo |
| 328 exit 1 | 337 exit 1 |
| 329 ;; | 338 ;; |
| 330 esac | 339 esac |
| 331 | 340 |
| 332 do_package | 341 do_package |
| OLD | NEW |