From 585e731b76ef14c1cf110a116096e2564cb400db Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Wed, 6 Mar 2013 00:59:43 +0800 Subject: [PATCH 01/54] update appendices/contributing/text.xml --- appendices/contributing/text.xml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/appendices/contributing/text.xml b/appendices/contributing/text.xml index 8e16fbd..93ff36c 100644 --- a/appendices/contributing/text.xml +++ b/appendices/contributing/text.xml @@ -1,13 +1,11 @@ -Contributing to This Document +为本文档贡献自己的力量

-Contributions for this document are very welcome. Whether you've found a typo -or have written an entire new section, the best way to get in touch is via Bugzilla -at bugs.gentoo.org. +非常欢迎为本文档添砖加瓦,哪怕是印刷错误或一段新的内容,您都可以通过登录 Bugzilla bugs.gentoo.org 来提交.

From 7f114796371c6976865451ccbdc2f2727f04fe2b Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Wed, 6 Mar 2013 02:10:16 +0800 Subject: [PATCH 02/54] update misc-files --- ebuild-writing/misc-files/text.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ebuild-writing/misc-files/text.xml b/ebuild-writing/misc-files/text.xml index 31f1421..a21041f 100644 --- a/ebuild-writing/misc-files/text.xml +++ b/ebuild-writing/misc-files/text.xml @@ -1,16 +1,16 @@ -Miscellaneous Files +杂项

-This section contains some notes on various miscellaneous files. +本节包含对一些杂项文件的注释.

-Contents +内容 From a4712802dd03377233339e0ece8428e9531eedfe Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Wed, 6 Mar 2013 02:12:54 +0800 Subject: [PATCH 03/54] Update text.xml --- ebuild-writing/functions/text.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ebuild-writing/functions/text.xml b/ebuild-writing/functions/text.xml index 09a910e..7619b5c 100644 --- a/ebuild-writing/functions/text.xml +++ b/ebuild-writing/functions/text.xml @@ -1,7 +1,7 @@ -Ebuild Functions +Ebuild 函数篇

From 05b868f1ee21d6ecdc0c38b08ad0c83dddb44d32 Mon Sep 17 00:00:00 2001 From: lledu Date: Wed, 6 Mar 2013 10:04:38 +0800 Subject: [PATCH 04/54] Update text.xml --- ebuild-writing/common-mistakes/text.xml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/ebuild-writing/common-mistakes/text.xml b/ebuild-writing/common-mistakes/text.xml index 57a1d98..8ff84bc 100644 --- a/ebuild-writing/common-mistakes/text.xml +++ b/ebuild-writing/common-mistakes/text.xml @@ -16,24 +16,21 @@ 无效的 <c>static</c> use 标记 -The static use-flag should only be used to make a binary use static -linking instead of dynamic linking. It should not be used to make a library -install static libraries. Instead, the static-libs use-flag is used for this. +static use 标记在生成二进制文件的时候只能使用静态链接而不能使用动态链接。 +它不能使一个库安装成为一个静态库,如果想这样做,请使用static-libs use 标记。 -Invalid use of <c>ROOT</c> +<c>ROOT</c>的无效使用

-The usage of ROOT is only designed to influence the way the package is -installed (ie. into ROOT) - building and compiling should not depend on -ROOT. As a consequence of this the usage of ROOT in src_* -functions is not allowed. +ROOT 仅仅只是用来影响包的安装方式的(例如 into ROOT),构建和编译却不应该依靠 ROOT。 +所以 ROOT 不能够在 src_* 函数中使用。

-See also . +参见 .

From 4dce3a79bdad0faf5b7941906393d378b7aa6296 Mon Sep 17 00:00:00 2001 From: lledu Date: Wed, 6 Mar 2013 10:06:01 +0800 Subject: [PATCH 05/54] Update text.xml --- ebuild-writing/common-mistakes/text.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ebuild-writing/common-mistakes/text.xml b/ebuild-writing/common-mistakes/text.xml index 8ff84bc..ae0f7cf 100644 --- a/ebuild-writing/common-mistakes/text.xml +++ b/ebuild-writing/common-mistakes/text.xml @@ -25,7 +25,7 @@ <c>ROOT</c>的无效使用

-ROOT 仅仅只是用来影响包的安装方式的(例如 into ROOT),构建和编译却不应该依靠 ROOT。 +ROOT 仅仅只是用来影响包的安装路径的(例如 into ROOT),构建和编译却不应该依靠 ROOT。 所以 ROOT 不能够在 src_* 函数中使用。

From b453726862b519717082cdc0daa7521c3ab7f105 Mon Sep 17 00:00:00 2001 From: whdxwym Date: Wed, 6 Mar 2013 13:53:21 +0800 Subject: [PATCH 06/54] Update text.xml --- ebuild-writing/functions/pkg_config/text.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ebuild-writing/functions/pkg_config/text.xml b/ebuild-writing/functions/pkg_config/text.xml index 422089f..5545a31 100644 --- a/ebuild-writing/functions/pkg_config/text.xml +++ b/ebuild-writing/functions/pkg_config/text.xml @@ -6,30 +6,30 @@ - + pkg_config - - Run any special post-install configuration + + 运行任意重要的安装后的配置 - - Disabled + + 禁用 - + root - + manual
Function函数
Purpose目标
Sandbox沙箱
Privilege权限
Called for要求
-Default <c>pkg_config</c> +默认的 <c>pkg_config</c> pkg_config() @@ -41,10 +41,10 @@ pkg_config()
-Example <c>pkg_config</c> +例 <c>pkg_config</c>

-Taken from the mysql ebuilds. Note the use of ${ROOT}. +来自于 mysql 的ebuilds. 注意 ${ROOT}的使用.

From d6bc21f340c231cab7752fdf3c0a7661fde703d3 Mon Sep 17 00:00:00 2001 From: whdxwym Date: Wed, 6 Mar 2013 13:55:01 +0800 Subject: [PATCH 07/54] Update text.xml --- ebuild-writing/functions/pkg_config/text.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ebuild-writing/functions/pkg_config/text.xml b/ebuild-writing/functions/pkg_config/text.xml index 5545a31..8c5f9b9 100644 --- a/ebuild-writing/functions/pkg_config/text.xml +++ b/ebuild-writing/functions/pkg_config/text.xml @@ -44,7 +44,7 @@ pkg_config() 例 <c>pkg_config</c>

-来自于 mysql 的ebuilds. 注意 ${ROOT}的使用. +取自于 mysql 的ebuilds. 注意 ${ROOT}的使用.

From 61ba2e15d19c0b44ede8eae92eacb1716d52cb5b Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Wed, 6 Mar 2013 19:19:33 +0800 Subject: [PATCH 08/54] functions update --- ebuild-writing/functions/text.xml | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/ebuild-writing/functions/text.xml b/ebuild-writing/functions/text.xml index 7619b5c..594135c 100644 --- a/ebuild-writing/functions/text.xml +++ b/ebuild-writing/functions/text.xml @@ -5,40 +5,35 @@

-When installing packages from source, the function call order is pkg_setup, -src_unpack, src_prepare, src_compile, src_test (optional, FEATURES="test"), -src_install, pkg_preinst, pkg_postinst. When installing packages -from a binary, the function call order is pkg_setup, pkg_preinst, +当自源码安装软件包时,系统调用函数的顺序是 pkg_setup, +src_unpack, src_prepare, src_compile, src_test (可选项为, FEATURES="test"), +src_install, pkg_preinst, pkg_postinst. 当安装的是二进制的软件包时,系统调用的顺序是 pkg_setup, pkg_preinst, pkg_postinst. -As some phases haven't been introduced from the beginning, you can have a look at - for an overview, what have been introduced in which EAPI. +有些之前没有介绍到的相关信息,阅读下篇 + 可获有关EAPI规约的梗概.

-The pkg_prerm and pkg_postrm functions are called when uninstalling a -package. The pkg_config function is used for any special package -configuration it is only run when explicitly requested by the user. The -pkg_nofetch function is used when a RESTRICT="fetch" package needs to -obtain some SRC_URI components. +当卸载软件包时会调用函数 pkg_prermpkg_postrm +. 使用函数 pkg_config 为软件包做 +configuration 用户有实际需求时需要预先手动配置运行. 函数 +pkg_nofetch 在以下情况会被调用,即当标记有 RESTRICT="fetch" 的软件包(标示有“限制取回”的软件包)包含有 SRC_URI 参数时.

-Between the transition from pkg_preinst to pkg_postinst, files are -copied over to the live filesystem from the sandboxed temporary installation -location, and Portage records digests of the files installed. +在由函数 pkg_preinst 向函数 pkg_postinst 切换的过程中, 相关的文件由沙盒中被安装到现行的系统中,此时Portage 将会记录文件安装的细节。

-When testing or debugging, you can instruct Portage to execute a specific function -from an ebuild by using the ebuild command, see the ebuild(1) manual -page for further information. +当需要测试或排错时,可以命令Portage只针对一个 ebuild 文件运行 + ebuild 命令, 详见 ebuild(1) 更详细的手册说明.

-Contents +目录 From 07ddd307e791f81f4c81d6a26371baaeae0c628e Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Wed, 6 Mar 2013 20:03:01 +0800 Subject: [PATCH 09/54] modified: ebuild-writing/variables/text.xml --- ebuild-writing/variables/text.xml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ebuild-writing/variables/text.xml b/ebuild-writing/variables/text.xml index ae3f1fb..21b8145 100644 --- a/ebuild-writing/variables/text.xml +++ b/ebuild-writing/variables/text.xml @@ -129,14 +129,14 @@ HOMEPAGE - 软件包的主页,如果没有办法找到官方网站,可以尝试去 freshmeat.net 或类似的软件追踪网站来查找连接。其中不要包含变量,只能是原始文字。 + 软件包的主页,如果没有办法找到官方网站,可以尝试去 freshmeat.net 或类似的软件追踪网站来查找连接。其中不要包含变量,只能是原始文字。 SRC_URI 软件包所用的原始安装包文件的URL. 可以包含 - USE-条件部分, 相见 + USE-条件部分, 详见 . @@ -165,7 +165,8 @@ IUSE - 设定成任何所有你的套件所用到的 USE 标示(不包括构架标示,但是包括 USE_EXPAND 标示) ,但是属于KEYWORDS的东西不应该列在此处. 详见 + 设定成任何所有你的套件所用到的 USE 标示(不包括构架标示,但是包括 + USE_EXPAND 标示) ,但是属于KEYWORDS的东西不应该列在此处. 详见 . @@ -261,7 +262,7 @@ SRC_URI="http://example.com/files/${P}-core.tar.bz2

若用USE_EXPAND 变量判断与软件包相关的某个可选组件是否安装,最好就是安装完成所有可用的组件。 -

+

SRC_URI="http://example.com/files/${P}-core.tar.bz2 From d37578318b44bee150fd799983836842a96040db Mon Sep 17 00:00:00 2001 From: whdxwym Date: Thu, 7 Mar 2013 15:22:34 +0800 Subject: [PATCH 10/54] Update text.xml --- ebuild-writing/functions/pkg_info/text.xml | 24 ++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/ebuild-writing/functions/pkg_info/text.xml b/ebuild-writing/functions/pkg_info/text.xml index 44f3c77..5de2bb0 100644 --- a/ebuild-writing/functions/pkg_info/text.xml +++ b/ebuild-writing/functions/pkg_info/text.xml @@ -6,30 +6,30 @@ - + pkg_info - - display information about a package + + 显示安装包的信息 - + ? - + root - + ebuild
Function函数
Purpose目标
Sandbox沙箱
Privilege权限
Called for要求
-Default <c>pkg_info</c> +默认的 <c>pkg_info</c> pkg_info() @@ -41,7 +41,7 @@ pkg_info()
-Sample <c>pkg_info</c> +例 <c>pkg_info</c> pkg_info() { @@ -52,13 +52,11 @@ pkg_info() {
-Notes on <c>pkg_info</c> +注释 <c>pkg_info</c>

-this phase will be called when a package manager displays -information about a package. -within EAPI=4, this phase can also be called for non-installed -packages. +包管理器要显示一个软件包的信息时便会调用此函数。 +当EAPI=4时, 此函数也可以被未安装的包调用。

From f6384d4a09e6c55c57bc6acc89489d2d575f4643 Mon Sep 17 00:00:00 2001 From: whdxwym Date: Thu, 7 Mar 2013 15:35:40 +0800 Subject: [PATCH 11/54] Update text.xml --- ebuild-writing/functions/pkg_nofetch/text.xml | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/ebuild-writing/functions/pkg_nofetch/text.xml b/ebuild-writing/functions/pkg_nofetch/text.xml index f360607..151ab57 100644 --- a/ebuild-writing/functions/pkg_nofetch/text.xml +++ b/ebuild-writing/functions/pkg_nofetch/text.xml @@ -6,30 +6,30 @@ - + pkg_nofetch - - Tell the user how to deal with fetch-restricted packages + + 告诉用户如何处理限制获取的软件包 - - Enabled + + 启用 - + root - + ebuild
Function函数
Purpose目标
Sandbox沙箱
Privilege权限
Called for要求
-Default <c>pkg_nofetch</c> +默认的 <c>pkg_nofetch</c> pkg_nofetch() @@ -47,7 +47,7 @@ pkg_nofetch()
-Sample <c>pkg_nofetch</c> +例 <c>pkg_nofetch</c> pkg_nofetch() { @@ -61,13 +61,11 @@ pkg_nofetch() {
-Notes on <c>pkg_nofetch</c> +注释 <c>pkg_nofetch</c>

-This function is only triggered for packages which -have RESTRICT="fetch" (see ) -set, and only if one or more components listed in SRC_URI are not -already available in the distfiles directory. +此函数仅仅当软件包有 RESTRICT="fetch" (参考 ) +设置时, 或者有一个或多个列在SRC_URI中的组件不存在于 distfiles 文件夹时才会调用.

From 1306005c666f8255174ce9f60fbc0cf796ed5809 Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Thu, 7 Mar 2013 23:43:25 +0800 Subject: [PATCH 12/54] Update text.xml pkg_setup/text.xml --- ebuild-writing/functions/pkg_setup/text.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ebuild-writing/functions/pkg_setup/text.xml b/ebuild-writing/functions/pkg_setup/text.xml index a7fe9d2..7fcc808 100644 --- a/ebuild-writing/functions/pkg_setup/text.xml +++ b/ebuild-writing/functions/pkg_setup/text.xml @@ -6,30 +6,30 @@ - + pkg_setup - - Pre-build environment configuration and checks + + 预先建立编译的环境配置并行相关检测 - Disabled + 关闭 - + root - + ebuild, binary
Function函数
Purpose意义
Sandbox
Privilege所需权限
Called for被谁调用
-Default <c>pkg_setup</c> +默认 <c>pkg_setup</c>的样子 pkg_setup() @@ -41,7 +41,7 @@ pkg_setup()
-Sample <c>pkg_setup</c> +实例 <c>pkg_setup</c> pkg_setup() { From a530105792aa9de31270b38cac74c8ca9de6cd12 Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Thu, 7 Mar 2013 23:55:26 +0800 Subject: [PATCH 13/54] Update text.xml pkg_postinst --- .../functions/pkg_postinst/text.xml | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/ebuild-writing/functions/pkg_postinst/text.xml b/ebuild-writing/functions/pkg_postinst/text.xml index 8b86c4c..80d5f0b 100644 --- a/ebuild-writing/functions/pkg_postinst/text.xml +++ b/ebuild-writing/functions/pkg_postinst/text.xml @@ -6,30 +6,30 @@ - + pkg_postinst - - Called after image is installed to ${ROOT} + + 软件包安装到${ROOT}目录之后调用 - Disabled + 关闭 - + root - + ebuild, binary
Function函数
Purpose意义
Sandbox
Privilege所需权限
Called for被谁调用
-Default <c>pkg_postinst</c> +默认的 <c>pkg_postinst</c> pkg_postinst() @@ -41,7 +41,7 @@ pkg_postinst()
-Sample <c>pkg_postinst</c> +实例 <c>pkg_postinst</c> pkg_postinst() { @@ -59,14 +59,12 @@ pkg_postinst() {
-Common <c>pkg_postinst</c> Tasks +函数<c>pkg_postinst</c> 常见用途/title> <body> <p> -The most common use for <c>pkg_postinst</c> is to display post-install -informational messages or warnings. If you want to display selective -upgrade messages, you should do the call to <c>has_version</c> in an -earlier phase, like <c>pkg_preinst</c>, and store the result in a global -variable.</p> +函数<c>pkg_postinst</c>最常用于显示安装之后的信息说明或警告提示. 如果您想要显示某些升级有关的讯息 +,你可以在较靠前的位置调用<c>has_version</c>, 如常常在声明<c>pkg_preinst</c>的位置, 并且要把他们保存为全局变量 +。</p> </body> </section> From ad29e1155be48a7dda1f7bfe939bd1ce121eb529 Mon Sep 17 00:00:00 2001 From: dpzhang314 <dpzhang314@gmail.com> Date: Fri, 8 Mar 2013 00:02:57 +0800 Subject: [PATCH 14/54] Update text.xml pkg_prerm --- ebuild-writing/functions/pkg_prerm/text.xml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/ebuild-writing/functions/pkg_prerm/text.xml b/ebuild-writing/functions/pkg_prerm/text.xml index d9f8a6f..a21f4c0 100644 --- a/ebuild-writing/functions/pkg_prerm/text.xml +++ b/ebuild-writing/functions/pkg_prerm/text.xml @@ -6,30 +6,30 @@ <body> <table> <tr> - <th>Function</th> + <th>函数名</th> <ti><c>pkg_prerm</c></ti> </tr> <tr> - <th>Purpose</th> - <ti>Called before a package is unmerged</ti> + <th>意义</th> + <ti>在软件包被卸载之前调用</ti> </tr> <tr> <th>Sandbox</th> - <ti>Disabled</ti> + <ti>关闭</ti> </tr> <tr> - <th>Privilege</th> + <th>所需权限</th> <ti>root</ti> </tr> <tr> - <th>Called for</th> + <th>被谁调用</th> <ti>ebuild, binary</ti> </tr> </table> </body> <section> -<title>Default <c>pkg_prerm</c> +默认的 <c>pkg_prerm</c> pkg_prerm() @@ -41,7 +41,7 @@ pkg_prerm()
-Sample <c>pkg_prerm</c> +实例 <c>pkg_prerm</c> pkg_prerm() { @@ -53,11 +53,10 @@ pkg_prerm() {
-Common <c>pkg_prerm</c> Tasks +函数<c>pkg_prerm</c>通常运用

-pkg_prerm is used to clean up any files that would otherwise prevent -a clean unmerge. +函数pkg_prerm用来在卸载软件包之前为系统做一些清理工作。

From bfeb1bf53a4da723979cd9f03f5ae3d6e886b7ed Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Fri, 8 Mar 2013 00:16:06 +0800 Subject: [PATCH 15/54] Update text.xml pkg_pretend --- ebuild-writing/functions/pkg_pretend/text.xml | 34 ++++++++----------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/ebuild-writing/functions/pkg_pretend/text.xml b/ebuild-writing/functions/pkg_pretend/text.xml index 9f051f7..67d416a 100644 --- a/ebuild-writing/functions/pkg_pretend/text.xml +++ b/ebuild-writing/functions/pkg_pretend/text.xml @@ -6,34 +6,34 @@ - + pkg_pretend - - run sanity checks for a package during dependency calculation time + + 在系统进行依赖性运算时,常规检测一下软件包? - + root - + ebuild - + 3
Function函数名
Purpose意义
Sandbox
Privilege所需权限
Called for被谁调用
EAPIEAPI规约
-Default <c>pkg_pretend</c> +默认的 <c>pkg_pretend</c> pkg_pretend() @@ -45,7 +45,7 @@ pkg_pretend()
-Sample <c>pkg_pretend</c> +实例 <c>pkg_pretend</c> pkg_pretend() { @@ -64,22 +64,18 @@ pkg_pretend() {
-Notes on <c>pkg_pretend</c> +函数<c>pkg_pretend的相关注意事项</c>

-the pkg_pretend phase can be used to do sanity checks -before the main phase function sequence is run (meaning this phase is -executed after the package manager has calculated the dependencies -and before installing them). -This phase typically checks for a kernel configuration and may -eerror and die when needed. +该函数pkg_pretend在主函数运行前做一些常规的检测(意味着它运行在系统计算依赖性检测, +准备安装它们之前). +如它会常规检测kernel的configuration及必要是调用 +eerrordie . - There is no guarantee that the ebuild's dependencies are installed - when this phase is called. + 该函数被调用时尚且不能保证软件包所有的依赖都能正确的安装。 - As pkg_pretend is not called in the main phase function - sequence, environment saving is not guaranteed. + 因为函数pkg_pretend 不会在主函数中调用,相关的环境变量常不能保证正常保存。

From 7d8e8eb265a7549b8864fee89b5a756c0b13cd80 Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Fri, 8 Mar 2013 00:23:01 +0800 Subject: [PATCH 16/54] Update text.xml pkg_postrm --- ebuild-writing/functions/pkg_postrm/text.xml | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/ebuild-writing/functions/pkg_postrm/text.xml b/ebuild-writing/functions/pkg_postrm/text.xml index fa2a21d..6c1397c 100644 --- a/ebuild-writing/functions/pkg_postrm/text.xml +++ b/ebuild-writing/functions/pkg_postrm/text.xml @@ -6,30 +6,30 @@ - + pkg_postrm - - Called after a package is unmerged + + 软件包卸载之后调用 - Disabled + 关闭 - + root - + ebuild, binary
Function函数名
Purpose意义
Sandbox
Privilege所需权限
Called for被谁调用
-Default <c>pkg_postrm</c> +默认的<c>pkg_postrm</c> pkg_postrm() @@ -41,7 +41,7 @@ pkg_postrm()
-Sample <c>pkg_postrm</c> +实例<c>pkg_postrm</c> pkg_postrm() { @@ -52,11 +52,11 @@ pkg_postrm() {
-Common <c>pkg_postrm</c> Tasks +函数<c>pkg_postrm</c>通常用途

-pkg_postrm is is used to update symlinks, cache files and other -generated content after a package has been uninstalled. +函数pkg_postrm 主要用来更新系统链接,更新缓存文件, +和软件包被卸载后产生的一些相关讯息提示。

From d932811877f779b37ed7a3f3538f9add04509346 Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Fri, 8 Mar 2013 00:24:07 +0800 Subject: [PATCH 17/54] Update text.xml --- ebuild-writing/functions/pkg_preinst/text.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ebuild-writing/functions/pkg_preinst/text.xml b/ebuild-writing/functions/pkg_preinst/text.xml index 9cdeb4a..2bb1621 100644 --- a/ebuild-writing/functions/pkg_preinst/text.xml +++ b/ebuild-writing/functions/pkg_preinst/text.xml @@ -6,11 +6,11 @@ - + pkg_preinst - + Called before image is installed to ${ROOT} From 8993305a3e1b6eb3c02c788a20bfe16a38f4337a Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Fri, 8 Mar 2013 00:43:30 +0800 Subject: [PATCH 18/54] Update text.xml pkg_preinst --- ebuild-writing/functions/pkg_preinst/text.xml | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/ebuild-writing/functions/pkg_preinst/text.xml b/ebuild-writing/functions/pkg_preinst/text.xml index 2bb1621..2e93c70 100644 --- a/ebuild-writing/functions/pkg_preinst/text.xml +++ b/ebuild-writing/functions/pkg_preinst/text.xml @@ -11,25 +11,25 @@ - Called before image is installed to ${ROOT} + 在软件包的被安装到${ROOT}之前被调用 - Disabled + 关闭 - + root - + ebuild, binary
Function函数名
Purpose意义
意义
Sandbox
Privilege所需权限
Called for被谁调用
-Default <c>pkg_preinst</c> +默认的 <c>pkg_preinst</c> pkg_preinst() @@ -41,7 +41,7 @@ pkg_preinst()
-Sample <c>pkg_preinst</c> +实例 <c>pkg_preinst</c> pkg_preinst() { @@ -53,28 +53,26 @@ pkg_preinst() {
-Common <c>pkg_preinst</c> Tasks +函数<c>pkg_preinst</c> 通常用途

-There are a few things that are often done in pkg_preinst: +有相当一些事情常常在函数pkg_preinst中来做:

  • - Adding users and groups. However, since pkg_preinst may be called - after src_compile, pkg_setup is the more suitable location for - user creation see . + 添加用户和用户组。但因为函数pkg_preinst有可能在 + src_compile之后调用, 在函数pkg_setup处似乎是更适合用来添加用户的位置 + 详见 .
  • - Modifying the install image for a particular system. This function - allows system-specific customisation to be done even when installing - from a binary. The most useful example is probably smart - configuration file updating a pkg_preinst could check a - configuration file in ${ROOT}/etc/ and create a smart updated - version in ${D}/etc/ (see - ) rather than - always trying to install the default configuration file (remember - ). + 针对某一系统而调整相关安装文件. 它 + 允许为系统做出一些自定义的调整,同样二进制包在被安装时也可以。 + 最常用的一招就是灵活地调整一些配置文件函数pkg_preinst能检测 + 存在于${ROOT}/etc/的配置文件,并在${D}/etc/目录中创建一些更新的版本 (详见 + ) 而不是 + 每次都安装默认的配置文件 (记得看 + 这篇文章哦).
From e5931634680be2c6e8525033d9511c4a97af709e Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Fri, 8 Mar 2013 01:05:23 +0800 Subject: [PATCH 19/54] Update text.xml src_unpack --- ebuild-writing/functions/src_unpack/text.xml | 39 ++++++++++---------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/ebuild-writing/functions/src_unpack/text.xml b/ebuild-writing/functions/src_unpack/text.xml index 542b3fb..99398c6 100644 --- a/ebuild-writing/functions/src_unpack/text.xml +++ b/ebuild-writing/functions/src_unpack/text.xml @@ -6,30 +6,30 @@ - + src_unpack - - Extract source packages and do any necessary patching or fixes. + + 将源码包(其他的压缩包)解压,打各种补丁或小修正 - Enabled + 开启 - + user - + ebuild
Function函数名
Purpose意义
Sandbox
Privilege所需权限
Called for被谁调用
-Default <c>src_unpack</c> +默认的<c>src_unpack</c> src_unpack() { @@ -42,7 +42,7 @@ src_unpack() {
-Sample <c>src_unpack</c> +实例<c>src_unpack</c> src_unpack() { @@ -56,35 +56,36 @@ src_unpack() { } -When using EAPI >=2, you should use the src_prepare function to apply patches or alter any of the source files, instead of the src_unpack. +当包含的EAPI >=2时, 必须使用函数src_prepare +来打补丁或替换部分源文件,不推荐使用src_unpack函数.
-Unpacking Tarballs +解压各种压缩包

-The unpack function should be used to unpack tarballs, compressed -files and so on. Do not use tar, gunzip etc. manually. +函数unpack 用于解压各种包,压缩文件等等。 +不建议用 tar, gunzip 等命令手动解压,哈哈。

-The ${A} variable contains all of the SRC_URI components, except -for any which are excluded by USE-based conditionals inside SRC_URI -itself. If multiple archives require unpacking in a particular order it is -usually simpler to avoid working with ${A}. +变量${A}包含源自变量SRC_URI的所有元素,除外 +一些些在SRC_URI中被基于USE条件表示排除掉的元素. +如果多个包需要按一定的顺序解压缩, +不使用变量${A}将会简化工作.

-<c>src_unpack</c> Actions +行动吧<c>src_unpack</c>

-The following subsections cover different topics which often occur when writing -src_unpack functions. +以下各小节将涵盖在开发者撰写 +src_unpack相关函数时,遇到的不同源头的软件包的处理问题.

From d6cfe3f1c37a0d8ce431065839080dada67eeddd Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Fri, 8 Mar 2013 01:37:31 +0800 Subject: [PATCH 20/54] Update text.xml src_test --- ebuild-writing/functions/src_test/text.xml | 62 +++++++++++----------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/ebuild-writing/functions/src_test/text.xml b/ebuild-writing/functions/src_test/text.xml index dd02d4b..aa79ff7 100644 --- a/ebuild-writing/functions/src_test/text.xml +++ b/ebuild-writing/functions/src_test/text.xml @@ -6,30 +6,30 @@ - + src_test - - Run pre-install test scripts + + 在安装之前运行test脚本 - Enabled + 开启 - + user - + ebuild
Function函数名
Purpose意义
Sandbox
Privilege所需权限
Called for被谁调用
-Default <c>src_test</c> +默认的 <c>src_test</c>

From sys-apps/portage-2.1.2.9

@@ -55,7 +55,7 @@ src_test() {
-Sample <c>src_test</c> +实例<c>src_test</c> src_test() { @@ -73,49 +73,48 @@ src_test() {
-Common <c>src_test</c> Tasks +函数<c>src_test</c>通常运用

-Often the default src_test is fine. Sometimes it is necessary -to remove certain tests from the list if they cannot be used with a -portage environment. Reasons for such a failure could include: +一般而言,默认的src_test没有什么问题. 但有时 +某些软件不能够在Portage的环境下运行时,就有必要略去相应的tests +. 具体要去除test的原因如下:

    -
  • Needing to use X.
  • +
  • 需要X支持.
  • - Needing to work with files which are disallowed by the sandbox. + 需要运行被sandbox限制的相关文件.
  • -
  • Requiring user input (src_test must not be interactive).
  • -
  • Requiring root privileges.
  • +
  • 需要与用户的一些输入(src_test是不能够交互的).
  • +
  • 需要root权限.

-Usually, removing the relevant test from the Makefile -using sed or skipping a particular make target is -sufficient. +通常,在Makefile中使用 +sed命令去除相关的test就行,也可以直接跳过某个make目标.

-emake should not be used for src_test trying to -parallelise tests unless the Makefile was specifically designed -for this can cause all sorts of strange problems. +注意不应该在函数src_test中使用emake +并行的tests会导致各种各样奇怪的问题,除非Makefile +这样写是有其特殊的目的.

-Try to ensure that tests work properly for your ebuild. A good test -suite is extremely helpful for arch maintainers. +尽量保证您撰写的ebuilds能在正常的通过tests. +一个好的测试单元对ebuilds的维护者而言极其重要.

-Skipping Tests +跳出Tests

-Sometimes it is necessary to skip tests entirely. This can be done -using a dummy src_test function: +有时候完全跳出tests是有必要的, +可以如下简单的操纵src_test函数:

@@ -126,14 +125,13 @@ src_test() {

-Another option would be to set RESTRICT="test" in the ebuild. +另外的可行途径是在ebuild中开启RESTRICT="test" .

-If upstream provide a test suite which doesn't work, consider talking -to them about getting it fixed. A broken test suite is worse than no -test suite at all, since we are unable to tell whether a test failure -indicates a genuine fault. +如果上游提供的test单元不能正常运行,请务必 +向他们说明更正错误.包含谬误的测试比不测试更恐怖, +因为我们不能从中分辨出是否是软件运行的错误.
From 7c3f84317092b26b033d8526679f2dd327dea481 Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Fri, 8 Mar 2013 11:42:48 +0800 Subject: [PATCH 21/54] Update text.xml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit arch sources(需要时可再次编辑) --- ebuild-writing/functions/src_unpack/tla-sources/text.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ebuild-writing/functions/src_unpack/tla-sources/text.xml b/ebuild-writing/functions/src_unpack/tla-sources/text.xml index 97a8b40..5ec2afe 100644 --- a/ebuild-writing/functions/src_unpack/tla-sources/text.xml +++ b/ebuild-writing/functions/src_unpack/tla-sources/text.xml @@ -1,11 +1,11 @@ -Arch Sources +Arch 源的软件包 -Anyone want to write this? You can probably mostly copy the CVS Sources and Subversion Sources chapters. +这种类型的软件包和cvs的及svn的大部分都是一致的,不必赘述. From 3093f95a82000e039f39258ead88874121763387 Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Fri, 8 Mar 2013 12:05:59 +0800 Subject: [PATCH 22/54] Update text.xml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RPM软件包 --- .../functions/src_unpack/rpm-sources/text.xml | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/ebuild-writing/functions/src_unpack/rpm-sources/text.xml b/ebuild-writing/functions/src_unpack/rpm-sources/text.xml index dcf9113..284cc48 100644 --- a/ebuild-writing/functions/src_unpack/rpm-sources/text.xml +++ b/ebuild-writing/functions/src_unpack/rpm-sources/text.xml @@ -1,11 +1,11 @@ -RPM Sources +RPM包

-If a package is supplied as an .rpm file, you should: +若软件包是rpm格式的, 应如下操作:

@@ -13,14 +13,13 @@ inherit rpm

-If you don't need to do anything in the unpack phase, then you are -finished as the rpm.eclass exports a default src_unpack -that will unpack the RPM files. +如果在这个阶段您只是要解压软件包而无做其他的事情的意向, +仅使用rpm.eclass就能解决问题,因为它默认会调用src_unpack +来解压RPM文件.

-If you do need to apply patches then override src_unpack in a -manner such as: +另外也不需要在src_unpack函数中像下面那样,另外声明处理添加的补丁:

@@ -33,22 +32,21 @@ src_unpack () { -${A} can contain non-rpm files since the rpm eclass will call -the normal unpack function for files that are not in the RPM -format. +变量${A}可以包含一些非rpm格式文件,rpm eclass会自动判断, +加载unpack处理非rpm格式的文件.
-Example RPM Handling +安装RPM类型包的实例

-Here is an ebuild snippet that is based upon the fetchmail source RPM -from SuSE 9.2. The ebuild snippet is complete enough to work with the -ebuild unpack command. The ebuild will download the source file from -the OSU SuSE mirror, unpack the file and apply the included -patches. The filename should be suse-fetchmail-6.2.5.54.1.ebuild. +以下ebuild代码片段是基于fetchmail源于SuSE 9.2的RPM包 +.该片段完全能被ebuild的unpack函数正确识别执行. +他能从OSU SuSE的镜像源中下载RPM软件包, +解压相关文件并打上对应的内置补丁. +ebuilds的文件名格式应该是suse-fetchmail-6.2.5.54.1.ebuild.

From a40867eecd876cf1de12a684ca77dc808691dd05 Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Fri, 8 Mar 2013 12:08:30 +0800 Subject: [PATCH 23/54] Update text.xml --- ebuild-writing/functions/src_unpack/rpm-sources/text.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ebuild-writing/functions/src_unpack/rpm-sources/text.xml b/ebuild-writing/functions/src_unpack/rpm-sources/text.xml index 284cc48..4c883dd 100644 --- a/ebuild-writing/functions/src_unpack/rpm-sources/text.xml +++ b/ebuild-writing/functions/src_unpack/rpm-sources/text.xml @@ -1,7 +1,7 @@ -RPM包 +RPM源

From cd75d3237f5aab488b3b860b936927ad383b7ca8 Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Fri, 8 Mar 2013 12:25:04 +0800 Subject: [PATCH 24/54] Update text.xml Debian Source --- .../functions/src_unpack/deb-sources/text.xml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ebuild-writing/functions/src_unpack/deb-sources/text.xml b/ebuild-writing/functions/src_unpack/deb-sources/text.xml index bdbadb4..ca31b84 100644 --- a/ebuild-writing/functions/src_unpack/deb-sources/text.xml +++ b/ebuild-writing/functions/src_unpack/deb-sources/text.xml @@ -1,11 +1,20 @@ -Debian Sources +Debian源 -from vapier: we dont have to 'handle' these because all debian packages have a source tarball ... the .deb format is pretty simple though, it's managed by the 'ar' utility from binutils. you can unpack a .deb by simply doing ar x blah.deb ... this will give you three files: debian-binary: plain text file which just contains version number of the .deb format control.tar.gz: a few files which control installing/verifying of package data.tar.gz: all the compiled files ... you could just extract it to / +据vapier(一位gentoo的开发维护的大牛吧)所言: +我们没有必要专门对debian源的软件包进行特殊处理... +因为.deb格式的包有点咋说呢,忒简单喽, +它们统一由'ar'命令管理,ar在每个发行版的binutils都会有. +一条命令就可加压.deb的包:ar x blah.deb ... +它包含3个文件: +debian-binary:text文档仅包含.deb格式文件的版本号. +control.tar.gz:控制安装/确认软件的的一些文件. +data.tar.gz:所有编译好的软件成品... +你要做的就是把它加压到 / From 85c73cd6ef8c7b4bb51becf974e5548a3187aedb Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Fri, 8 Mar 2013 12:37:26 +0800 Subject: [PATCH 25/54] Update text.xml Other Archive formats --- .../src_unpack/other-formats/text.xml | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/ebuild-writing/functions/src_unpack/other-formats/text.xml b/ebuild-writing/functions/src_unpack/other-formats/text.xml index 3647c80..988a006 100644 --- a/ebuild-writing/functions/src_unpack/other-formats/text.xml +++ b/ebuild-writing/functions/src_unpack/other-formats/text.xml @@ -1,49 +1,49 @@ -Other Archive Formats +其他类型的归档文件

-There are a variety of other archive formats which you may encounter. -Instructions for some of them are detailed below: +你可能遇到各种不同类型的归档文件. +以下是针对其的相关说明:

-Zip Files +Zip文件

-If a package is supplied as a .zip file, you should: +针对.zip格式的文件,常做如下处理:

    -
  • DEPEND upon app-arch/unzip
  • -
  • Use unpack as normal
  • +
  • DEPEND变量中加入app-arch/unzip
  • +
  • 一个词搞定unpack
-Shar Files +Shar格式文档

-If a package is supplied as a .shar file, you should repackage it locally -into a .tar.bz2. It may also be useful to ask upstream to use a friendlier -package format however, if they ship .shar, chances are they haven't -done a release in at least ten years. +针对与.shar格式的文档,啥也别说了,直接本地重新打包为 +.tar.bz2.当然你也能请求上游的相关人员使用一些比较人性化的归档格式 +,然而如果他们只有.shar的老古董,说明很可能 +10年前至今他们都无所作为.

-RAR Files +RAR文档

-.rar files must be repackaged locally into a .tar.bz2 file. +.rar格式的文件必须与本地重新打包成.tar.bz2的文件,元芳,你怎么看?.

From 562363a87a3eacaabe626dbd6b4c96de38d053ca Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Fri, 8 Mar 2013 13:30:43 +0800 Subject: [PATCH 26/54] update appendices,modified some files for fun --- appendices/contributing/text.xml | 2 +- appendices/contributors/text.xml | 4 ++-- appendices/editor-configuration/text.xml | 10 ++++---- appendices/editor-configuration/vim/text.xml | 7 +++--- appendices/further-reading/text.xml | 24 ++++++++------------ appendices/text.xml | 2 +- text.xml | 2 +- 7 files changed, 23 insertions(+), 28 deletions(-) diff --git a/appendices/contributing/text.xml b/appendices/contributing/text.xml index 93ff36c..857da15 100644 --- a/appendices/contributing/text.xml +++ b/appendices/contributing/text.xml @@ -5,7 +5,7 @@

-非常欢迎为本文档添砖加瓦,哪怕是印刷错误或一段新的内容,您都可以通过登录 Bugzilla bugs.gentoo.org 来提交. +非常欢迎为本文档添砖加瓦,哪怕是印刷错误或一段新的内容,您都可以通过登录Bugzillabugs.gentoo.org来提交.

diff --git a/appendices/contributors/text.xml b/appendices/contributors/text.xml index ee6d96c..a848752 100644 --- a/appendices/contributors/text.xml +++ b/appendices/contributors/text.xml @@ -1,11 +1,11 @@ -Contributions +编者目录

-This page lists the contributions to the Gentoo Development Guide: +在此列出本册各章节编者,再次感谢他们为Gentoo开发文档做出的贡献:

diff --git a/appendices/editor-configuration/text.xml b/appendices/editor-configuration/text.xml index 071380c..990ef8d 100644 --- a/appendices/editor-configuration/text.xml +++ b/appendices/editor-configuration/text.xml @@ -1,22 +1,22 @@ -Editor Configuration +

-This section provides hints as to how to configue your text editor for working with ebuilds. +һʾйر༭ebuildsĵõtext editorʾ.

-from vapier: add a section for nano ... users just have to copy -/etc/nanorc to ~/.nanorc and uncomment the sections for ebuilds +vapier:nanoô?...ֻø +/etc/nanorc~/.nanorcȥebuildsεע;.
-Contents +ûҪ diff --git a/appendices/editor-configuration/vim/text.xml b/appendices/editor-configuration/vim/text.xml index e0d34e8..a3990ad 100644 --- a/appendices/editor-configuration/vim/text.xml +++ b/appendices/editor-configuration/vim/text.xml @@ -1,13 +1,12 @@ -Configuring <c>vim</c> and <c>gvim</c> +񼶱༭<c>vim</c><c>gvim</c>

-For full whitespace, character set, syntax highlighting and indent settings for -all of Gentoo's file-types in vim and gvim, emerge the -app-vim/gentoo-syntax package. +gentooĵеwhitespace, character set, syntax +vimgvim, emergeapp-vim/gentoo-syntax.

diff --git a/appendices/further-reading/text.xml b/appendices/further-reading/text.xml index 9fa79af..b8dd26e 100644 --- a/appendices/further-reading/text.xml +++ b/appendices/further-reading/text.xml @@ -1,28 +1,26 @@ -Further Reading +Ķ

-This section lists some recommended further reading. These are real -recommendations, not padding designed to make this document look important. +ǿƼĶг¡鼮. ξθ֮,ǽ֮.

-Books +鼮ϵĽ
- Mastering Regular Expressions + Mastering Regular Expressions(ʽ)

- "Mastering Regular Expressions" by Jeffrey E. F. Friedl (O'Reilly, - ISBN 0-596-00289-0) is the book on regular expressions. Very readable and - devoid of the usual mathematical jargon that tends to fill up these kinds of - books. Publisher's page + "Mastering Regular Expressions" Jeffrey E. F. Friedl (O'Reilly, + ISBN 0-596-00289-0)רRegular Expressions. ɶǿdz + 鼮гõķ֮߳ѧ. ҳ

@@ -31,7 +29,7 @@ recommendations, not padding designed to make this document look important.
-Articles +
@@ -41,9 +39,7 @@ recommendations, not padding designed to make this document look important.

Making - Packager-Friendly Software by Julio M. Merino Vidal describes various things - that can be done by upstream software providers to make life easy for the - distribution people (that means you). + Packager-Friendly Software Julio M. Merino Vidalָ˺ܶupstream software providers飬ӷʹ.

@@ -52,7 +48,7 @@ recommendations, not padding designed to make this document look important.

How to Report Bugs - Effectively by Simon Tatham is a good overview of effective bug reporting. + EffectivelySimon Tatham׫дЧύBugsôϾʱȶһ.

diff --git a/appendices/text.xml b/appendices/text.xml index 73799ed..3acc0a3 100644 --- a/appendices/text.xml +++ b/appendices/text.xml @@ -5,7 +5,7 @@

-本章包含一些可能有用的附加文档方便参考。 +本章包含一些可能有用的附加文档,方便参考。

diff --git a/text.xml b/text.xml index 0b2cfaf..e9d6d66 100644 --- a/text.xml +++ b/text.xml @@ -21,7 +21,7 @@

欢迎完善该文档.具体操作详见 -章节. 如您有对本文有任何的建议和意见,错误的修改等请参照bug list和提交一new bug. +章节. 如您有对本文有任何的建议和意见,错误的修改等请参照bug list和提交一新的Bug. 这部分 列举了各个编委为本文所做的具体工作.

From 979e5b3d6e78254dbec25a5d12972627c9d80a24 Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Sun, 10 Mar 2013 00:48:31 +0800 Subject: [PATCH 27/54] cvs&svn sources --- .../functions/src_unpack/cvs-sources/text.xml | 78 +++++++++---------- .../functions/src_unpack/svn-sources/text.xml | 63 +++++++-------- 2 files changed, 64 insertions(+), 77 deletions(-) diff --git a/ebuild-writing/functions/src_unpack/cvs-sources/text.xml b/ebuild-writing/functions/src_unpack/cvs-sources/text.xml index 4c51550..3c5e72b 100644 --- a/ebuild-writing/functions/src_unpack/cvs-sources/text.xml +++ b/ebuild-writing/functions/src_unpack/cvs-sources/text.xml @@ -1,42 +1,40 @@ -CVS Sources +CVSԴ

-Rather than working with a source tarball, it is possible to use -upstream's CVS server directly. This can be useful when there is a -need to test unreleased snapshots on a regular basis. +ʹԴGentooҲֱʹεCVS +. Ҫϲδеʱ +ʹCVSΪṩܶ෽.

-Disadvantages of CVS Sources +CVSԴ

-Note that CVS ebuilds should not generally be added to the tree -(except under package.mask) for the following reasons: +עʹCVSebuildsͨnӵPortage +(дpackage.mask), :

  • - Upstream CVS servers tend to be far less reliable than our mirroring - system. + εCVSԶûǵľϵͳֵ.
  • - CVS ebuilds create a very heavy server load not only is CVS not - mirrored, but allowing a CVS checkout is considerably more work for - a server than simply serving up a file via HTTP or FTP. + ʹCVSebuildsԷصĸΪCVSûо, + ṩCVSĹзĸأͨȼ򵥵ʹHTTPFTPҪصö.
  • - Many users who are behind strict firewalls cannot use CVS. + װǿ׳ǽûӦҲCVS.

-It is safer to make a snapshot instead. For example, vim snapshots are made using: +ͨյķʽʹCVSʵҲȫ.,´vimsnapshots:

@@ -46,26 +44,23 @@ $ cvs -z3 -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/vim export -r HEAD
 
-Disadvantages of CVS Live Sources +CVSԴ

-CVS ebuilds which work against CVS HEAD rather than a specific +(طӦ¿)CVS ebuilds which work against CVS HEAD rather than a specific date or revision are even worse candidates for tree inclusion:

  • - You can never be sure whether upstream's CVS will actually - build at any given point; which will most likely cause QA issues. + ѱ֤εCVSȷʵǰոķ;кܻܶᵼQA.
  • - It is extremely difficult to track down bugs when you cannot install - the same version of a package as the reporter. + ύ棬עԼװĴʱ¸bugs.
  • - Many upstream package maintainers tend to get upset if people aren't - using a specific released version. + ܶεİάǻ᲻ЩԸʹijа.
@@ -73,65 +68,64 @@ date or revision are even worse candidates for tree inclusion:
-Using CVS Sources +ʹCVSԴ

-To use a CVS source, cvs.eclass must be inherited, and then a -number of variables must be set. The following variables are often -useful: +inherit̳cvs.eclassʹCVS,Ҫصı. +µıdz:

- - - + + + ECVS_SERVER - Server and path + CVSַ·"cvs.sourceforge.net:/cvsroot/vim"ECVS_MODULE - Module + ģ"vim"ECVS_BRANCH - Branch + ֧"HEAD"ECVS_AUTH - Auth method + Ȩ"ext"ECVS_USER - Username + û"anoncvs"ECVS_PASS - Password + ""ECVS_TOPDIR - Unpack location + ѹ·"${DISTDIR}/cvs-src/${ECVS_MODULE}"
VariablePurposeExampleʵ

-See the eclass itself for the full range of options. To perform the -actual checkout, use the cvs_src_unpack function. +֪ϸѡοӦeclassļ. +Ҫִļ,ɵcvs_src_unpack.

-Here's a simple example, based upon the CVS options in vim.eclass: +뿴,vim.eclassеCVS options:

@@ -155,9 +149,9 @@ src_unpack() {

-Here's another approach, based upon the emacs-cvs ebuild, which -relies upon the default src_unpack provided in the eclass; this -approach is simpler but less flexible: +һ, emacs-cvsebuild, +eclassĬṩsrc_unpack; +򵥵:

diff --git a/ebuild-writing/functions/src_unpack/svn-sources/text.xml b/ebuild-writing/functions/src_unpack/svn-sources/text.xml index c23ff7c..b85e770 100644 --- a/ebuild-writing/functions/src_unpack/svn-sources/text.xml +++ b/ebuild-writing/functions/src_unpack/svn-sources/text.xml @@ -1,35 +1,32 @@ -Subversion Sources +SubversionԴ

-As with CVS, an eclass exists for working directly with upstream -Subversion repositories. See -for a full list of functions and variables. Also see -the -ection. +CVS(eclass)һ,SVNeclassҲʵֱͬε +SubversionֿЭͬܵĽű. +׵ĺб.˳Ķ +½ +Ҳ.

-Disadvantages of Subversion Sources +ʹSubversionԴ

-Note that Subversion ebuilds should not generally be added to -the tree (except under package.mask) for much the same reasons -that live CVS ebuilds should not (see +עʹSubversionebuildsͨnӵPortage +(дpackage.mask), ɻʹCVSebuildsһ(μ ). -Indeed, there should be even less impetus to add a live Subversion ebuild than a live CVS ebuild, as -Subversion checkouts are roughly a factor of five larger than an -equivalent CVS checkout. +ʵ,ʹCVSebuildsȣǸʹSubversionebuilds, Ϊ +SubversionĽͬCVS5.

-It is safer (and better for the user) to make a snapshot instead. For -example, gentoo-syntax snapshots could be made using: +ͨյķʽʹCVSʵҲȫ. ,´gentoo-syntax:

@@ -39,60 +36,56 @@ $ svn export svn://svn.berlios.de/svnroot/repos/gentoo-syntax -r HEAD gentoo-syn
 
-Using Subversion Sources +ʹSubversionԴ

-To use a Subversion source, subversion.eclass must be -inherited, and then at least ESVN_REPO_URI must be set. The -following variables are also noteworthy: +inherit̳subversion.eclass>ʹSVN, +Ҫصı.ҪESVN_REPO_URI. +µıҲӦֵע:

- - - + + + ESVN_REPO_URI - Server and path (http, https, svn) + ַ·(http, https, svn)"svn://svn.example.com/foobar/trunk"ESVN_STORE_DIR - Unpack location + ѹ·ESVN_STORE_DIR="${DISTDIR}/svn-src"ESVN_PROJECT - Project name of ebuild + ebuildĿESVN_PROJECT="${PN/-svn}"ESVN_BOOTSTRAP - Bootstrap command or script + űESVN_BOOTSTRAP="autogen.sh"ESVN_PATCHES - Patches to apply during bootstrap + ڼҪIJESVN_PATCHES="${FILESDIR}/*.patch"
VariablePurposeExampleʵ

-See the eclass itself and -for the full range of options. To perform the actual checkout, use -the subversion_src_unpack function, which calls -both subversion_svn_fetch and subversion_bootstrap -itself. +֪ϸѡοsubversion.eclassļ. +Ҫִļ,ɵcvs_src_unpack, subversion_svn_fetchsubversion_bootstrap.

-Here is a simple example, based upon the Subversion options in -litu-svn-20040902.ebuild; this approach is sufficient for most -Subversion ebuilds: +ٶһ,ǻlitu-svn-20040902.ebuildйصSubversionѡ; +󲿷ֵSubversion ebuildsԲʽ:

From 41c619ae98bc3ba24586adfb0f2ac2b35b24146f Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Sun, 10 Mar 2013 00:55:16 +0800 Subject: [PATCH 28/54] modified: ebuild-writing/functions/src_unpack/cvs-sources/text.xml modified: ebuild-writing/functions/src_unpack/svn-sources/text.xml --- .../functions/src_unpack/cvs-sources/text.xml | 72 +++++++++---------- .../functions/src_unpack/svn-sources/text.xml | 56 +++++++-------- 2 files changed, 64 insertions(+), 64 deletions(-) diff --git a/ebuild-writing/functions/src_unpack/cvs-sources/text.xml b/ebuild-writing/functions/src_unpack/cvs-sources/text.xml index 3c5e72b..7d63e9a 100644 --- a/ebuild-writing/functions/src_unpack/cvs-sources/text.xml +++ b/ebuild-writing/functions/src_unpack/cvs-sources/text.xml @@ -1,40 +1,40 @@ -CVSԴ +CVS源

-ʹԴGentooҲֱʹεCVS -. Ҫϲδеʱ -ʹCVSΪṩܶ෽. +不使用源码包,在Gentoo中也可以直接使用上游的CVS服务 +. 当我们需要在正常基础上测试未发行的软件包快照时, +使用CVS会为您提供很多方便.

-CVSԴ +采用CVS源的劣势

-עʹCVSebuildsͨnӵPortage -(дpackage.mask), : +注意使用CVS的ebuilds通常n不被添加到Portage树 +(除非是写在package.mask), 理由如下:

  • - εCVSԶûǵľϵͳֵ. + 上游的CVS服务可能远没有我们的镜像系统更值得信赖.
  • - ʹCVSebuildsԷصĸΪCVSûо, - ṩCVSĹзĸأͨȼ򵥵ʹHTTPFTPҪصö. + 使用CVS的ebuilds对服务器会产生很重的负载不是因为CVS没有镜像化, + 而是提供CVS检出的过程中服务器的负载,通常会比简单的使用HTTP或FTP要重得多.
  • - װǿ׳ǽûӦҲCVS. + 装有强壮防火墙的用户应该也不能用CVS.

-ͨյķʽʹCVSʵҲȫ.,´vimsnapshots: +可以通过创建快照的方式使用CVS,事实上这样也会更安全.例如,可以如下创建vim的snapshots:

@@ -44,23 +44,23 @@ $ cvs -z3 -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/vim export -r HEAD
 
-CVSԴ +采用CVS活动源的劣势

-(طӦ¿)CVS ebuilds which work against CVS HEAD rather than a specific +(这个地方应该重新考虑)CVS ebuilds which work against CVS HEAD rather than a specific date or revision are even worse candidates for tree inclusion:

  • - ѱ֤εCVSȷʵǰոķ;кܻܶᵼQA. + 很难保证上游的CVS确实就是按照给的方案构建的;它们中很多可能会导致QA问题.
  • - ύ棬עԼװĴʱ¸bugs. + 当你提交报告,注明你自己安装的错误时,不方便向下跟踪bugs.
  • - ܶεİάǻ᲻ЩԸʹijа. + 很多上游的包维护者们会不乐意那些不愿意使用他们某个发行版的人们.
@@ -68,64 +68,64 @@ date or revision are even worse candidates for tree inclusion:
-ʹCVSԴ +使用CVS源

-inherit̳cvs.eclassʹCVS,Ҫصı. -µıdz: +必须先在inherit区声明继承cvs.eclass后才能使用CVS,并需要设置相关的变量. +以下的变量会非常有用:

- - - + + + ECVS_SERVER - CVSַ· + CVS服务器地址及路径"cvs.sourceforge.net:/cvsroot/vim"ECVS_MODULE - ģ + 模块"vim"ECVS_BRANCH - ֧ + 分支"HEAD"ECVS_AUTH - Ȩ + 授权方法"ext"ECVS_USER - û + 用户名"anoncvs"ECVS_PASS - + 密码""ECVS_TOPDIR - ѹ· + 欲解压路径"${DISTDIR}/cvs-src/${ECVS_MODULE}"
ʵ变量名意义实例

-֪ϸѡοӦeclassļ. -Ҫִļ,ɵcvs_src_unpack. +欲知更详细的选项,请参考相应的eclass文件. +想要执行真正的检出,可调用cvs_src_unpack函数.

-뿴,vim.eclassеCVS options: +请看此例,基于vim.eclass中的CVS options:

@@ -149,9 +149,9 @@ src_unpack() {

-һ, emacs-cvsebuild, -eclassĬṩsrc_unpack; -򵥵: +再来一例, 基于emacs-cvs的ebuild, +它依赖eclass默认提供的src_unpack; +这个更简单但不如上面的灵活:

diff --git a/ebuild-writing/functions/src_unpack/svn-sources/text.xml b/ebuild-writing/functions/src_unpack/svn-sources/text.xml index b85e770..a6d9bdf 100644 --- a/ebuild-writing/functions/src_unpack/svn-sources/text.xml +++ b/ebuild-writing/functions/src_unpack/svn-sources/text.xml @@ -1,32 +1,32 @@ -SubversionԴ +Subversion源

-CVS(eclass)һ,SVNeclassҲʵֱͬε -SubversionֿЭͬܵĽű. -׵ĺб.˳Ķ -½ -Ҳ. +和CVS的(eclass)一样,SVN的eclass也是实现直接同上游的 +Subversion仓库协同工作功能的脚本.详见 +那里有整套的函数及变量列表.顺便阅读下 +该章节 +也不错.

-ʹSubversionԴ +使用Subversion源的劣势

-עʹSubversionebuildsͨnӵPortage -(дpackage.mask), ɻʹCVSebuildsһ(μ +注意使用Subversion的ebuilds通常n不被添加到Portage树 +(除非是写在package.mask), 理由基本和使用CVS的ebuilds一样(参见 ). -ʵ,ʹCVSebuildsȣǸʹSubversionebuilds, Ϊ -SubversionĽͬCVS5. +事实上,与使用CVS的ebuilds相比,我们更不建议使用Subversion的ebuilds, 因为 +软件包的Subversion检出的结果基本上是相同软件包CVS检出结果的5被.

-ͨյķʽʹCVSʵҲȫ. ,´gentoo-syntax: +可以通过创建快照的方式使用CVS,事实上这样也会更安全. 例如,可以如下创建gentoo-syntax快照:

@@ -36,56 +36,56 @@ $ svn export svn://svn.berlios.de/svnroot/repos/gentoo-syntax -r HEAD gentoo-syn
 
-ʹSubversionԴ +使用Subversion源

-inherit̳subversion.eclass>ʹSVN, -Ҫصı.ҪESVN_REPO_URI. -µıҲӦֵע: +必须先在inherit区声明继承subversion.eclass>后才能使用SVN, +并需要设置相关的变量.至少至少要设置ESVN_REPO_URI变量. +以下的变量也应值得注意:

- - - + + + ESVN_REPO_URI - ַ·(http, https, svn) + 服务器地址及路径(http, https, svn)"svn://svn.example.com/foobar/trunk"ESVN_STORE_DIR - ѹ· + 欲解压的路径ESVN_STORE_DIR="${DISTDIR}/svn-src"ESVN_PROJECT - ebuildĿ + ebuild项目名称ESVN_PROJECT="${PN/-svn}"ESVN_BOOTSTRAP - ű + 引导命令脚本ESVN_BOOTSTRAP="autogen.sh"ESVN_PATCHES - ڼҪIJ + 引导期间要打的补丁ESVN_PATCHES="${FILESDIR}/*.patch"
ʵ变量名意义实例

-֪ϸѡοsubversion.eclassļ. -Ҫִļ,ɵcvs_src_unpack, subversion_svn_fetchsubversion_bootstrap. +欲知更详细的选项,请参考本subversion.eclass文件. +想要执行真正的检出,可调用cvs_src_unpack函数, 它将调用subversion_svn_fetchsubversion_bootstrap.

-ٶһ,ǻlitu-svn-20040902.ebuildйصSubversionѡ; -󲿷ֵSubversion ebuildsԲʽ: +再多举一列,是基于litu-svn-20040902.ebuild有关的Subversion选项的例子; +大部分的Subversion ebuilds都可以采用以下形式:

From ac4f0865bd5e143273ade543fa2748c3ca19fcee Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Sun, 10 Mar 2013 01:00:21 +0800 Subject: [PATCH 29/54] Update text.xml --- ebuild-writing/functions/src_unpack/cvs-sources/text.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ebuild-writing/functions/src_unpack/cvs-sources/text.xml b/ebuild-writing/functions/src_unpack/cvs-sources/text.xml index 7d63e9a..89c743f 100644 --- a/ebuild-writing/functions/src_unpack/cvs-sources/text.xml +++ b/ebuild-writing/functions/src_unpack/cvs-sources/text.xml @@ -166,7 +166,7 @@ ECVS_USER="anoncvs" ECVS_PASS="" ECVS_CVS_OPTIONS="-dP" -# ...and so on. No src_unpack() is specified. +# ...等等. No src_unpack() is specified. From d4e0e3309b2315811a2cda5ce45fb9ffcc92e38f Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Sun, 10 Mar 2013 01:01:52 +0800 Subject: [PATCH 30/54] Update text.xml --- ebuild-writing/functions/src_unpack/svn-sources/text.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ebuild-writing/functions/src_unpack/svn-sources/text.xml b/ebuild-writing/functions/src_unpack/svn-sources/text.xml index a6d9bdf..91e2cbc 100644 --- a/ebuild-writing/functions/src_unpack/svn-sources/text.xml +++ b/ebuild-writing/functions/src_unpack/svn-sources/text.xml @@ -40,7 +40,7 @@ $ svn export svn://svn.berlios.de/svnroot/repos/gentoo-syntax -r HEAD gentoo-syn

-必须先在inherit区声明继承subversion.eclass>后才能使用SVN, +必须先在inherit区,声明继承subversion.eclass>后才能使用SVN, 并需要设置相关的变量.至少至少要设置ESVN_REPO_URI变量. 以下的变量也应值得注意:

From 3b808fc03b50774fbac938f8f1ec28e5085ced46 Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Sun, 10 Mar 2013 08:55:55 +0800 Subject: [PATCH 31/54] src_prepare --- ebuild-writing/functions/src_prepare/text.xml | 125 +++++++++--------- 1 file changed, 62 insertions(+), 63 deletions(-) diff --git a/ebuild-writing/functions/src_prepare/text.xml b/ebuild-writing/functions/src_prepare/text.xml index 29b1588..e765261 100644 --- a/ebuild-writing/functions/src_prepare/text.xml +++ b/ebuild-writing/functions/src_prepare/text.xml @@ -1,63 +1,62 @@ - - - -src_prepare - - - - - - src_prepare - - - - Prepare source packages and do any necessary patching or fixes. - - - - Enabled - - - - user - - - - ebuild - -
Function
Purpose
Sandbox
Privilege
Called for
- - -
-Default <c>src_prepare</c> - -

-Starting from EAPI="2", the src_prepare function is the appropriate area to perform -any kind of patching and source code manipulation, instead of src_unpack. -

- -src_prepare() { - true; -} - - -
- -
-Sample <c>src_prepare</c> - - -src_prepare() { - epatch "${FILESDIR}/${PV}/${P}-fix-bogosity.patch" - use pam && epatch "${FILESDIR}/${PV}/${P}-pam.patch" - - sed -i -e 's/"ispell"/"aspell"/' src/defaults.h || die "Sed failed!" -} - - -
- -
- - -
+ + + +src_prepare函数 + + + + + + src_prepare + + + + 准备源码包并做必要的修改或补丁. + + + + 开启 + + + + user + + + + ebuild + +
函数名
意义
Sandbox
所需权限
被谁调用
+ + +
+默认的<c>src_prepare</c> + +

+自EAPI="2"开始,在src_prepare函数区域内执行任何补丁操作及源码的修改工作,在这方面它基本上替代了src_unpack. +

+ +src_prepare() { + true; +} + + +
+ +
+实例<c>src_prepare</c> + + +src_prepare() { + epatch "${FILESDIR}/${PV}/${P}-fix-bogosity.patch" + use pam && epatch "${FILESDIR}/${PV}/${P}-pam.patch" + + sed -i -e 's/"ispell"/"aspell"/' src/defaults.h || die "Sed failed!" +} + + +
+ +
+ + +
From ddfcf6a164acbc1a69931d2134488f1da12e8e93 Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Sun, 10 Mar 2013 13:25:09 +0800 Subject: [PATCH 32/54] src_prepare --- .../src_prepare/autopackage/text.xml | 80 +++-- .../functions/src_prepare/epatch/text.xml | 301 +++++++++--------- 2 files changed, 184 insertions(+), 197 deletions(-) diff --git a/ebuild-writing/functions/src_prepare/autopackage/text.xml b/ebuild-writing/functions/src_prepare/autopackage/text.xml index 56c6b47..a948f4c 100644 --- a/ebuild-writing/functions/src_prepare/autopackage/text.xml +++ b/ebuild-writing/functions/src_prepare/autopackage/text.xml @@ -1,42 +1,38 @@ - - - -Autopackage - - -

-If a package is only supplied in autopackage format, you must not add -it to the tree. If a package is supplied in autopackage format and -some other sane standard format (for example a source tarball), use -the other format only. -

- -

-Autopackage packages are totally unsuitable for Gentoo systems for a -large number of reasons: -

- -
    -
  • - To even unpack the package, you must run arbitrary code supplied by an untrusted source. -
  • -
  • They install directly to the live filesystem.
  • -
  • Their intrinsic dependency resolver is broken.
  • -
  • They do not support the filesystem layout used by Gentoo.
  • -
  • They do not support configuration protection.
  • -
  • They can clobber arbitrary files on uninstall.
  • -
  • The linking mechanism used is insufficiently flexible.
  • -
  • - The entire format is completely unportable and highly tied to x86 - Linux systems. -
  • -
- -

-Upstream are aware of these issues and have no desire to fix them -indeed, they pass off some of their most broken behaviour as -'features'. -

- -
-
+ + + +Autopackage包 + + +

+如果一个软件包只有autopackage格式的,更不应将这种软件包加入Portage树中.若能提供autopackage格式的软件包和其他的健全的标准格式 +(例如源码包),请用标准的格式. +

+ +

+Autopackage软件包完全不适应于Gentoo系统,以下是其中的一些原因: +

+ +
    +
  • + 即使是解压这种文件,你都必须使用有它提供的二进制代码工具,而你却不能确定软件包是否可信. +
  • +
  • 直接就安装到了现行的系统,不安全.
  • +
  • 内部固有的依赖解析器是坏掉的.
  • +
  • 不能支持Gentoo现有的文件系统层.
  • +
  • 不支持配置文件保护.
  • +
  • 卸载时可能毁坏二进制文件.
  • +
  • 链接机制不够灵活高效.
  • +
  • + 此种文件格式完全的不可分离,高度绑定在x86 + Linux系统上. +
  • +
+ +

+上游的相关人员知道这些问题,但无意去修整此类问题 +事实上,他们不以之为'耻',反以为'荣'. +

+ +
+
diff --git a/ebuild-writing/functions/src_prepare/epatch/text.xml b/ebuild-writing/functions/src_prepare/epatch/text.xml index a88ecaf..ba860d8 100644 --- a/ebuild-writing/functions/src_prepare/epatch/text.xml +++ b/ebuild-writing/functions/src_prepare/epatch/text.xml @@ -1,155 +1,146 @@ - - - -Patching with epatch - - -

-The canonical way of applying patches in ebuilds is to -use epatch (from eutils.eclass, which you must make sure -to import!) inside src_prepare. This function automatically -handles -p levels, gunzip and so on as necessary. Also note that olds ebuild may still use src_unpack to apply patches. This is because those ebuilds are based in EAPI="1". You are advised to use EAPI="2" and apply your patches in src_prepare function instead. -

- -

-Note that distributing modified tarballs rather than a vanilla tarball -and patches is highly discouraged. -

- - -
-Basic <c>epatch</c> - - -

-In its simplest form, epatch takes a single filename and -applies that patch. It will automatically die if the apply -fails. The following is taken from app-misc/detox: -

- - -src_unpack() { - unpack ${A} - cd "${S}" - epatch "${FILESDIR}/${P}-destdir.patch" - epatch "${FILESDIR}/${P}-parallel_build.patch" -} - - -

-For larger patches, using mirror://gentoo/ rather -than files/ is more appropriate. In these situations, it is -usually best to bzip2 the patch in question (as opposed to -files/ patches, which must not be compressed). For example, -from app-admin/showconsole: -

- - -src_unpack() { - unpack ${A} - cd "${S}" - epatch "${WORKDIR}/${P}-suse-update.patch.bz2" - epatch "${FILESDIR}/${PV}-no-TIOCGDEV.patch" -} - -

As stated before, if you are using EAPI >=2, you should apply the patches in the src_prepare function

- -src_prepare() { - epatch "${WORKDIR}/${P}-suse-update.patch.bz2" - epatch "${FILESDIR}/${PV}-no-TIOCGDEV.patch" -} - - -

-Remember to add the patch to SRC_URI. -

- - - -CVS Keyword Lines and Patches - -

-If your patch includes any changes to CVS $Id: $ -(or $Header: $, or $Date: $) lines, it cannot be -distributed under files/, since CVS will clobber the patch when -you commit. In these situations, either remove this hunk of the patch -manually, or mirror the file. -

- -
- -
- -
-Multiple Patches with <c>epatch</c> - - -

-epatch can also apply multiple patches (which can be selectively based -upon arch) from a single directory. This can be useful if upstream -have releases that need more patches. -

- -

-A simple example: -

- - -src_unpack() { - unpack ${A} - cd "${S}" - EPATCH_SOURCE="${WORKDIR}/patches" EPATCH_SUFFIX="patch" \ - EPATCH_FORCE="yes" epatch -} - - -

-Here, one of the SRC_URI components is a tarball containing -many patches with file extension .patch. -

- -

-Variables which may be defined include: -

- - - - - - - - EPATCH_SOURCE - Specifies the directory in which epatch looks for patches. - - - EPATCH_SUFFIX - File extension for patches. - - - EPATCH_OPTS - Default options to patch. - - - EPATCH_EXCLUDE - List of patches to exclude. - - - EPATCH_FORCE - - Force epatch to apply patches even if they do not follow the - canonical naming form (set to yes). - - -
VariablePurpose
- -

-Bulk patches should be named in the form -??_${ARCH}_foo.${EPATCH_SUFFIX}. If they are -not, EPATCH_FORCE="yes" must be set. To apply a patch on all -archs, use all for the ${ARCH} part. -

- - -
-
-
+ + + +使用epatch打补丁 + + +

+最常用的给软件打补丁用方法 +在src_prepare区域中使用epatch(必须在inhert声明中添加eutils.eclass,这点很重要). 该函数会在必要时自动添加-p处理补丁文件,及gunzip等常见压缩包格式的修补文件. +也请注意在旧的ebuilds文件中可能仍然在用src_unpack函数处理补丁. +这是因为那些ebuilds文档是基于EAPI="1"的. +建议在您将来的编写ebuilds文件是使用EAPI>="2"并且使用src_prepare函数处理相关补丁和修补. +

+ +

+注意非常建议您在撰写采用最原始的归档文件+相应的各个补丁文件,而不是使用默认发型版本+后续的补丁文件. +

+ + +
+<c>epatch</c>的基本应用 + + +

+在最简单的应用形式中,在epatch后可以直接跟单个的文件名或 +补丁文件.如果在打补丁的过程中出错它将调用die. +下例摘自app-misc/detox: +

+ + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}/${P}-destdir.patch" + epatch "${FILESDIR}/${P}-parallel_build.patch" +} + + +

+对于较大型的补丁文件,使用mirror://gentoo/比只用 +files/显得更合适.这时补丁的格式通常用bzip2压缩格式(相反 +files/中的补丁,是不支持压缩格式的).见下例app-admin/showconsole: +

+ + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${WORKDIR}/${P}-suse-update.patch.bz2" + epatch "${FILESDIR}/${PV}-no-TIOCGDEV.patch" +} + +

如之前所言,如果您采用的EAPI规约>=2,使用src_prepare函数替代

+ +src_prepare() { + epatch "${WORKDIR}/${P}-suse-update.patch.bz2" + epatch "${FILESDIR}/${PV}-no-TIOCGDEV.patch" +} + + +

+谨记在SRC_URI地址中添加补丁文件的路径. +

+ + + +CVS关键行中的补丁修改 + +

+如果您的补丁文件里任何CVS$Id: $ +(或$Header: $,或$Date: $)行中有变化,它不能配置在files/中, +因为您一旦提交,CVS将破坏掉. +在这样的情况下,要么手动删除掉该补丁,要么重新镜像这个文件. +

+ +
+ +
+ +
+使用<c>epatch</c>添加多有补丁 + + +

+epatch函数也能在一个目录中应用个补丁(也能基于不同构架选择不同补丁).这在上游软件发布多个补丁时能用的着. +

+ +

+例如: +

+ + +src_unpack() { + unpack ${A} + cd "${S}" + EPATCH_SOURCE="${WORKDIR}/patches" EPATCH_SUFFIX="patch" \ + EPATCH_FORCE="yes" epatch +} + + +

+在这个例子中,SRC_URI的元素是一个归档文件,它是一系列以.patch为后缀明的补丁文件. +

+ +

+定义的变量如下: +

+ + + + + + + + EPATCH_SOURCE + 供epatch搜索补丁的具体的文件夹. + + + EPATCH_SUFFIX + 补丁文件的扩展名. + + + EPATCH_OPTS + patch的默认选项. + + + EPATCH_EXCLUDE + 除外的不定的列表. + + + EPATCH_FORCE + + 强制epatch应用补丁即使是与常规的补丁名称格式不符(设成yes). + + +
变量名意义
+ +

+大部分的补丁文件应该采用 +如??_${ARCH}_foo.${EPATCH_SUFFIX}这样的形式命名.如果名称不符合时,必须要设置EPATCH_FORCE="yes".为所有的构架应用补丁时,注意设置${ARCH}部分. +

+ + +
+
+
From b896112ef0ddc568be1b98eba02d12212374f1ec Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Sun, 10 Mar 2013 17:17:14 +0800 Subject: [PATCH 33/54] src_configure --- .../functions/src_configure/text.xml | 167 +++++++++--------- 1 file changed, 83 insertions(+), 84 deletions(-) diff --git a/ebuild-writing/functions/src_configure/text.xml b/ebuild-writing/functions/src_configure/text.xml index 9eeedd6..09bab2d 100644 --- a/ebuild-writing/functions/src_configure/text.xml +++ b/ebuild-writing/functions/src_configure/text.xml @@ -1,84 +1,83 @@ - - - -src_configure - - - - - - src_configure - - - - Configure the package. - - - - Enabled - - - - user - - - - ebuild - - - - 2 - -
Function
Purpose
Sandbox
Privilege
Called for
EAPI
- - -
-Default <c>src_configure</c> - - -src_configure() { - if [[ -x ${ECONF_SOURCE:-.}/configure ]] ; then - econf - fi -} - - -
- -
-Sample <c>src_configure</c> - - -src_configure() { - use sparc && filter-flags -fomit-frame-pointer - append-ldflags -Wl,-z,now - - econf \ - $(use_enable ssl ) \ - $(use_enable perl perlinterp ) -} - - -
- -
-<c>src_configure</c> Processes - -

-The following subsections cover different topics which often occur when writing -src_configure functions. -

- - - -
- -
- - - -
- + + + +函数src_configure + + + + + + src_configure + + + + 配置软件包. + + + + 开启 + + + + user + + + + ebuild + + + + 2 + +
函数名
意义
Sandbox
所需权限
被谁调用
EAPI规约
+ + +
+默认的<c>src_configure</c> + + +src_configure() { + if [[ -x ${ECONF_SOURCE:-.}/configure ]] ; then + econf + fi +} + + +
+ +
+实例<c>src_configure</c> + + +src_configure() { + use sparc && filter-flags -fomit-frame-pointer + append-ldflags -Wl,-z,now + + econf \ + $(use_enable ssl ) \ + $(use_enable perl perlinterp ) +} + + +
+ +
+<c>src_configure</c> Processes + +

+接下来的小节将讲述使用src_configure函数时可能遇到的问题. +

+ + + +
+ +
+ + + +
+ From 3a31ec505e43d334873a833ddc33abdd0dc7ca58 Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Sun, 10 Mar 2013 19:25:31 +0800 Subject: [PATCH 34/54] src_configure --- .../src_configure/configuring/text.xml | 143 ++++++++---------- 1 file changed, 65 insertions(+), 78 deletions(-) diff --git a/ebuild-writing/functions/src_configure/configuring/text.xml b/ebuild-writing/functions/src_configure/configuring/text.xml index 677334e..71ade5a 100644 --- a/ebuild-writing/functions/src_configure/configuring/text.xml +++ b/ebuild-writing/functions/src_configure/configuring/text.xml @@ -1,78 +1,65 @@ - - - -Configuring a Package - - -

-Many packages come with an autoconf-generated ./configure -script for checking the build environment and configuring optional -support for libraries. The econf function should be used where -possible this will provide correct build and path specifications for -a Gentoo environment. -

- -

-Often the configure script will try to automatically enable support -for optional components based upon installed packages. This -must not be allowed to happen. For example, if a user has Perl -installed but has USE="-perl", packages with optional -Perl support must not link against Perl. This automatic detection can -usually be overridden using --enable- and --disable -or --with- and --without- switches (but note that these -don't always work make sure these are tested properly!). -

- -

-The use_enable and use_with utility functions should, -where appropriate, be used to generate these switches. -

- - -src_configure() { - # We have optional perl, python and ruby support - econf \ - $(use_enable perl ) \ - $(use_enable python ) \ - $(use_enable ruby ) -} - -src_configure() { - # Our package optional IPv6 support which uses --with rather than - # --enable / --disable - - econf $(use_with ipv6 ) -} - - -

-Sometimes the package's choice of name for the option will not exactly -match the name or case of the USE flag. This is very often the -case with the X flag. For these situations, there are two -argument forms: -

- - -src_configure() { - # Our package has optional perl, python and ruby support - econf \ - $(use_enable perl perlinterp ) \ - $(use_enable python pythoninterp ) \ - $(use_enable ruby rubyinterp ) - - # ... -} - -src_compile() { - econf $(use_with X x11 ) -} - - -

-To check for an unset USE flag, the use_enable !flag -form can be used. -

- - -
-
+ + + +配置软件包 + + +

+很多软件包都是通过执行./configure脚本自动配置检测构建环境,可选的功能库支持. +Gentoo中econf函数也用异曲同工之妙Gentoo环境中它也能提供给软件正确的构建环境和自定义选项. +

+ +

+通常配置脚本将试图根据已经安装的软件自行开启某个可选功能的相关支持.这 +是不能允许发生的.例如,如果用户安装了Perl但是默认USE标识为设置USE="-perl", +那些拥有Perl可选项的软件包不应该链接到Perl.这些自动检测的结果会被--enable---disable--with---without-开关重写(但请注意他们也许不能总能如您所愿请保证他们能正常测试!). +

+ +

+use_enableuse_with这些实用函数是用来开关软件包相关功能的,应当合理利用. +

+ + +src_configure() { + # We have optional perl, python and ruby support + econf \ + $(use_enable perl ) \ + $(use_enable python ) \ + $(use_enable ruby ) +} + +src_configure() { + # Our package optional IPv6 support which uses --with rather than + # --enable / --disable + + econf $(use_with ipv6 ) +} + + +

+有时候软件包可选功能的名称与USE标示的名称会有出入.这就是X标示最常见应用的情景.此时,两种方式可供选择: +

+ + +src_configure() { + # Our package has optional perl, python and ruby support + econf \ + $(use_enable perl perlinterp ) \ + $(use_enable python pythoninterp ) \ + $(use_enable ruby rubyinterp ) + + # ... +} + +src_compile() { + econf $(use_with X x11 ) +} + + +

+如想要摒弃某项USE标示,可以采用use_enable !flag这样的形式. +

+ + +
+
From 975b4803c600a7e0f5b84e0cd0dffcea1f370962 Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Sun, 10 Mar 2013 20:19:19 +0800 Subject: [PATCH 35/54] src_compile --- ebuild-writing/functions/src_compile/text.xml | 237 +++++++++--------- 1 file changed, 118 insertions(+), 119 deletions(-) diff --git a/ebuild-writing/functions/src_compile/text.xml b/ebuild-writing/functions/src_compile/text.xml index 0c86ba8..c9193cc 100644 --- a/ebuild-writing/functions/src_compile/text.xml +++ b/ebuild-writing/functions/src_compile/text.xml @@ -1,119 +1,118 @@ - - - -src_compile - - - - - - src_compile - - - - Configure and build the package.the configure parts of src_compile have been splitted out in EAPI=2 to src_configure. see - - - - Enabled - - - - user - - - - ebuild - -
Function
Purpose
Sandbox
Privilege
Called for
- - -
-Default <c>src_compile</c> - - -with EAPI=0,1 - - -src_compile() { - if [ -x ./configure ]; then - econf - fi - if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then - emake || die "emake failed" - fi -} - - - - -with EAPI=2 - - -src_compile() { - if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then - emake || die "emake failed" - fi -} - - - - -
- -
-Sample <c>src_compile</c> - - -with EAPI=0 - - -src_compile() { - use sparc && filter-flags -fomit-frame-pointer - append-ldflags -Wl,-z,now - - econf \ - $(use_enable ssl ) \ - $(use_enable perl perlinterp ) - - emake || die "Make failed!" -} - - -You also need to inherit the flag-o-matic eclass in order to use the append-ldflags function. - - - - -with EAPI=2 - -

-porting the above example to EAPI=2, you won't need to define an extra -src_compile, as it only calls emake (which is the default -src_compile function). -

- -
- -
- -
-<c>src_compile</c> Processes - -

-The following subsections cover different topics which often occur when writing -src_compile functions. -

- - - -
- -
- - - - - - -
+ + + +函数src_compile + + + + + + src_compile + + + + (配置)编译函数.函数src_compile中的配置部分功能在EAPI=2的规约中已经分离给函数src_configure.详见 + + + + 开启 + + + + user + + + + ebuild + +
函数名称
意义
Sandbox
所需权限
被谁调用
+ + +
+默认<c>src_compile</c> + + +配合EAPI=0,1 + + +src_compile() { + if [ -x ./configure ]; then + econf + fi + if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then + emake || die "emake failed" + fi +} + + + + +配合EAPI=2 + + +src_compile() { + if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then + emake || die "emake failed" + fi +} + + + + +
+ +
+实例<c>src_compile</c> + + +配合EAPI=0 + + +src_compile() { + use sparc && filter-flags -fomit-frame-pointer + append-ldflags -Wl,-z,now + + econf \ + $(use_enable ssl ) \ + $(use_enable perl perlinterp ) + + emake || die "Make failed!" +} + + +您也需要声明inherit该flag-o-matic eclass,为了使用append-ldflags函数. + + + + +配合EAPI=2 + +

+将上例换在EAPI=2规约中,将不需要再定义额外的 +src_compile,因为它只调用emake (它是 +src_compile函数中默认的). +

+ +
+ +
+ +
+<c>src_compile</c>进程 + +

+接下来的小节将讲述使用src_compile函数时可能遇到的问题. +

+ + + +
+ +
+ + + + + + +
From cb1bd2851141da8760f21edcdb12dee1d6d62d5b Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Sun, 10 Mar 2013 22:49:38 +0800 Subject: [PATCH 36/54] src_compile --- .../src_compile/build-environment/text.xml | 2 +- .../functions/src_compile/building/text.xml | 151 ++++++++---------- .../src_compile/no-build-system/text.xml | 119 +++++++------- 3 files changed, 128 insertions(+), 144 deletions(-) diff --git a/ebuild-writing/functions/src_compile/build-environment/text.xml b/ebuild-writing/functions/src_compile/build-environment/text.xml index ff385f0..e0cc445 100644 --- a/ebuild-writing/functions/src_compile/build-environment/text.xml +++ b/ebuild-writing/functions/src_compile/build-environment/text.xml @@ -1,7 +1,7 @@ -Configuring Build Environment +ñ뻷

diff --git a/ebuild-writing/functions/src_compile/building/text.xml b/ebuild-writing/functions/src_compile/building/text.xml index 700f0f1..8d41793 100644 --- a/ebuild-writing/functions/src_compile/building/text.xml +++ b/ebuild-writing/functions/src_compile/building/text.xml @@ -1,82 +1,69 @@ - - - -Building a Package - - -

-The emake function should be used to call make. This will ensure that -the user's MAKEOPTS are used correctly. The emake function passes on -any arguments provided, so it can be used to make non-default targets (emake -extras), for example. Occasionally you might encounter a screwy non-autotools -Makefile that explodes with emake, but this is rare. -

- -

-Builds should be tested with various -j settings in MAKEOPTS to ensure -that the build parallelises properly. If a package does not parallelise -cleanly, it should be patched. -

- -

-If patching really isn't an option, emake -j1 should be -used. However, when doing this please remember that you are seriously -hurting build times for many non-x86 users in particular. Forcing -a -j1 can increase build times from a few minutes to an hour on -some MIPS and SPARC systems. -

- - -
-Fixing Compiler Usage - - -

-Sometimes a package will try to use a bizarre compiler, or will need to be told -which compiler to use. In these situations, the tc-getCC() function from -toolchain-funcs.eclass should be used. Other similar functions are available - these are documented in man toolchain-funcs.eclass. -

- - -It is not correct to use the ${CC} variable for this purpose. - - -

-Sometimes a package will not use the user's ${CFLAGS} or ${LDFLAGS}. -This must be worked around, as sometimes these variables are used for specifying -critical ABI options. In these cases, the build scripts should be modified (for -example, with sed) to use ${CFLAGS} or ${LDFLAGS} correctly. -

- - -inherit flag-o-matic toolchain-funcs - -src_compile() { - # -Os not happy - replace-flags -Os -O2 - - # We have a weird build.sh to work with which ignores our - # compiler preferences. yay! - sed -i -e "s:cc -O2:$(tc-getCC) ${CFLAGS} ${LDFLAGS}:" build.sh \ - || die "sed fix failed. Uh-oh..." - ./build.sh || die "Build failed!" -} - - - -When using sed with CFLAGS or LDFLAGS, it is not safe to use -a comma or a slash as a delimiter. The recommended character is a colon. - - -

-Portage performs a QA check which verifies if LDFLAGS are respected. This QA check -is enabled only when LDFLAGS variable contains -Wl,--hash-style=gnu. -(This flag can be used only on systems which use sys-libs/glibc except for -machines with a MIPS CPU.) -

- - -
-
-
+ + + +编译软件包 + + +

+emake函数用来调用系统中的make命令.当然用户正确设置MAKEOPTS很重要.该emake 函数将传递任意后续提供的参数,所以可以用来产生非默认的目标文件(emake +extras),例如.偶尔您可能遇到让人纠结的非自动处理(non-autotools)的 +Makefile文件,让emake也一筹莫展,但这种情况应该很少见. +

+ +

+在编译时适当的在MAKEOPTS(make.conf文件中)设置-j并发进程数,这样可以保证多个进程编译.如果软件包不支持并行,应当给他打补丁. +

+ +

+如果确定不能够打这样的补丁,默认启用emake -j1. +然而这样做,特别是对于在很多非-x86的用户来说,编译软件可能真是会要命的强制在-j1的情况下,在MIPS和SPARC系统上编译时间可能增加几分钟到一个小时也说不定. +

+ + +
+微调编译选项 + + +

+有时软件包会用奇怪的编译器,或者需要用户指定一个需求的编译器.在这种情况下,应该使用toolchain-funcs.eclass 中的tc-getCC()函数.还有其他类似的函数可以用 +更详细的内容可以man toolchain-funcs.eclass这样了解. +

+ + +这个时候就不应该使用${CC}变量了. + + +

+有时软件包不遵循用户定义的${CFLAGS}${LDFLAGS}. +这样的问题必须提前妥善处理,因为有时这些变量会被特定关键的ABI选项使用. +这时编译的scripts应该适当修改(例如,使用sed)以便正确使用${CFLAGS}${LDFLAGS}. +

+ + +inherit flag-o-matic toolchain-funcs + +src_compile() { + # -Os not happy + replace-flags -Os -O2 + + # We have a weird build.sh to work with which ignores our + # compiler preferences. yay! + sed -i -e "s:cc -O2:$(tc-getCC) ${CFLAGS} ${LDFLAGS}:" build.sh \ + || die "sed fix failed. Uh-oh..." + ./build.sh || die "Build failed!" +} + + + +当使用sed处理CFLAGSLDFLAGS时,使用都好或斜线作为分隔符.推荐使用冒号. + + +

+Portage将执行QA检测,通过它来确认LDFLAGS是否.也只有当 LDFLAGS变量中包含-Wl,--hash-style=gnu 时,QA检测才会执行. +(这个标示只能用在使用sys-libs/glibc的系统上,MIPS的CPU也除外.) +

+ + +
+
+
diff --git a/ebuild-writing/functions/src_compile/no-build-system/text.xml b/ebuild-writing/functions/src_compile/no-build-system/text.xml index 99b873a..6dd0006 100644 --- a/ebuild-writing/functions/src_compile/no-build-system/text.xml +++ b/ebuild-writing/functions/src_compile/no-build-system/text.xml @@ -1,61 +1,58 @@ - - - -No Build System - - -

-Occasionally some really small packages are shipped simply as a single -.c file. In these circumstances, you can either write your own -Makefile and ship it with the source tarball, or just manually -compile the thing from within the ebuild, preferebly explaining why. -Here's an example, from app-misc/hilite: -

- - -src_compile() { - $(tc-getCC) ${LDFLAGS} ${CFLAGS} -o ${PN} ${P}.c || die -} - - -

-Here's an example from x11-plugins/asclock, which ships with a -broken build system that doesn't actually work: -

- - -src_compile() { - local x - for x in asclock parser symbols config - do - $(tc-getCC) \ - ${CPPFLAGS} ${CFLAGS} ${ASFLAGS} \ - -I/usr/include \ - -Dlinux \ - -D_POSIX_C_SOURCE=199309L \ - -D_POSIX_SOURCE \ - -D_XOPEN_SOURCE \ - -D_BSD_SOURCE \ - -D_SVID_SOURCE \ - -DFUNCPROTO=15 \ - -DNARROWPROTO \ - -c -o ${x}.o ${x}.c || die "compile asclock failed" - done - $(tc-getCC) \ - ${LDFLAGS} \ - -o asclock \ - asclock.o parser.o symbols.o config.o \ - -L/usr/lib \ - -L/usr/lib/X11 \ - -lXpm -lXext -lX11 || die "link asclock failed" -} - - -

-A possibly better alternative would be to patch the build system -and send it upstream. -

- - -
-
+ + + +不用构建也行 + + +

+偶尔会有一些非常小的软件包,也许只是有单个的.c后缀的文件. +这时候就没有必要大费周章了, +源文件旁附带一个Makefile足矣,当然也可以用ebuild,述说简短. +见实例app-misc/hilite: +

+ + +src_compile() { + $(tc-getCC) ${LDFLAGS} ${CFLAGS} -o ${PN} ${P}.c || die +} + + +

+再附一例,基于x11-plugins/asclock,这里面build系统实际上是不工作的,哈哈: +

+ + +src_compile() { + local x + for x in asclock parser symbols config + do + $(tc-getCC) \ + ${CPPFLAGS} ${CFLAGS} ${ASFLAGS} \ + -I/usr/include \ + -Dlinux \ + -D_POSIX_C_SOURCE=199309L \ + -D_POSIX_SOURCE \ + -D_XOPEN_SOURCE \ + -D_BSD_SOURCE \ + -D_SVID_SOURCE \ + -DFUNCPROTO=15 \ + -DNARROWPROTO \ + -c -o ${x}.o ${x}.c || die "compile asclock failed" + done + $(tc-getCC) \ + ${LDFLAGS} \ + -o asclock \ + asclock.o parser.o symbols.o config.o \ + -L/usr/lib \ + -L/usr/lib/X11 \ + -lXpm -lXext -lX11 || die "link asclock failed" +} + + +

+当然你要是没事想写上一个补丁(是它含有build系统)通知一下上游的维护者也可以. +

+ + +
+
From a978a93a042159b3f6a8d301f598924487d22702 Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Sun, 10 Mar 2013 22:55:04 +0800 Subject: [PATCH 37/54] src_compile --- ebuild-writing/functions/src_compile/build-environment/text.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ebuild-writing/functions/src_compile/build-environment/text.xml b/ebuild-writing/functions/src_compile/build-environment/text.xml index e0cc445..4f027df 100644 --- a/ebuild-writing/functions/src_compile/build-environment/text.xml +++ b/ebuild-writing/functions/src_compile/build-environment/text.xml @@ -1,7 +1,7 @@ -ñ뻷 +配置编译环境

From 090ebefb9d44914939cd1b45112fc0e6b479b67c Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Mon, 11 Mar 2013 00:43:54 +0800 Subject: [PATCH 38/54] src_compile --- .../src_compile/build-environment/text.xml | 277 ++++++++---------- 1 file changed, 127 insertions(+), 150 deletions(-) diff --git a/ebuild-writing/functions/src_compile/build-environment/text.xml b/ebuild-writing/functions/src_compile/build-environment/text.xml index 4f027df..bceb9c7 100644 --- a/ebuild-writing/functions/src_compile/build-environment/text.xml +++ b/ebuild-writing/functions/src_compile/build-environment/text.xml @@ -1,150 +1,127 @@ - - - -配置编译环境 - - -

-Sometimes it is necessary to manipulate certain aspects of the user's -build environment before running ./configure. The flag-o-matic -eclass is the best choice for manipulating CFLAGS, LDFLAGS -and suchlike. -

- - -Except where otherwise specified, any function which operates on -CFLAGS also operates on CXXFLAGS. - - -

-Ebuilds must not simply ignore user CFLAGS, CXXFLAGS or LDFLAGS see -. -

- - -
-Guidelines for Flag Filtering - - -

-If a package breaks with any reasonable CFLAGS, it is best to filter the -problematic flag if a bug report is received. Reasonable CFLAGS are --march=, -mcpu=, -mtune= (depending upon -arch), -O2, -Os and -fomit-frame-pointer. Note that --Os should usually be replaced with -O2 rather than being -stripped entirely. The -fstack-protector flag should probably be -in this group too, although our hardened team claim that this flag -never ever breaks anything... -

- -

-The -pipe flag doesn't affect the generated code, so it's not really -relevant here, but it's a sensible flag to have set globally. -

- -

-If a package breaks with other (insane) CFLAGS, it is perfectly -OK to close the bug with a WONTFIX suggesting that the user -picks more sensible global CFLAGS. Similarly, if you suspect -that a bug is caused by insane CFLAGS, an INVALID resolution is -suitable. -

- -

-All of the following assumes that the ebuild has an inherit flag-o-matic -line in the correct place. -

- - -
- -
-Simple Flag Stripping - - -

-The filter-flags function can be used to remove a particular flag from -CFLAGS. Multiple arguments can be supplied; each is the name of a flag to -remove. -

- - - # -fomit-frame-pointer leads to nasty broken code on sparc thanks to a - # rather icky asm function - use sparc && filter-flags -fomit-frame-pointer - - -

-There is a filter-ldflags function available which does the equivalent -for LDFLAGS. -

- -

-If a package is known to be very CFLAGS sensitive, the -strip-flags function will remove most flags, leaving only a minimal -conservative set of flags. -

- - - # Our app hates screwy flags - strip-flags - - - -
- -
-Flag Replacement - - -

-To replace a flag with a different one, use replace-flags. This -is most commonly used to replace -Os with -O2 -(or -O3 with -O2 if you are feeling kind). -

- - - # Seems to have issues with -Os, switch to -O2 - replace-flags -Os -O2 - - -

-There is also a special function named replace-cpu-flags for -replacing CPU (-mtune, -mcpu, -march) designation -flags. The last argument is the flag to use; previous arguments are -the flags to be replaced. -

- - - # Can't use ultrasparc or ultrasparc3 code, drop to v9 - replace-cpu-flags ultrasparc ultrasparc3 v9 - - - -
- -
-Adding Additional Flags - -

-Sometimes it is necessary to add in additional CFLAGS -or LDFLAGS. The append-flags and append-ldflags -functions can be used here. -

- - - # If we're using selinux, we need to add a -D - use selinux && append-flags "-DWITH_SELINUX" - - # Secure linking needed, since we're setuid root - append-ldflags -Wl,-z,now - - -

-See for a full reference. -

- -
- -
-
+ + + +配置编译环境 + + +

+有时需要在运行./configure之前,对用户编译环境中的某个方面更改. flag-o-matic +eclass这货是修改CFLAGS, LDFLAGS等等的不二之选. +

+ + +除非特别的指明,一般情况下能使用 +CFLAGS应该也能使用CXXFLAGS. + + +

+Ebuilds必须不能简单的忽略用户设定的CFLAGS, CXXFLAGS或LDFLAGS详见 +. +

+ + +
+标示过滤的简介 + + +

+如果软件包与任何合理的CFLAGS有冲突, 如果接受到bug报告,最好过滤出有问题的标示. 合理的CFLAGS-march=, -mcpu=, -mtune= (依赖于系统构架), -O2, -Os-fomit-frame-pointer. 注意最好使用-O2替代-Os,而不是完全启用-Os. 这个-fstack-protector标示应该也是这样的,尽管我们的团队中的强硬派声称这个标识不会引起冲突... +

+ +

+-pipe标示不会影响已经编译好的代码,所以在此它的关系并不大,但把它搞成全局设置不失为明智之举. +

+ +

+如果一个软件包与与其他(某个疯狂的)CFLAGS冲突,完全可以用标记WONTFIX的bug报告,并建议用户使用更多比较理性的全局CFLAGS.同样,如果你怀疑是某个较疯狂CFLAGS导致的bug,使用INVALID来解决问题也是可以的. +

+ +

+以下例子均假定在ebuild文档中inherit flag-o-matic已经合适的位置声明. +

+ + +
+ +
+简单标示剖析 + + +

+filter-flags函数用来从CFLAGS去除某个特定标示 +.其后可以添加多个参数;每一个都是一个要被去除的标示. +

+ + + # -fomit-frame-pointer leads to nasty broken code on sparc thanks to a + # rather icky asm function + use sparc && filter-flags -fomit-frame-pointer + + +

+filter-ldflags基本等同于LDFLAGS. +

+ +

+如果软件对CFLAGS设置很敏感,strip-flags函数将会略去大部分的flags, 仅留下最少的最保守的flags. +

+ + + # Our app hates screwy flags + strip-flags + + + +
+ +
+标示替换 + + +

+替换标示可使用replace-flags.最常用的就是使用-O2替换-Os +(或替换-O3如果您喜欢的话). +

+ + + # Seems to have issues with -Os, switch to -O2 + replace-flags -Os -O2 + + +

+也有一个特别的函数叫replace-cpu-flags,它能替换CPU (-mtune, -mcpu, -march)的标示.函数的最后一个参数代表要使用的flag;在它之前的前的参数代表要替代的. +

+ + + # Can't use ultrasparc or ultrasparc3 code, drop to v9 + replace-cpu-flags ultrasparc ultrasparc3 v9 + + + +
+ +
+添加额外的标示 + +

+有事需要添加额外的CFLAGS +或LDFLAGS.可以通过append-flagsappend-ldflags +函数实现. +

+ + + # If we're using selinux, we need to add a -D + use selinux && append-flags "-DWITH_SELINUX" + + # Secure linking needed, since we're setuid root + append-ldflags -Wl,-z,now + + +

+详见flag-o-matic.eclass. +

+ +
+ +
+
From 565f5d1a51bcf246613093b89ca90a90d7912b32 Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Mon, 11 Mar 2013 01:30:11 +0800 Subject: [PATCH 39/54] src_install --- ebuild-writing/functions/src_install/text.xml | 424 +++++++++--------- 1 file changed, 208 insertions(+), 216 deletions(-) diff --git a/ebuild-writing/functions/src_install/text.xml b/ebuild-writing/functions/src_install/text.xml index b3f8fc8..c13764e 100644 --- a/ebuild-writing/functions/src_install/text.xml +++ b/ebuild-writing/functions/src_install/text.xml @@ -1,216 +1,208 @@ - - - -src_install - - - - - - src_install - - - - Install a package to ${D} - - - - Enabled - - - - root - - - - ebuild - -
Function
Purpose
Sandbox
Privilege
Called for
- - -
-Default <c>src_install</c> - -

-For EAPI < 4, the default src_install function is the following: -

- -src_install() -{ - return -} - -

-For EAPI ≥ 4, the default src_install function is the following: -

- -src_install() { - if [[ -f Makefile ]] || [[ -f GNUmakefile]] || [[ -f makefile ]] ; then - emake DESTDIR="${D}" install - fi - - if ! declare -p DOCS >/dev/null 2>&1 ; then - local d - for d in README* ChangeLog AUTHORS NEWS TODO CHANGES THANKS BUGS \ - FAQ CREDITS CHANGELOG ; do - [[ -s "${d}" ]] && dodoc "${d}" - done - elif declare -p DOCS | grep -q "^declare -a " ; then - dodoc "${DOCS[@]}" - else - dodoc ${DOCS} - fi -} - - -
- -
-Sample <c>src_install</c> - - -src_install() { - emake DESTDIR="${D}" install || die "Install failed" - dodoc README CHANGES || die -} - - -
- -
-Easy Installs - -

-Often, especially with autotools-powered packages, there is a Makefile -install target which will honour the DESTDIR variable to tell it to -install to a non-root location. If possible, this should be used: -

- - - emake DESTDIR="${D}" install || die "Install failed" - - - -emake should be used to parallelise here. Some installs are -not designed to be parallelised, use emake -j1 or make -if you hit an error. - - -

-Sometimes this will end up installing a few things into strange -places. If and only if this is the case, the einstall function -can be used: -

- - - einstall || die "einstall failed" - - -

-It is usually necessary to include additional dodoc statements for the -README, ChangeLog, etc in these cases. -

- - -There is no need to dodoc COPYING! The license belongs -to ${PORTDIR}/licenses. Sometimes though, you might want to -install COPYING regardless, if it explains how different -licenses are applied to different parts of the application, for -example. - - -
- -
-Trivial Installs - -

-For some packages with no Makefile that only install a small -number of files, writing a manual install using cp is the -easiest option. For example, to do a simple install of some (no -compilation required) themes: -

- - - dodir /usr/share/foo-styles/ - cp -R "${S}/" "${D}/" || die "Install failed!" - - -

-Or sometimes a combination of insinto and doins (plus related -functions -- see Install Functions Reference) the following is based -upon the sys-fs/udev install: -

- - -src_install() { - dobin udevinfo || die - dobin udevtest || die - into / - dosbin udev || die - dosbin udevd || die - dosbin udevsend || die - dosbin udevstart || die - dosbin extras/scsi_id/scsi_id || die - dosbin extras/volume_id/udev_volume_id || die - - exeinto /etc/udev/scripts - doexe extras/ide-devfs.sh || die - doexe extras/scsi-devfs.sh || die - doexe extras/cdsymlinks.sh || die - doexe extras/dvb.sh || die - - insinto /etc/udev - newins "${FILESDIR}/udev.conf.post_050" udev.conf || die - doins extras/cdsymlinks.conf || die - - # For devfs style layout - insinto /etc/udev/rules.d/ - newins etc/udev/gentoo/udev.rules 50-udev.rules || die - - # scsi_id configuration - insinto /etc - doins extras/scsi_id/scsi_id.config || die - - # set up symlinks in /etc/hotplug.d/default - dodir /etc/hotplug.d/default || die - dosym ../../../sbin/udevsend /etc/hotplug.d/default/10-udev.hotplug || die - - # set up the /etc/dev.d directory tree - dodir /etc/dev.d/default || die - dodir /etc/dev.d/net || die - exeinto /etc/dev.d/net - doexe etc/dev.d/net/hotplug.dev || die - - doman *.8 || die - doman extras/scsi_id/scsi_id.8 || die - - dodoc ChangeLog FAQ HOWTO-udev_for_dev README TODO || die - dodoc docs/{overview,udev-OLS2003.pdf,udev_vs_devfs,RFC-dev.d,libsysfs.txt} || die - dodoc docs/persistent_naming/* docs/writing_udev_rules/* || die - - newdoc extras/volume_id/README README_volume_id || die -} - - -

-This is, of course, considerably harder to handle than a -simple Makefile driven install. -

- -
- -
-Other Installs - -

-Sometimes, there will be a Makefile that does not -honour DESTDIR and a non-trivial number of files to install. In -these situations, it is best to patch the Makefile and contact -upstream explaining the situation to them. -

- -
- -
-
+ + + +函数src_install + + + + + + src_install + + + + 安装软件包到指定的${D} + + + + 开启Enabled + + + + root + + + + ebuild + +
函数名
意义
Sandbox
所需权限
被谁调用
+ + +
+默认的<c>src_install</c> + +

+在EAPI < 4规约中,默认的src_install函数如下: +

+ +src_install() +{ + return +} + +

+在EAPI ≥ 4规约中,默认的 the default src_install 函数如下: +

+ +src_install() { + if [[ -f Makefile ]] || [[ -f GNUmakefile]] || [[ -f makefile ]] ; then + emake DESTDIR="${D}" install + fi + + if ! declare -p DOCS >/dev/null 2>&1 ; then + local d + for d in README* ChangeLog AUTHORS NEWS TODO CHANGES THANKS BUGS \ + FAQ CREDITS CHANGELOG ; do + [[ -s "${d}" ]] && dodoc "${d}" + done + elif declare -p DOCS | grep -q "^declare -a " ; then + dodoc "${DOCS[@]}" + else + dodoc ${DOCS} + fi +} + + +
+ +
+实例<c>src_install</c> + + +src_install() { + emake DESTDIR="${D}" install || die "Install failed" + dodoc README CHANGES || die +} + + +
+ +
+简单安装 + +

+通常尤其是支持autotools的软件包, 都会有Makefile +install安装软件包到指定的地方,DESTDIR变量会交代具体的安装位置.一般都建议使用这个变量: +

+ + + emake DESTDIR="${D}" install || die "Install failed" + + + +emake在次出应该支持并行运算.但有些软件包不支持并行运算,如果出错的话可以使用emake -j1make. + + +

+有时候安装过程会终止在在一些莫名其妙的地方.在这种情况下,请使用einstall: +

+ + + einstall || die "einstall failed" + + +

+通常也需要使用dodoc函数安装必要的 +README, ChangeLog, 等等. +

+ + +请注意没有dodoc COPYING!发行许可被存放在${PORTDIR}/licenses. 有时候您可能无论如何都需要安装COPYING, if it explains how different +licenses are applied to different parts of the application, for +example. + + +
+ +
+较繁琐的安装 + +

+For some packages with no Makefile that only install a small +number of files, writing a manual install using cp is the +easiest option. For example, to do a simple install of some (no +compilation required) themes: +

+ + + dodir /usr/share/foo-styles/ + cp -R "${S}/" "${D}/" || die "Install failed!" + + +

+Or sometimes a combination of insinto and doins (plus related +functions -- see Install Functions Reference) the following is based +upon the sys-fs/udev install: +

+ + +src_install() { + dobin udevinfo || die + dobin udevtest || die + into / + dosbin udev || die + dosbin udevd || die + dosbin udevsend || die + dosbin udevstart || die + dosbin extras/scsi_id/scsi_id || die + dosbin extras/volume_id/udev_volume_id || die + + exeinto /etc/udev/scripts + doexe extras/ide-devfs.sh || die + doexe extras/scsi-devfs.sh || die + doexe extras/cdsymlinks.sh || die + doexe extras/dvb.sh || die + + insinto /etc/udev + newins "${FILESDIR}/udev.conf.post_050" udev.conf || die + doins extras/cdsymlinks.conf || die + + # For devfs style layout + insinto /etc/udev/rules.d/ + newins etc/udev/gentoo/udev.rules 50-udev.rules || die + + # scsi_id configuration + insinto /etc + doins extras/scsi_id/scsi_id.config || die + + # set up symlinks in /etc/hotplug.d/default + dodir /etc/hotplug.d/default || die + dosym ../../../sbin/udevsend /etc/hotplug.d/default/10-udev.hotplug || die + + # set up the /etc/dev.d directory tree + dodir /etc/dev.d/default || die + dodir /etc/dev.d/net || die + exeinto /etc/dev.d/net + doexe etc/dev.d/net/hotplug.dev || die + + doman *.8 || die + doman extras/scsi_id/scsi_id.8 || die + + dodoc ChangeLog FAQ HOWTO-udev_for_dev README TODO || die + dodoc docs/{overview,udev-OLS2003.pdf,udev_vs_devfs,RFC-dev.d,libsysfs.txt} || die + dodoc docs/persistent_naming/* docs/writing_udev_rules/* || die + + newdoc extras/volume_id/README README_volume_id || die +} + + +

+这个,必须的,要比一个简单的Makefile更难掌握. +

+ +
+ +
+其他的安装 + +

+Sometimes, there will be a Makefile that does not +honour DESTDIR and a non-trivial number of files to install. In +these situations, it is best to patch the Makefile and contact +upstream explaining the situation to them. +

+ +
+ +
+
From bd6d59c703825ba8020ab3a18120d0db845bc44f Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Mon, 11 Mar 2013 21:27:31 +0800 Subject: [PATCH 40/54] Update text.xml --- ebuild-writing/functions/pkg_postinst/text.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ebuild-writing/functions/pkg_postinst/text.xml b/ebuild-writing/functions/pkg_postinst/text.xml index 80d5f0b..08a3255 100644 --- a/ebuild-writing/functions/pkg_postinst/text.xml +++ b/ebuild-writing/functions/pkg_postinst/text.xml @@ -59,7 +59,7 @@ pkg_postinst() {
-函数<c>pkg_postinst</c> 常见用途/title> +<title>函数<c>pkg_postinst</c>常见用途

函数pkg_postinst最常用于显示安装之后的信息说明或警告提示. 如果您想要显示某些升级有关的讯息 From e3a75ba3cb81254f25a2efd6a3f00a9c5df8054c Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Mon, 11 Mar 2013 21:34:17 +0800 Subject: [PATCH 41/54] Update text.xml --- ebuild-writing/functions/src_compile/building/text.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ebuild-writing/functions/src_compile/building/text.xml b/ebuild-writing/functions/src_compile/building/text.xml index 8d41793..812334e 100644 --- a/ebuild-writing/functions/src_compile/building/text.xml +++ b/ebuild-writing/functions/src_compile/building/text.xml @@ -16,7 +16,7 @@ extras),例如.偶尔您可能遇到让人纠结的非自动处理(non-autot

如果确定不能够打这样的补丁,默认启用emake -j1. -然而这样做,特别是对于在很多非-x86的用户来说,编译软件可能真是会要命的强制在-j1的情况下,在MIPS和SPARC系统上编译时间可能增加几分钟到一个小时也说不定. +然而这样做,特别是对于在很多非-x86的用户来说,编译软件可能真是会要命的强制在-j1的情况下,在MIPS和SPARC系统上编译时间可能增加几分钟到一个小时也说不定.

From 9bc194863ed6c1dbd80c4e764512d61d970c448a Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Tue, 12 Mar 2013 14:37:23 +0800 Subject: [PATCH 42/54] update some dummy mistakes --- ebuild-writing/functions/pkg_config/text.xml | 2 +- ebuild-writing/functions/pkg_info/text.xml | 2 +- ebuild-writing/functions/pkg_nofetch/text.xml | 2 +- ebuild-writing/functions/pkg_postinst/text.xml | 2 +- ebuild-writing/functions/pkg_postrm/text.xml | 2 +- ebuild-writing/functions/pkg_preinst/text.xml | 2 +- ebuild-writing/functions/pkg_prerm/text.xml | 2 +- ebuild-writing/functions/pkg_pretend/text.xml | 2 +- ebuild-writing/functions/pkg_setup/text.xml | 2 +- ebuild-writing/functions/src_prepare/text.xml | 2 +- ebuild-writing/functions/src_test/text.xml | 2 +- ebuild-writing/functions/src_unpack/text.xml | 2 +- text.xml | 5 ++--- 13 files changed, 14 insertions(+), 15 deletions(-) diff --git a/ebuild-writing/functions/pkg_config/text.xml b/ebuild-writing/functions/pkg_config/text.xml index 8c5f9b9..7c9408c 100644 --- a/ebuild-writing/functions/pkg_config/text.xml +++ b/ebuild-writing/functions/pkg_config/text.xml @@ -1,7 +1,7 @@ -pkg_config +函数pkg_config diff --git a/ebuild-writing/functions/pkg_info/text.xml b/ebuild-writing/functions/pkg_info/text.xml index 5de2bb0..ebf369a 100644 --- a/ebuild-writing/functions/pkg_info/text.xml +++ b/ebuild-writing/functions/pkg_info/text.xml @@ -1,7 +1,7 @@ -pkg_info +函数pkg_info
diff --git a/ebuild-writing/functions/pkg_nofetch/text.xml b/ebuild-writing/functions/pkg_nofetch/text.xml index 151ab57..0a8f11d 100644 --- a/ebuild-writing/functions/pkg_nofetch/text.xml +++ b/ebuild-writing/functions/pkg_nofetch/text.xml @@ -1,7 +1,7 @@ -pkg_nofetch +函数pkg_nofetch
diff --git a/ebuild-writing/functions/pkg_postinst/text.xml b/ebuild-writing/functions/pkg_postinst/text.xml index 08a3255..51735ba 100644 --- a/ebuild-writing/functions/pkg_postinst/text.xml +++ b/ebuild-writing/functions/pkg_postinst/text.xml @@ -1,7 +1,7 @@ -pkg_postinst +函数pkg_postinst
diff --git a/ebuild-writing/functions/pkg_postrm/text.xml b/ebuild-writing/functions/pkg_postrm/text.xml index 6c1397c..8c308f4 100644 --- a/ebuild-writing/functions/pkg_postrm/text.xml +++ b/ebuild-writing/functions/pkg_postrm/text.xml @@ -1,7 +1,7 @@ -pkg_postrm +函数pkg_postrm
diff --git a/ebuild-writing/functions/pkg_preinst/text.xml b/ebuild-writing/functions/pkg_preinst/text.xml index 2e93c70..7284764 100644 --- a/ebuild-writing/functions/pkg_preinst/text.xml +++ b/ebuild-writing/functions/pkg_preinst/text.xml @@ -1,7 +1,7 @@ -pkg_preinst +函数pkg_preinst
diff --git a/ebuild-writing/functions/pkg_prerm/text.xml b/ebuild-writing/functions/pkg_prerm/text.xml index a21f4c0..3894ab6 100644 --- a/ebuild-writing/functions/pkg_prerm/text.xml +++ b/ebuild-writing/functions/pkg_prerm/text.xml @@ -1,7 +1,7 @@ -pkg_prerm +函数pkg_prerm
diff --git a/ebuild-writing/functions/pkg_pretend/text.xml b/ebuild-writing/functions/pkg_pretend/text.xml index 67d416a..e83f82f 100644 --- a/ebuild-writing/functions/pkg_pretend/text.xml +++ b/ebuild-writing/functions/pkg_pretend/text.xml @@ -1,7 +1,7 @@ -pkg_pretend +函数pkg_pretend
diff --git a/ebuild-writing/functions/pkg_setup/text.xml b/ebuild-writing/functions/pkg_setup/text.xml index 7fcc808..f4f4b85 100644 --- a/ebuild-writing/functions/pkg_setup/text.xml +++ b/ebuild-writing/functions/pkg_setup/text.xml @@ -1,7 +1,7 @@ -pkg_setup +函数pkg_setup
diff --git a/ebuild-writing/functions/src_prepare/text.xml b/ebuild-writing/functions/src_prepare/text.xml index e765261..e5c6bc6 100644 --- a/ebuild-writing/functions/src_prepare/text.xml +++ b/ebuild-writing/functions/src_prepare/text.xml @@ -1,7 +1,7 @@ -src_prepare函数 +函数src_prepare
diff --git a/ebuild-writing/functions/src_test/text.xml b/ebuild-writing/functions/src_test/text.xml index aa79ff7..3589cec 100644 --- a/ebuild-writing/functions/src_test/text.xml +++ b/ebuild-writing/functions/src_test/text.xml @@ -1,7 +1,7 @@ -src_test +函数src_test
diff --git a/ebuild-writing/functions/src_unpack/text.xml b/ebuild-writing/functions/src_unpack/text.xml index 99398c6..dc8f3e7 100644 --- a/ebuild-writing/functions/src_unpack/text.xml +++ b/ebuild-writing/functions/src_unpack/text.xml @@ -1,7 +1,7 @@ -src_unpack +函数src_unpack
diff --git a/text.xml b/text.xml index 0b2cfaf..42acaeb 100644 --- a/text.xml +++ b/text.xml @@ -20,9 +20,8 @@

-欢迎完善该文档.具体操作详见 -章节. 如您有对本文有任何的建议和意见,错误的修改等请参照bug list和提交一new bug. -这部分 +欢迎完善该文档.具体操作详见章节.如您有对本文有任何的建议和意见,错误的修改等请参照buglist和提交一新的bug. +这部分 列举了各个编委为本文所做的具体工作.

From 04ec7cf8955c87e36cdc7b87754bd92086835d04 Mon Sep 17 00:00:00 2001 From: lledu Date: Mon, 18 Mar 2013 11:08:11 +0800 Subject: [PATCH 43/54] Update text.xml --- ebuild-writing/common-mistakes/text.xml | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/ebuild-writing/common-mistakes/text.xml b/ebuild-writing/common-mistakes/text.xml index ae0f7cf..323b1af 100644 --- a/ebuild-writing/common-mistakes/text.xml +++ b/ebuild-writing/common-mistakes/text.xml @@ -36,19 +36,16 @@ -Referencing the full path to documentation files that could be -compressed - -When printing out to the users where to find files like INSTALL, do not specify -the full path since PORTAGE_COMPRESS comes into play. The file could be -compressed with gzip, bzip2, or some other random compression tool. So, -instead of doing this: +引用可能被压缩的文件全路径 +当给用户指出在哪找文件(例如INSTALL文件)时不要用确定的全路径名,因为 PORTAGE_COMPRESS 在起作用。 +文件可能被gzip,bzip2或者其他的压缩工具压缩。所以,不要像这样做: + elog "They are listed in /usr/share/doc/${PF}/INSTALL.gz" -Do something like: +要这样做: elog "They are listed in the INSTALL file in /usr/share/doc/${PF}" @@ -57,14 +54,12 @@ elog "They are listed in the INSTALL file in /usr/share/doc/${PF}" -Build log not verbose +编译日志不详细 -When writing ebuilds, you should always check the build log, because the build -system might ignore CC/CXX/LD/CFLAGS/LDFLAGS and such or add undesired flags -by default. In order to analyze this and have complete information, in case -someone reports a bug for your package, the build log must always be verbose. +写ebuild文件时,你应该时常检查编译日志,因为编译系统有可能会忽略CC/CXX/LD/CFLAGS/LDFLAGS, +或者会默认增加不需要的标志。为了有完整的信息分析这种情况,以便别人为你的包报告漏洞,编译日志必须详细

-There are several ways to fix non-verbose build logs depending on the build system: +有许多方法修改不详细的编译日志,这要看用的什么编译系统:

For cmake based build systems it should be sufficient that the ebuild calls From ec785a3929f5e643716aa791869a62bdf32428a2 Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Mon, 18 Mar 2013 19:30:53 +0800 Subject: [PATCH 44/54] fix some mistakes --- appendices/editor-configuration/text.xml | 60 ++++----- appendices/editor-configuration/vim/text.xml | 48 +++---- appendices/further-reading/text.xml | 124 +++++++++---------- 3 files changed, 116 insertions(+), 116 deletions(-) diff --git a/appendices/editor-configuration/text.xml b/appendices/editor-configuration/text.xml index 990ef8d..2108cb6 100644 --- a/appendices/editor-configuration/text.xml +++ b/appendices/editor-configuration/text.xml @@ -1,30 +1,30 @@ - - - - - - -

-һʾйر༭ebuildsĵõtext editorʾ. -

- - -vapier:nanoô?...ֻø -/etc/nanorc~/.nanorcȥebuildsεע;. - - - - -
-ûҪ - - - -
- - - - - - - + + + +工欲善其功,必先利其器 + + +

+给你一点提示,有关编辑ebuilds文档所用的text editor的提示. +

+ + +据vapier所言:你用nano么?...哥们你只用复制 +/etc/nanorc到~/.nanorc并去除ebuilds段的相关注释就行. + + + + +
+看看有没有你想要的 + + + +
+
+ + + + + +
diff --git a/appendices/editor-configuration/vim/text.xml b/appendices/editor-configuration/vim/text.xml index a3990ad..d6f6edc 100644 --- a/appendices/editor-configuration/vim/text.xml +++ b/appendices/editor-configuration/vim/text.xml @@ -1,24 +1,24 @@ - - - -񼶱༭<c>vim</c><c>gvim</c> - - -

-gentooĵеwhitespace, character set, syntax -vimgvim, emergeapp-vim/gentoo-syntax. -

- -

-Full documentation is provided with the package, and can be viewed -by using vim's internal help browser (:help gentoo-syntax). -

- -

-When fixing ebuilds with broken whitespace, the :retab! command may be -of interest. The ! is required to replace spaces with tabs. -

- - -
-
+ + + +神级编辑器<c>vim</c>和<c>gvim</c> + + +

+所有gentoo文档中的whitespace, character set, syntax高亮和缩进设置 +vimgvim类似, emerge这个app-vim/gentoo-syntax软件包. +

+ +

+Full documentation is provided with the package, and can be viewed +by using vim's internal help browser (:help gentoo-syntax). +

+ +

+When fixing ebuilds with broken whitespace, the :retab! command may be +of interest. The ! is required to replace spaces with tabs. +

+ + +
+
diff --git a/appendices/further-reading/text.xml b/appendices/further-reading/text.xml index b8dd26e..ce1bfc2 100644 --- a/appendices/further-reading/text.xml +++ b/appendices/further-reading/text.xml @@ -1,62 +1,62 @@ - - - -Ķ - - -

-ǿƼĶг¡鼮. ξθ֮,ǽ֮. -

- -
-鼮ϵĽ - - -
-
- Mastering Regular Expressions(ʽ) -
-
-

- "Mastering Regular Expressions" Jeffrey E. F. Friedl (O'Reilly, - ISBN 0-596-00289-0)רRegular Expressions. ɶǿdz - 鼮гõķ֮߳ѧ. ҳ -

-
-
- - -
- -
- - - -
-
- Making Packager-Friendly Software -
-
-

- Making - Packager-Friendly Software Julio M. Merino Vidalָ˺ܶupstream software providers飬ӷʹ. -

-
-
- How to Report Bugs Effectively -
-
-

- How to Report Bugs - EffectivelySimon Tatham׫дЧύBugsôϾʱȶһ. -

-
-
- - -
- - -
-
- + + + +延伸阅读 + + +

+强烈推荐阅读本章列出的文章、书籍. 次均肺腑之言,非锦上添花凑数之物. +

+ +
+书籍是人类向上的阶梯 + + +
+
+ Mastering Regular Expressions(掌握正则表达式) +
+
+

+ "Mastering Regular Expressions" Jeffrey E. F. Friedl (O'Reilly, + ISBN 0-596-00289-0)著,是专门介绍Regular Expressions. 可读性强、深入浅出 + 规避以往此类书籍中常用的繁杂冗长之数学术语. 扉页 +

+
+
+ + +
+ +
+文章 + + +
+
+ Making Packager-Friendly Software +
+
+

+ Making + Packager-Friendly Software 由Julio M. Merino Vidal编著,指出了很多upstream software providers可做的事情,它会更加方便于使用它的人. +

+
+
+ How to Report Bugs Effectively +
+
+

+ How to Report Bugs + Effectively由Simon Tatham撰写,想更加有效的提交Bugs么,闲暇时先读一下它吧. +

+
+
+ + +
+ + +
+
+ From 5b058344507c1bdba4d9b450b7381c5fc9405191 Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Mon, 18 Mar 2013 19:33:54 +0800 Subject: [PATCH 45/54] fix some mistakes --- text.xml | 120 ++++++++++++++++++++++++++----------------------------- 1 file changed, 57 insertions(+), 63 deletions(-) diff --git a/text.xml b/text.xml index 75b9f0e..25c68bf 100644 --- a/text.xml +++ b/text.xml @@ -1,63 +1,57 @@ - - - -主目录 - - -

-这是一份需不断更改以适应实时需求的开发文档,需要在大家的努力共同维护。它可能存在诸多谬误和不足。目的旨在给开发者和用户提供正确,详尽,可操作,及时更新的参考。 -

-
-
参加编写人员
-
-

- Ciaran McCreesh, Grant Goodyear, Aaron Walker, Robert Coie, - Tom Martin, Paul Varner, Ilya Volynets-Evenbakh, - Diego Pettenò, Fernando J. Pereda, Simon Stelling, Alin Dobre, - Joseph Jezak, Tim Yamin, Mark Loeser, Petteri Räty, Markos - Chandras, Mike Pagano, Julian Ospald, Ulrich Müller -

-
-
-

-<<<<<<< HEAD -欢迎完善该文档.具体操作详见 -章节. 如您有对本文有任何的建议和意见,错误的修改等请参照bug list和提交一新的Bug. -这部分 -======= -欢迎完善该文档.具体操作详见章节.如您有对本文有任何的建议和意见,错误的修改等请参照buglist和提交一新的bug. -这部分 ->>>>>>> ebuilds -列举了各个编委为本文所做的具体工作. -

- - -
-目录框架 - - - -
- -
-章节安排 - - - -
-
- - - - - - - - - - - - - - -
+ + + +主目录 + + +

+这是一份需不断更改以适应实时需求的开发文档,需要在大家的努力共同维护。它可能存在诸多谬误和不足。目的旨在给开发者和用户提供正确,详尽,可操作,及时更新的参考。 +

+
+
参加编写人员
+
+

+ Ciaran McCreesh, Grant Goodyear, Aaron Walker, Robert Coie, + Tom Martin, Paul Varner, Ilya Volynets-Evenbakh, + Diego Pettenò, Fernando J. Pereda, Simon Stelling, Alin Dobre, + Joseph Jezak, Tim Yamin, Mark Loeser, Petteri Räty, Markos + Chandras, Mike Pagano, Julian Ospald, Ulrich Müller +

+
+
+

+欢迎完善该文档.具体操作详见章节.如您有对本文有任何的建议和意见,错误的修改等请参照buglist和提交一新的bug. +这部分 +列举了各个编委为本文所做的具体工作. +

+ + +
+目录框架 + + + +
+ +
+章节安排 + + + +
+
+ + + + + + + + + + + + + + +
From 9988145499f14344138af69d05762c5b52f88c37 Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Tue, 19 Mar 2013 23:28:31 +0800 Subject: [PATCH 46/54] layout of general concept --- general-concepts/autotools/text.xml | 11 +++++------ general-concepts/config-protect/text.xml | 2 +- general-concepts/cvs-to-rsync/text.xml | 6 +++--- general-concepts/dependencies/text.xml | 2 +- general-concepts/distributed-building/text.xml | 4 ++-- general-concepts/ebuild-revisions/text.xml | 2 +- general-concepts/emerge-and-ebuild/text.xml | 2 +- general-concepts/features/text.xml | 2 +- general-concepts/filesystem/text.xml | 2 +- general-concepts/herds-and-projects/text.xml | 2 +- general-concepts/install-destinations/text.xml | 2 +- general-concepts/licenses/text.xml | 2 +- general-concepts/linguas/text.xml | 2 +- general-concepts/manifest/text.xml | 2 +- general-concepts/mirrors/text.xml | 2 +- general-concepts/news/text.xml | 2 +- general-concepts/overlay/text.xml | 2 +- general-concepts/portage-cache/text.xml | 2 +- general-concepts/privileges/text.xml | 2 +- general-concepts/sandbox/text.xml | 2 +- general-concepts/slotting/text.xml | 2 +- general-concepts/tree/text.xml | 2 +- general-concepts/use-flags/text.xml | 2 +- general-concepts/user-environment/text.xml | 2 +- general-concepts/virtuals/text.xml | 2 +- 25 files changed, 32 insertions(+), 33 deletions(-) diff --git a/general-concepts/autotools/text.xml b/general-concepts/autotools/text.xml index 181940c..0a70356 100644 --- a/general-concepts/autotools/text.xml +++ b/general-concepts/autotools/text.xml @@ -1,17 +1,16 @@ -The Basics of Autotools +Autotools的基础 -This is too long for . It needs to be split up and -moved somewhere, either to a top-level of its own or into . +相对于的整体而言,这一章节的内容显得有些长.根据情况适当调整吧,重要的内容需要着重阐明,次重要的会将其发配到中.

-An understanding of GNU autotools (automake, autoconf etc.) can be useful -when working with ebuilds: +适当的了解GNU的autotools(automake, autoconf等)是非常有用的, +尤其是每天处理ebuilds时:

    @@ -32,7 +31,7 @@ when working with ebuilds:
    -Major Autotools Components +Autotools的主要元素

    diff --git a/general-concepts/config-protect/text.xml b/general-concepts/config-protect/text.xml index ec74a86..5797bee 100644 --- a/general-concepts/config-protect/text.xml +++ b/general-concepts/config-protect/text.xml @@ -1,7 +1,7 @@ -Configuration File Protection +文件保护机制

    diff --git a/general-concepts/cvs-to-rsync/text.xml b/general-concepts/cvs-to-rsync/text.xml index 9a379e6..f0d3661 100644 --- a/general-concepts/cvs-to-rsync/text.xml +++ b/general-concepts/cvs-to-rsync/text.xml @@ -1,17 +1,17 @@ -CVS to RSYNC +CVS到RSYNC

    - Changes made to the tree are propagated to the users in stages: + Portage树的更改被传递到用户的stages:

    • - Developer commits to CVS. + 开发者不断向CVS提交.
    • Staging box syncs from CVS and generates the metadata cache. diff --git a/general-concepts/dependencies/text.xml b/general-concepts/dependencies/text.xml index ce25fa7..b8dfa08 100644 --- a/general-concepts/dependencies/text.xml +++ b/general-concepts/dependencies/text.xml @@ -1,7 +1,7 @@ -Dependencies +依赖 diff --git a/general-concepts/distributed-building/text.xml b/general-concepts/distributed-building/text.xml index 003c27f..803c2e3 100644 --- a/general-concepts/distributed-building/text.xml +++ b/general-concepts/distributed-building/text.xml @@ -1,11 +1,11 @@ -Distributed and Parallel Building +分布式及并行编译 -Write this. +gentoo的文档中都有. diff --git a/general-concepts/ebuild-revisions/text.xml b/general-concepts/ebuild-revisions/text.xml index 9ddc39f..cb642e5 100644 --- a/general-concepts/ebuild-revisions/text.xml +++ b/general-concepts/ebuild-revisions/text.xml @@ -1,7 +1,7 @@ -Ebuild Revisions +Ebuild再版

      diff --git a/general-concepts/emerge-and-ebuild/text.xml b/general-concepts/emerge-and-ebuild/text.xml index 16bc056..2a89230 100644 --- a/general-concepts/emerge-and-ebuild/text.xml +++ b/general-concepts/emerge-and-ebuild/text.xml @@ -1,7 +1,7 @@ -Emerge and Ebuild Relationships +Emerge和Ebuild的暧昧关系 diff --git a/general-concepts/features/text.xml b/general-concepts/features/text.xml index cba1cac..4b97ac1 100644 --- a/general-concepts/features/text.xml +++ b/general-concepts/features/text.xml @@ -1,7 +1,7 @@ -FEATURES +变量FEATURES

      diff --git a/general-concepts/filesystem/text.xml b/general-concepts/filesystem/text.xml index 4a26753..830c8c0 100644 --- a/general-concepts/filesystem/text.xml +++ b/general-concepts/filesystem/text.xml @@ -1,7 +1,7 @@ -Filesystem +文件夹意义

      diff --git a/general-concepts/herds-and-projects/text.xml b/general-concepts/herds-and-projects/text.xml index e030150..12888ca 100644 --- a/general-concepts/herds-and-projects/text.xml +++ b/general-concepts/herds-and-projects/text.xml @@ -1,7 +1,7 @@ -Herds and Projects +Herds和Projects diff --git a/general-concepts/install-destinations/text.xml b/general-concepts/install-destinations/text.xml index cf9c278..381e66d 100644 --- a/general-concepts/install-destinations/text.xml +++ b/general-concepts/install-destinations/text.xml @@ -1,7 +1,7 @@ -Install Destinations +安装目录 diff --git a/general-concepts/licenses/text.xml b/general-concepts/licenses/text.xml index f98f303..6001a11 100644 --- a/general-concepts/licenses/text.xml +++ b/general-concepts/licenses/text.xml @@ -1,7 +1,7 @@ -Licenses +授权文件

      diff --git a/general-concepts/linguas/text.xml b/general-concepts/linguas/text.xml index d44a879..522a243 100644 --- a/general-concepts/linguas/text.xml +++ b/general-concepts/linguas/text.xml @@ -1,7 +1,7 @@ -Linguas +变量Linguas diff --git a/general-concepts/manifest/text.xml b/general-concepts/manifest/text.xml index 665c259..b816502 100644 --- a/general-concepts/manifest/text.xml +++ b/general-concepts/manifest/text.xml @@ -6,7 +6,7 @@

      -Generating the Manifest +产生Manifest

      In the tree, every package has a Manifest file. This file lives in the same diff --git a/general-concepts/mirrors/text.xml b/general-concepts/mirrors/text.xml index 7433e97..a6d7105 100644 --- a/general-concepts/mirrors/text.xml +++ b/general-concepts/mirrors/text.xml @@ -1,7 +1,7 @@ -Mirrors +镜像

      Automatic Mirroring diff --git a/general-concepts/news/text.xml b/general-concepts/news/text.xml index 77c7f5f..32b68a8 100644 --- a/general-concepts/news/text.xml +++ b/general-concepts/news/text.xml @@ -1,7 +1,7 @@ -News Items +新项目

      diff --git a/general-concepts/overlay/text.xml b/general-concepts/overlay/text.xml index e2c773c..fa43cc0 100644 --- a/general-concepts/overlay/text.xml +++ b/general-concepts/overlay/text.xml @@ -1,7 +1,7 @@ -Overlay +Overlay相关

      diff --git a/general-concepts/portage-cache/text.xml b/general-concepts/portage-cache/text.xml index f185f62..dad0604 100644 --- a/general-concepts/portage-cache/text.xml +++ b/general-concepts/portage-cache/text.xml @@ -1,7 +1,7 @@ -The Portage Cache +Portage的缓存

      diff --git a/general-concepts/privileges/text.xml b/general-concepts/privileges/text.xml index 8dc516b..ee8e9ac 100644 --- a/general-concepts/privileges/text.xml +++ b/general-concepts/privileges/text.xml @@ -1,7 +1,7 @@ -Privileges +所需权限 diff --git a/general-concepts/sandbox/text.xml b/general-concepts/sandbox/text.xml index 8fd63a4..146b9c7 100644 --- a/general-concepts/sandbox/text.xml +++ b/general-concepts/sandbox/text.xml @@ -1,7 +1,7 @@ -Sandbox +Sandbox(沙盒)

      diff --git a/general-concepts/slotting/text.xml b/general-concepts/slotting/text.xml index bbbfad4..20d9bb7 100644 --- a/general-concepts/slotting/text.xml +++ b/general-concepts/slotting/text.xml @@ -1,7 +1,7 @@ -Slotting +Slotting(插槽)

      diff --git a/general-concepts/tree/text.xml b/general-concepts/tree/text.xml index 2bceca5..5796655 100644 --- a/general-concepts/tree/text.xml +++ b/general-concepts/tree/text.xml @@ -1,7 +1,7 @@ -The Portage Tree +Portage树

      diff --git a/general-concepts/use-flags/text.xml b/general-concepts/use-flags/text.xml index 85523fc..e9ed0d5 100644 --- a/general-concepts/use-flags/text.xml +++ b/general-concepts/use-flags/text.xml @@ -1,7 +1,7 @@ -USE Flags +USE标示

      diff --git a/general-concepts/user-environment/text.xml b/general-concepts/user-environment/text.xml index b7a0926..998b798 100644 --- a/general-concepts/user-environment/text.xml +++ b/general-concepts/user-environment/text.xml @@ -1,7 +1,7 @@ -User Environment +用户的环境变量

      diff --git a/general-concepts/virtuals/text.xml b/general-concepts/virtuals/text.xml index 6397883..a5f2710 100644 --- a/general-concepts/virtuals/text.xml +++ b/general-concepts/virtuals/text.xml @@ -1,7 +1,7 @@ -Virtuals +Virtuals(虚虚实实)

      From 558dbfecfb8d3f9f0f98d0d053204ffa80815a20 Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Wed, 20 Mar 2013 09:49:33 +0800 Subject: [PATCH 47/54] Update README.md --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 8c4a41b..b2dcca1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,15 @@ If you have any problem, do not hesitate to tell me + via email:dpzhang314@163.com + + +To make html file, just type in "make", + + +Use web browser to preview it; + + +To clean html file, just type in "make clean"; + + Thanks. From 0a58b4b9d77588f48c112c20750cda47f27a9187 Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Wed, 20 Mar 2013 22:24:22 +0800 Subject: [PATCH 48/54] some fix --- general-concepts/config-protect/text.xml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/general-concepts/config-protect/text.xml b/general-concepts/config-protect/text.xml index 5797bee..805abce 100644 --- a/general-concepts/config-protect/text.xml +++ b/general-concepts/config-protect/text.xml @@ -5,16 +5,12 @@

      - Portage includes a system for configuration file protection which means ebuilds - don't have to worry about accidentally clobbering files in /etc. This is - known as 'protection', and it is controlled by the CONFIG_PROTECT and - CONFIG_PROTECT_MASK variables. + Portage包管理机制包含配置文件保护机制,这意味着您大可放心安装软件包,不用担心/etc目录下的配置文件被直接覆盖.这就是传说中的'保护',主要是通过变量CONFIG_PROTECT和 + CONFIG_PROTECT_MASK实现的.

      - Any directory which is listed in CONFIG_PROTECT (and any subdirectories - thereof), except for any which are listed in CONFIG_PROTECT_MASK (and - subdirectories) are automatically 'protected' by Portage when copying an image + 在CONFIG_PROTECT中列出的任意目录(包含其子目录)都是Portage的保护对象,当然应该除外掉在CONFIG_PROTECT_MASK中列出的目录(及其子目录) are automatically 'protected' by Portage when copying an image from DESTDIR to ROOT. Rather than installing protected files directly, Portage will install them as ._cfg0000_filename. These can then be processed by the etc-update or dispatch-conf files at the user's discretion. From b569eef955cfd4e6781f00c9e7905fbf726357ff Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Wed, 20 Mar 2013 22:43:48 +0800 Subject: [PATCH 49/54] Update text.xml --- general-concepts/config-protect/text.xml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/general-concepts/config-protect/text.xml b/general-concepts/config-protect/text.xml index 805abce..8ca8480 100644 --- a/general-concepts/config-protect/text.xml +++ b/general-concepts/config-protect/text.xml @@ -5,21 +5,22 @@

      - Portage包管理机制包含配置文件保护机制,这意味着您大可放心安装软件包,不用担心/etc目录下的配置文件被直接覆盖.这就是传说中的'保护',主要是通过变量CONFIG_PROTECT和 + Portage包管理机制包含配置文件保护机制,这意味着您大可放心安装软件包, + 不用担心/etc目录下的配置文件被直接覆盖.这就是传说中的'保护',主要是通过变量CONFIG_PROTECTCONFIG_PROTECT_MASK实现的.

      - 在CONFIG_PROTECT中列出的任意目录(包含其子目录)都是Portage的保护对象,当然应该除外掉在CONFIG_PROTECT_MASK中列出的目录(及其子目录) are automatically 'protected' by Portage when copying an image - from DESTDIR to ROOT. Rather than installing protected files directly, - Portage will install them as ._cfg0000_filename. These can then be processed - by the etc-update or dispatch-conf files at the user's discretion. + 在CONFIG_PROTECT中列出的任意目录(包含其子目录)都是Portage的'保护'对象,当然应该除外掉在 + CONFIG_PROTECT_MASK中列出的目录(及其子目录),就是说我们把软件包由DESTDIR安装到ROOT时. + Portage将会把他们以._cfg0000_filename的形式安装,而不是直接的安装到系统中. + 最后的决定权还要靠用户使用etc-updatedispatch-conf比较判断.

      - Packages must not attempt to override this system via pkg_postinst or - similar. If you need a file renamed, removed or changed in a particular way, you - should display a message informing the user. + 软件包不应该使用pkg_postinst或其他诸如此类的指令,尝试覆盖系统用已存在的文件. + 如果您在特殊情况下需要重命名,删除或改变文件, + 应该给用户显示相关的信息.

      From ce71b8b8c41cb40114c143abdbb68bd3bc39bf0c Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Wed, 20 Mar 2013 22:53:53 +0800 Subject: [PATCH 50/54] Update text.xml --- general-concepts/cvs-to-rsync/text.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/general-concepts/cvs-to-rsync/text.xml b/general-concepts/cvs-to-rsync/text.xml index f0d3661..4c83a74 100644 --- a/general-concepts/cvs-to-rsync/text.xml +++ b/general-concepts/cvs-to-rsync/text.xml @@ -14,16 +14,16 @@ 开发者不断向CVS提交.
    • - Staging box syncs from CVS and generates the metadata cache. + Staging box从CVS同步更新并产生metadata缓存.
    • - rsync1 syncs from the staging box. + rsync1从staging box同步更新.
    • - Public rsync servers sync from rsync1. + 公众的rsync服务器从rsync1同步更新.
    • - Users sync from the public rsync servers. + 普通用户从公众服务器同步更新.
    @@ -32,7 +32,7 @@

    - The emerge-websync snapshot is made daily from the staging box. + emerge-websync的快照每日从staging box更新.

    From 4d9bda63ebdc1150eded4fa3013f712fd37e3bf3 Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Wed, 20 Mar 2013 23:06:25 +0800 Subject: [PATCH 51/54] Update text.xml --- general-concepts/emerge-and-ebuild/text.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/general-concepts/emerge-and-ebuild/text.xml b/general-concepts/emerge-and-ebuild/text.xml index 2a89230..c5f84c3 100644 --- a/general-concepts/emerge-and-ebuild/text.xml +++ b/general-concepts/emerge-and-ebuild/text.xml @@ -9,13 +9,13 @@

    -The emerge program is a high level wrapper for ebuild.sh that handles -dependency tracking, safe installs and uninstalls and so on. emerge calls -ebuild.sh during the build process, which in turn handles the ebuild file -and any eclasses. The ${D} to ${ROOT} install is handled by emerge. +神奇的emerge命令是一个ebuild.sh的更高级的包装程序,它能处理 +依赖追踪,安全安装和删除等等.使用emerge命令时它将调用 +ebuild.sh,而ebuild.sh将轮流处理 +ebuilds文件eclasses. 软件包从${D}安装到${ROOT}也是由emerge处理的.

    -http://dev.gentoo.org/~g2boojum/portage.html +这个还是比较容易理解的吧 From bcb9d2e7ee692c1e74cc14e5e7c1b89d46a1eade Mon Sep 17 00:00:00 2001 From: dpzhang314 Date: Wed, 20 Mar 2013 23:39:47 +0800 Subject: [PATCH 52/54] Update text.xml --- general-concepts/features/text.xml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/general-concepts/features/text.xml b/general-concepts/features/text.xml index 4b97ac1..f212625 100644 --- a/general-concepts/features/text.xml +++ b/general-concepts/features/text.xml @@ -5,13 +5,12 @@

    -The FEATURES variable specifies options which affect how Portage operates -and how packages are compiled. It is not used for settings which have a -substantial effect upon the resulting generated package. +设置变量FEATURES能实时的干预到Portage的工作和软件包的编译. +但是对于已经被安装在系统中的软件包是没有效果的.

    -Relevant FEATURES for developers include: +一些相关的FEATURES:

From a0156169c8ebe3499f5f7ba51c9feb8f71b4b5a6 Mon Sep 17 00:00:00 2001 From: lledu Date: Tue, 26 Mar 2013 11:35:05 +0800 Subject: [PATCH 53/54] Update text.xml --- ebuild-writing/common-mistakes/text.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ebuild-writing/common-mistakes/text.xml b/ebuild-writing/common-mistakes/text.xml index 323b1af..85dfab3 100644 --- a/ebuild-writing/common-mistakes/text.xml +++ b/ebuild-writing/common-mistakes/text.xml @@ -62,21 +62,21 @@ elog "They are listed in the INSTALL file in /usr/share/doc/${PF}" 有许多方法修改不详细的编译日志,这要看用的什么编译系统:

-For cmake based build systems it should be sufficient that the ebuild calls -cmake-utils_src_compile which picks up the cmake-utils.eclass variable 'CMAKE_VERBOSE=1' -by default. If you call emake directly for whatever reason, you can do 'emake VERBOSE=1' -(note that cmake-utils_src_compile takes arguments as well which are passed to make). +对于基于 cmake 的编译系统,这样做就行了:ebuild会调用cmake-utils_src_compile, +它默认设置变量'CMAKE_VERBOSE=1'。如果你由于某些原因直接调用了emake,你可以设置'emake VERBOSE=1' +(注意cmake-utils_src_compile在make中也是可以带参数的)

-For autotools based build systems you can pass '--disable-silent-rules' to econf, -or use EAPI 5 where that argument is passed automatically. 'emake V=1' should also work. +对于基于 autotools 的编译系统,你可以给econf传递选项'--disable-silent-rules'。 +或者用EAPI 5让参数自动传递,设置'emake V=1'也是可以的。

For custom Makefiles you often have to write a patch. Try to get upstream to include an option like 'V=1' to enable full verbosity.

+对于自定义的Makefiles,你必须经常写补丁。回溯上游的时候尝试使用例如'V=1'这样的可以记录详细情况的选项。 In case you encounter an affected package which uses a build system not controllable by portage or eclasses you should file a bug (preferably with a patch) and make it block the tracker bug #429308. Solutions above ebuild level are From d55d74fd889e4f6dc8a8928b4b177cb493779b0a Mon Sep 17 00:00:00 2001 From: lledu Date: Tue, 26 Mar 2013 11:36:05 +0800 Subject: [PATCH 54/54] Update text.xml --- ebuild-writing/common-mistakes/text.xml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ebuild-writing/common-mistakes/text.xml b/ebuild-writing/common-mistakes/text.xml index 85dfab3..7195bc3 100644 --- a/ebuild-writing/common-mistakes/text.xml +++ b/ebuild-writing/common-mistakes/text.xml @@ -66,17 +66,13 @@ elog "They are listed in the INSTALL file in /usr/share/doc/${PF}" 它默认设置变量'CMAKE_VERBOSE=1'。如果你由于某些原因直接调用了emake,你可以设置'emake VERBOSE=1' (注意cmake-utils_src_compile在make中也是可以带参数的)

-

对于基于 autotools 的编译系统,你可以给econf传递选项'--disable-silent-rules'。 或者用EAPI 5让参数自动传递,设置'emake V=1'也是可以的。

-

-For custom Makefiles you often have to write a patch. Try to get upstream to include an -option like 'V=1' to enable full verbosity. -

对于自定义的Makefiles,你必须经常写补丁。回溯上游的时候尝试使用例如'V=1'这样的可以记录详细情况的选项。 +

In case you encounter an affected package which uses a build system not controllable by portage or eclasses you should file a bug (preferably with a patch) and make it block the tracker bug #429308. Solutions above ebuild level are