|
|
分包:
一直都很期待这个功能,可能出来的有段时间了。今天准备编译gstreamer支持oss的时候发现的
这样写打包软件的时候就可以分成很多包而不用编译两次,最典型的就是给内核打包。
方法:
大体上就是在pkgname处写多个名称,每个名称定义一个package_name()函数,自由定义包如何分。比如此处就是在build()函数里面编译,然后在两个子包package_gstreamer0.10-good和package_gstreamer0.10-good-plugins里面make install,只不过不同部分。
至于包的说明就都可以各自定义,默认使用最前面的定义。非常灵活
实例:
可以看看这个例子,应该不难理解。
http://repos.archlinux.org/viewv ... 6/PKGBUILD?view=log
文档:
从PKGBUILD的doc里面找到一点点资料,manpage和wiki上似乎都没有介绍:
分包
makepkg支持从单个PKGBUILD里面构建多个包。
这是通过定义PKGBUILD中的pkgname数组实现的。
每个子包使用相应的名称为'package_foo()'包函数,其中foo用子包的名称
每个子包的每个指令和选项默认使用全局指定的值,除非你在子包函数里面单独指定,如下变量可以被重新定义:
`pkgdesc`, `license`, `groups`, `depends`, `optdepends`, `provides`, `conflicts`, `replaces`, `backup`, `options` and `install`.
当构造一个分包的软件的时候,这个额外的指令(变量)可以使用:
*pkgbase*::这个名称用来在makepkg的时候输出显示时候使用。
当然,也可以用来构建只有源代码的包。
- Package Splitting
- -----------------
- makepkg supports building multiple packages from a single PKGBUILD. his is achieved
- by assigning an array of package names to the `pkgname` directive. Each sub-package
- uses a corresponding package function with name `package_foo()`, where `foo` is the
- name of the package.
- All options and directives for the split packages default to the global values given
- within the PKGBUILD. However, some of these can be overridden within each sub-package's
- package function. The following variables can be overridden: `pkgdesc`, `license`,
- `groups`, `depends`, `optdepends`, `provides`, `conflicts`, `replaces`, `backup`,
- `options` and `install`.
- An additional directive is available when building a split package:
- *pkgbase*::
- The name used to refer to the group of packages in the output of makepkg.
- Also, used when creating source-only tarballs.
复制代码
提示:
如果遇到提示- ERROR: missing package function for split package 'foo'
复制代码 或者的时候,检查是否存在package_foo()这个函数。 |
|