manual.txt: misc tweaks/improvements.
This commit is contained in:
parent
7058175e8b
commit
7b7b671ce0
|
@ -38,14 +38,6 @@ homepage="http://www.foo.org"
|
|||
distfiles="http://www.foo.org/foo-${version}.tar.gz"
|
||||
checksum="fea0a94d4b605894f3e2d5572e3f96e4413bcad3a085aae7367c2cf07908b2ff"
|
||||
|
||||
## optional
|
||||
foo-devel_package() {
|
||||
short_desc+=" - development files"
|
||||
depends="..."
|
||||
pkg_install() {
|
||||
vmove usr/include
|
||||
}
|
||||
}
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
@ -57,15 +49,50 @@ Don't worry if anything is not clear as it should be. The reserved `variables`
|
|||
and `functions` will be explained later. This `template` file should be created
|
||||
in a directory matching `$pkgname`, i.e: `xbps-packages/srcpkgs/foo/template`.
|
||||
If everything went fine after running `xbps-src build-pkg` a binary package
|
||||
called `foo-1.0_1.<arch>.xbps` will be generated in the local repository.
|
||||
called `foo-1.0_1.<arch>.xbps` will be generated in the local repository:
|
||||
`<masterdir>/host/binpkgs`.
|
||||
|
||||
Additional binary packages (those defined in `_package() blocks` need a
|
||||
symlink to the `main` package), like this:
|
||||
Subpackages
|
||||
-----------
|
||||
|
||||
In the example shown above just a binary package is generated, but with some
|
||||
simple tweaks multiple binary packages can be generated from a single
|
||||
template/build, this is called `subpackages`.
|
||||
|
||||
To create additional `subpackages` the `template` must define a new function
|
||||
with this naming: `<subpkgname>_package()`, i.e:
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
# Template file for 'foo'
|
||||
|
||||
pkgname="foo"
|
||||
version="1.0"
|
||||
revision=1
|
||||
build_style=gnu-configure
|
||||
short_desc="A short description max 72 chars"
|
||||
maintainer="name <email>"
|
||||
license="GPL-3"
|
||||
homepage="http://www.foo.org"
|
||||
distfiles="http://www.foo.org/foo-${version}.tar.gz"
|
||||
checksum="fea0a94d4b605894f3e2d5572e3f96e4413bcad3a085aae7367c2cf07908b2ff"
|
||||
|
||||
# foo-devel is a subpkg
|
||||
foo-devel_package() {
|
||||
short_desc+=" - development files"
|
||||
depends="${sourcepkg}>=${version}_${revision}"
|
||||
pkg_install() {
|
||||
vmove usr/include
|
||||
vmove usr/lib/pkgconfig
|
||||
}
|
||||
}
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
All subpackages need an additional symlink to the `main` pkg, i.e:
|
||||
|
||||
----------------------------------
|
||||
|
||||
/srcpkgs
|
||||
|- foo <- directory
|
||||
|- foo <- directory (main pkg)
|
||||
| |- template
|
||||
|- foo-devel <- symlink to `foo`
|
||||
|
||||
|
@ -110,30 +137,26 @@ The following functions are defined by `xbps-src` and can be used on any templat
|
|||
*vinstall()*::
|
||||
`vinstall <file> <mode> <targetdir> [<name>]`
|
||||
|
||||
Installs `file` with the specified `mode` into `targetdir` in `$DESTDIR`
|
||||
(if called from a `source section`) or `$PKGDESTDIR` (if called from a `package section`).
|
||||
Installs `file` with the specified `mode` into `targetdir` into the pkg `$DESTDIR`
|
||||
The optional 4th argument can be used to change the `file name`.
|
||||
|
||||
*vcopy()*::
|
||||
`vcopy <pattern> <targetdir>`
|
||||
|
||||
Copies resursively all files in `pattern` to `targetdir` on `$DESTDIR`
|
||||
(if called from a `source section`) or `$PKGDESTDIR` (if called from a `package section`).
|
||||
Copies resursively all files in `pattern` to `targetdir` into the pkg `$DESTDIR`
|
||||
|
||||
*vmove()*::
|
||||
`vmove <pattern>`
|
||||
|
||||
Moves `pattern` to the specified directory in `$DESTDIR`
|
||||
(if called from a `source section`) or `$PKGDESTDIR` (if called from a `package section`).
|
||||
Moves `pattern` to the specified directory in the pkg `$DESTDIR`
|
||||
|
||||
*vmkdir()*::
|
||||
`vmkdir <directory> [<mode>]`
|
||||
|
||||
Creates a directory in `$DESTDIR` (if called from a `source section`) or
|
||||
`$PKGDESTDIR` (if called from a `package section`). The 2nd optional argument
|
||||
sets the mode of the directory.
|
||||
Creates a directory in the pkg `$DESTDIR`.
|
||||
The 2nd optional argument sets the mode of the directory.
|
||||
|
||||
NOTE: shell wildcards must be properly quoted.
|
||||
NOTE: shell wildcards must be properly quoted, i.e `vmove "usr/lib/*.a"`.
|
||||
|
||||
Global variables
|
||||
----------------
|
||||
|
|
Loading…
Reference in New Issue