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 |
19 # release channel packages. | 19 # release channel packages. |
20 local PACKAGE_FILENAME="${PACKAGE}" | 20 local PACKAGE_FILENAME="${PACKAGE}" |
Lei Zhang
2014/07/24 19:25:58
If you move this down to after the if block, then
Paweł Hajdan Jr.
2014/07/25 10:51:29
Done.
| |
21 if [ "$CHANNEL" != "stable" ]; then | 21 if [ "$CHANNEL" != "stable" ]; then |
22 local INSTALLDIR="${INSTALLDIR}-${CHANNEL}" | 22 local INSTALLDIR="${INSTALLDIR}-${CHANNEL}" |
23 PACKAGE_FILENAME="${PACKAGE}-${CHANNEL}" | 23 PACKAGE_FILENAME="${PACKAGE}-${CHANNEL}" |
24 PACKAGE="${PACKAGE}-${CHANNEL}" | |
24 local MENUNAME="${MENUNAME} (${CHANNEL})" | 25 local MENUNAME="${MENUNAME} (${CHANNEL})" |
25 fi | 26 fi |
26 process_template "${SCRIPTDIR}/chrome.spec.template" "${SPEC}" | 27 process_template "${SCRIPTDIR}/chrome.spec.template" "${SPEC}" |
27 } | 28 } |
28 | 29 |
29 # Setup the installation directory hierachy in the package staging area. | 30 # Setup the installation directory hierachy in the package staging area. |
30 prep_staging_rpm() { | 31 prep_staging_rpm() { |
31 prep_staging_common | 32 prep_staging_common |
32 install -m 755 -d "${STAGEDIR}/etc/cron.daily" | 33 install -m 755 -d "${STAGEDIR}/etc/cron.daily" |
33 } | 34 } |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
144 | 145 |
145 # '__os_install_post ${nil}' disables a bunch of automatic post-processing | 146 # '__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, | 147 # (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 | 148 # and which doesn't gain us anything since we already explicitly do all the |
148 # compression, symbol stripping, etc. that we want. | 149 # compression, symbol stripping, etc. that we want. |
149 fakeroot rpmbuild -bb --target="$ARCHITECTURE" --rmspec \ | 150 fakeroot rpmbuild -bb --target="$ARCHITECTURE" --rmspec \ |
150 --define "_topdir $RPMBUILD_DIR" \ | 151 --define "_topdir $RPMBUILD_DIR" \ |
151 --define "_binary_payload w9.bzdio" \ | 152 --define "_binary_payload w9.bzdio" \ |
152 --define "__os_install_post %{nil}" \ | 153 --define "__os_install_post %{nil}" \ |
153 "${SPEC}" | 154 "${SPEC}" |
154 PKGNAME="${PACKAGE}-${CHANNEL}-${VERSION}-${PACKAGE_RELEASE}" | 155 PKGNAME="${PACKAGE}-${VERSION}-${PACKAGE_RELEASE}" |
Lei Zhang
2014/07/24 19:25:58
Based on the gen_spec() changes above, and gen_spe
Paweł Hajdan Jr.
2014/07/25 10:51:29
There was no collision, but stable was named googl
Lei Zhang
2014/07/30 03:30:25
(General observation) I think a lot of the confusi
| |
155 mv "$RPMBUILD_DIR/RPMS/$ARCHITECTURE/${PKGNAME}.${ARCHITECTURE}.rpm" \ | 156 mv "$RPMBUILD_DIR/RPMS/$ARCHITECTURE/${PKGNAME}.${ARCHITECTURE}.rpm" \ |
156 "${OUTPUTDIR}" | 157 "${OUTPUTDIR}" |
157 # Make sure the package is world-readable, otherwise it causes problems when | 158 # Make sure the package is world-readable, otherwise it causes problems when |
158 # copied to share drive. | 159 # copied to share drive. |
159 chmod a+r "${OUTPUTDIR}/${PKGNAME}.$ARCHITECTURE.rpm" | 160 chmod a+r "${OUTPUTDIR}/${PKGNAME}.$ARCHITECTURE.rpm" |
160 rm -rf "$RPMBUILD_DIR" | 161 rm -rf "$RPMBUILD_DIR" |
161 } | 162 } |
162 | 163 |
163 # Remove temporary files and unwanted packaging output. | 164 # Remove temporary files and unwanted packaging output. |
164 cleanup() { | 165 cleanup() { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
302 ;; | 303 ;; |
303 * ) | 304 * ) |
304 echo | 305 echo |
305 echo "ERROR: Don't know how to build RPMs for '$TARGETARCH'." | 306 echo "ERROR: Don't know how to build RPMs for '$TARGETARCH'." |
306 echo | 307 echo |
307 exit 1 | 308 exit 1 |
308 ;; | 309 ;; |
309 esac | 310 esac |
310 | 311 |
311 do_package | 312 do_package |
OLD | NEW |