From 7b7f104ac1ee305686da93e7470140af2450906e Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 22 Mar 2014 06:56:05 +0100 Subject: [PATCH] Update Manual.md --- Manual.md | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/Manual.md b/Manual.md index bd0ad0a1842..a4b252edede 100644 --- a/Manual.md +++ b/Manual.md @@ -37,8 +37,12 @@ generated with the definitions specified on it. 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: + +If everything went fine after running + + $ xbps-src build-pkg + +a binary package named `foo-1.0_1..xbps` will be generated in the local repository `/host/binpkgs`. ### Subpackages @@ -77,7 +81,8 @@ foo-devel_package() { } ``` -All subpackages need an additional symlink to the `main` pkg, i.e: +All subpackages need an additional symlink to the `main` pkg, otherwise dependencies +requiring those packages won't find its `template` i.e: ``` /srcpkgs @@ -86,8 +91,13 @@ All subpackages need an additional symlink to the `main` pkg, i.e: |- foo-devel <- symlink to `foo` ``` -Otherwise dependencies requiring those packages won't find its `template` -file. +An important point of `subpackages` is that they are processed after the main +package has run its `install` phase. The `pkg_install()` function specified on them +commonly is used to move files from the `main` package destdir to the `subpackage` destdir. + +The helper functions `vinstall`, `vmkdir`, `vcopy` and `vmove` are just wrappers that simplify +the process of creating, copying and moving files/directories between the `main` package +destdir (`$DESTDIR`) to the `subpackage` destdir (`$PKGDESTDIR`). ### Development packages @@ -106,10 +116,12 @@ If a development package provides a `pkg-config` file, you should verify what dependencies the package needs for dynamic or static linking, and add the appropiate `development` packages as dependencies. -## Package build phases +### Package build phases Building a package consist of the following phases: +- `setup` This phase prepares the environment for building a package. + - `fetch` This phase downloads required sources for a `source package`, as defined by the `distfiles` variable or `do_fetch()` function. @@ -123,7 +135,7 @@ function, which is the directory to be used to compile the `source package`. - `install` This phase installs the `package files` into a `fake destdir`, via `make install` or any other compatible method. -- `package` This phase builds the `binary packages` with files stored in the +- `pkg` This phase builds the `binary packages` with files stored in the `package destdir` and registers them into the local repository. `xbps-src` supports running just the specified phase, and if it ran