| 1 | # Copyright 1999-2012 Gentoo Foundation |
1 | # Copyright 1999-2012 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/chromium.eclass,v 1.4 2012/05/23 18:16:30 floppym Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/chromium.eclass,v 1.5 2012/05/30 06:15:24 phajdan.jr Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: chromium.eclass |
5 | # @ECLASS: chromium.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # Chromium Herd <chromium@gentoo.org> |
7 | # Chromium Herd <chromium@gentoo.org> |
| 8 | # @AUTHOR: |
8 | # @AUTHOR: |
| … | |
… | |
| 15 | |
15 | |
| 16 | if [[ ${PN} == chromium ]]; then |
16 | if [[ ${PN} == chromium ]]; then |
| 17 | IUSE+=" custom-cflags" |
17 | IUSE+=" custom-cflags" |
| 18 | fi |
18 | fi |
| 19 | |
19 | |
| 20 | # @FUNCTION: chromium_check_kernel_config |
20 | # @FUNCTION: chromium_suid_sandbox_check_kernel_config |
| 21 | # @USAGE: |
21 | # @USAGE: |
| 22 | # @DESCRIPTION: |
22 | # @DESCRIPTION: |
| 23 | # Ensures the system kernel is configured for full Chromium functionality. |
23 | # Ensures the system kernel supports features needed for SUID sandbox to work. |
| 24 | chromium_check_kernel_config() { |
24 | chromium_suid_sandbox_check_kernel_config() { |
| 25 | has "${EAPI:-0}" 0 1 2 3 && die "EAPI=${EAPI} is not supported" |
25 | has "${EAPI:-0}" 0 1 2 3 && die "EAPI=${EAPI} is not supported" |
| 26 | |
26 | |
| 27 | if [[ "${MERGE_TYPE}" == "source" || "${MERGE_TYPE}" == "binary" ]]; then |
27 | if [[ "${MERGE_TYPE}" == "source" || "${MERGE_TYPE}" == "binary" ]]; then |
| 28 | # Warn if the kernel does not support features needed for sandboxing. |
28 | # Warn if the kernel does not support features needed for sandboxing. |
| 29 | # Bug #363987. |
29 | # Bug #363987. |
| 30 | ERROR_PID_NS="PID_NS is required for sandbox to work" |
30 | ERROR_PID_NS="PID_NS is required for sandbox to work" |
| 31 | ERROR_NET_NS="NET_NS is required for sandbox to work" |
31 | ERROR_NET_NS="NET_NS is required for sandbox to work" |
| 32 | CONFIG_CHECK="~PID_NS ~NET_NS" |
32 | CONFIG_CHECK="~PID_NS ~NET_NS" |
| 33 | check_extra_config |
33 | check_extra_config |
| 34 | fi |
34 | fi |
|
|
35 | } |
|
|
36 | |
|
|
37 | # @FUNCTION: chromium_check_kernel_config |
|
|
38 | # @USAGE: |
|
|
39 | # @DESCRIPTION: |
|
|
40 | # Ensures the system kernel is configured for full Chromium functionality. |
|
|
41 | chromium_check_kernel_config() { |
|
|
42 | eqawarn "chromium_check_kernel_config is deprecated." |
|
|
43 | eqawarn "Please use chromium_suid_sandbox_check_kernel_config if applicable." |
|
|
44 | chromium_suid_sandbox_check_kernel_config |
| 35 | } |
45 | } |
| 36 | |
46 | |
| 37 | # @ECLASS-VARIABLE: CHROMIUM_LANGS |
47 | # @ECLASS-VARIABLE: CHROMIUM_LANGS |
| 38 | # @DEFAULT_UNSET |
48 | # @DEFAULT_UNSET |
| 39 | # @DESCRIPTION: |
49 | # @DESCRIPTION: |