ebuild里的functions
pkg_setup 必须先做的各种任务,检查配置文件啥的
pkg_nofetch 显示点信息告诉user不能自动下载的原因,比如license问题
src_unpack解包,打补钉,运行辅助程序
src_compile配置和编译
src_install安装
src_test只有设置了FEATURES=”maketest”并且不设置RESTRICT=”maketest”才执行
pkg_preinst在merging之前做的事
pkg_postinst在merging之后做的事
pkg_prerm在删除之前做的事
pkg_postrm在删除之后做的事
pkg_config You use this function to setup an initial configuration for the package after it’s installed. All paths in this function should be prefixed with ROOT. This function is only executed if and when the user runs: ebuild /var/db/pkg/${CATEGORY}/${PF}/${PF}.ebuild config.
helper functions
use检查use标志
has_version如果指定某个包有需要的版本返回1。
例如:has_version >=sys-libs/glibc-2.3.0
best_version返回指定包的版本
use_with如果指定标志被定义了返回–with-foobar反之返回–without-foobar
use_enable如果指定标志被定义了返回–enable-foobar反之返回–disable-foobar
check_KV检查kernel的版本号
keepdir用于在指定的目录下创建一个.keep文件,以免被自动清楚。永远不要自己建这个.keep,否则如果以后portage改变对keepdir的处理方法就不能自动处理这个portage了
econf传递额外的参数给./configure
einstall传递额外的参数给make命令,注意不提倡用einstall替换make install DESTDIR=${D}
die搞死当前的进程,最好告诉为什么
einfo提醒用户重要的事