From 7b7b671ce02e632dc3ba754fc6a3eb48ce9debf2 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 7 Feb 2014 04:34:23 +0100 Subject: [PATCH] manual.txt: misc tweaks/improvements. --- doc/manual.txt | 67 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 22 deletions(-) diff --git a/doc/manual.txt b/doc/manual.txt index 88bc6c801c6..d7db09340d6 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -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..xbps` will be generated in the local repository. +called `foo-1.0_1..xbps` will be generated in the local repository: +`/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: `_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 " +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 []` -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 ` -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 ` -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 []` -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 ----------------