manual.txt: misc tweaks/improvements.

This commit is contained in:
Juan RP 2014-02-07 04:34:23 +01:00
parent 7058175e8b
commit 7b7b671ce0

View File

@ -38,14 +38,6 @@ homepage="http://www.foo.org"
distfiles="http://www.foo.org/foo-${version}.tar.gz" distfiles="http://www.foo.org/foo-${version}.tar.gz"
checksum="fea0a94d4b605894f3e2d5572e3f96e4413bcad3a085aae7367c2cf07908b2ff" 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 and `functions` will be explained later. This `template` file should be created
in a directory matching `$pkgname`, i.e: `xbps-packages/srcpkgs/foo/template`. 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 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 Subpackages
symlink to the `main` package), like this: -----------
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 /srcpkgs
|- foo <- directory |- foo <- directory (main pkg)
| |- template | |- template
|- foo-devel <- symlink to `foo` |- 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()*::
`vinstall <file> <mode> <targetdir> [<name>]` `vinstall <file> <mode> <targetdir> [<name>]`
Installs `file` with the specified `mode` into `targetdir` in `$DESTDIR` Installs `file` with the specified `mode` into `targetdir` into the pkg `$DESTDIR`
(if called from a `source section`) or `$PKGDESTDIR` (if called from a `package section`).
The optional 4th argument can be used to change the `file name`. The optional 4th argument can be used to change the `file name`.
*vcopy()*:: *vcopy()*::
`vcopy <pattern> <targetdir>` `vcopy <pattern> <targetdir>`
Copies resursively all files in `pattern` to `targetdir` on `$DESTDIR` Copies resursively all files in `pattern` to `targetdir` into the pkg `$DESTDIR`
(if called from a `source section`) or `$PKGDESTDIR` (if called from a `package section`).
*vmove()*:: *vmove()*::
`vmove <pattern>` `vmove <pattern>`
Moves `pattern` to the specified directory in `$DESTDIR` Moves `pattern` to the specified directory in the pkg `$DESTDIR`
(if called from a `source section`) or `$PKGDESTDIR` (if called from a `package section`).
*vmkdir()*:: *vmkdir()*::
`vmkdir <directory> [<mode>]` `vmkdir <directory> [<mode>]`
Creates a directory in `$DESTDIR` (if called from a `source section`) or Creates a directory in the pkg `$DESTDIR`.
`$PKGDESTDIR` (if called from a `package section`). The 2nd optional argument The 2nd optional argument sets the mode of the directory.
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 Global variables
---------------- ----------------