Chromium Code Reviews| 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 gen_spec() { | 16 gen_spec() { |
| 17 rm -f "${SPEC}" | 17 rm -f "${SPEC}" |
| 18 # Trunk packages need to install to a custom path so they don't conflict with | 18 # Trunk packages need to install to a custom path so they don't conflict with |
|
Lei Zhang
2014/07/30 03:30:25
This comment needs to be updated.
| |
| 19 # release channel packages. | 19 # release channel packages. |
| 20 local PACKAGE_FILENAME="${PACKAGE}" | |
| 21 if [ "$CHANNEL" != "stable" ]; then | 20 if [ "$CHANNEL" != "stable" ]; then |
| 22 local INSTALLDIR="${INSTALLDIR}-${CHANNEL}" | 21 local INSTALLDIR="${INSTALLDIR}-${CHANNEL}" |
| 23 PACKAGE_FILENAME="${PACKAGE}-${CHANNEL}" | 22 PACKAGE="${PACKAGE}-${CHANNEL}" |
| 24 local MENUNAME="${MENUNAME} (${CHANNEL})" | 23 local MENUNAME="${MENUNAME} (${CHANNEL})" |
| 25 fi | 24 fi |
| 25 local PACKAGE_FILENAME="${PACKAGE}" | |
| 26 process_template "${SCRIPTDIR}/chrome.spec.template" "${SPEC}" | 26 process_template "${SCRIPTDIR}/chrome.spec.template" "${SPEC}" |
| 27 } | 27 } |
| 28 | 28 |
| 29 # Setup the installation directory hierachy in the package staging area. | 29 # Setup the installation directory hierachy in the package staging area. |
| 30 prep_staging_rpm() { | 30 prep_staging_rpm() { |
| 31 prep_staging_common | 31 prep_staging_common |
| 32 install -m 755 -d "${STAGEDIR}/etc/cron.daily" | 32 install -m 755 -d "${STAGEDIR}/etc/cron.daily" |
| 33 } | 33 } |
| 34 | 34 |
| 35 # Put the package contents in the staging area. | 35 # Put the package contents in the staging area. |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 | 144 |
| 145 # '__os_install_post ${nil}' disables a bunch of automatic post-processing | 145 # '__os_install_post ${nil}' disables a bunch of automatic post-processing |
| 146 # (brp-compress, etc.), which by default appears to only be enabled on 32-bit, | 146 # (brp-compress, etc.), which by default appears to only be enabled on 32-bit, |
| 147 # and which doesn't gain us anything since we already explicitly do all the | 147 # and which doesn't gain us anything since we already explicitly do all the |
| 148 # compression, symbol stripping, etc. that we want. | 148 # compression, symbol stripping, etc. that we want. |
| 149 fakeroot rpmbuild -bb --target="$ARCHITECTURE" --rmspec \ | 149 fakeroot rpmbuild -bb --target="$ARCHITECTURE" --rmspec \ |
| 150 --define "_topdir $RPMBUILD_DIR" \ | 150 --define "_topdir $RPMBUILD_DIR" \ |
| 151 --define "_binary_payload w9.bzdio" \ | 151 --define "_binary_payload w9.bzdio" \ |
| 152 --define "__os_install_post %{nil}" \ | 152 --define "__os_install_post %{nil}" \ |
| 153 "${SPEC}" | 153 "${SPEC}" |
| 154 PKGNAME="${PACKAGE}-${CHANNEL}-${VERSION}-${PACKAGE_RELEASE}" | 154 PKGNAME="google-chrome-${CHANNEL}-${VERSION}-${PACKAGE_RELEASE}" |
| 155 mv "$RPMBUILD_DIR/RPMS/$ARCHITECTURE/${PKGNAME}.${ARCHITECTURE}.rpm" \ | 155 mv "$RPMBUILD_DIR/RPMS/$ARCHITECTURE/${PKGNAME}.${ARCHITECTURE}.rpm" \ |
| 156 "${OUTPUTDIR}" | 156 "${OUTPUTDIR}" |
| 157 # Make sure the package is world-readable, otherwise it causes problems when | 157 # Make sure the package is world-readable, otherwise it causes problems when |
| 158 # copied to share drive. | 158 # copied to share drive. |
| 159 chmod a+r "${OUTPUTDIR}/${PKGNAME}.$ARCHITECTURE.rpm" | 159 chmod a+r "${OUTPUTDIR}/${PKGNAME}.$ARCHITECTURE.rpm" |
| 160 rm -rf "$RPMBUILD_DIR" | 160 rm -rf "$RPMBUILD_DIR" |
| 161 } | 161 } |
| 162 | 162 |
| 163 # Remove temporary files and unwanted packaging output. | 163 # Remove temporary files and unwanted packaging output. |
| 164 cleanup() { | 164 cleanup() { |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 302 ;; | 302 ;; |
| 303 * ) | 303 * ) |
| 304 echo | 304 echo |
| 305 echo "ERROR: Don't know how to build RPMs for '$TARGETARCH'." | 305 echo "ERROR: Don't know how to build RPMs for '$TARGETARCH'." |
| 306 echo | 306 echo |
| 307 exit 1 | 307 exit 1 |
| 308 ;; | 308 ;; |
| 309 esac | 309 esac |
| 310 | 310 |
| 311 do_package | 311 do_package |
| OLD | NEW |