From 4c3af89bc1de653a33dc0397a0dc1e63c6469cb8 Mon Sep 17 00:00:00 2001 From: Cem Keylan Date: Thu, 10 Sep 2020 14:00:02 +0300 Subject: update --- docs/docs/Chroot.html | 2 +- ...diting-the-build-file-during-pre_002dbuild.html | 85 +++++++++++ docs/docs/Environment-Variables.html | 159 +++++++++++++++++++++ docs/docs/Hooks.html | 95 ++++++++++++ docs/docs/Package-Manager.html | 9 +- docs/docs/Packaging-System.html | 24 ++-- docs/docs/Post_002dinstallation.html | 2 + docs/docs/Rsync-Repositories.html | 2 +- ...ng-up-an-rsync-repository-for-distribution.html | 2 +- docs/docs/Usage.html | 4 +- docs/docs/cpt_002dbuild.html | 2 +- docs/news.xml | 2 +- docs/rss.xml | 2 +- src/docs/Chroot.html | 2 +- ...diting-the-build-file-during-pre_002dbuild.html | 85 +++++++++++ src/docs/Environment-Variables.html | 159 +++++++++++++++++++++ src/docs/Hooks.html | 95 ++++++++++++ src/docs/Package-Manager.html | 9 +- src/docs/Packaging-System.html | 24 ++-- src/docs/Post_002dinstallation.html | 2 + src/docs/Rsync-Repositories.html | 2 +- ...ng-up-an-rsync-repository-for-distribution.html | 2 +- src/docs/Usage.html | 4 +- src/docs/cpt_002dbuild.html | 2 +- src/news.xml | 2 +- src/rss.xml | 2 +- texidocs | 2 +- 27 files changed, 735 insertions(+), 47 deletions(-) create mode 100644 docs/docs/Editing-the-build-file-during-pre_002dbuild.html create mode 100644 docs/docs/Environment-Variables.html create mode 100644 docs/docs/Hooks.html create mode 100644 src/docs/Editing-the-build-file-during-pre_002dbuild.html create mode 100644 src/docs/Environment-Variables.html create mode 100644 src/docs/Hooks.html diff --git a/docs/docs/Chroot.html b/docs/docs/Chroot.html index 07c41b5..f8d11ea 100644 --- a/docs/docs/Chroot.html +++ b/docs/docs/Chroot.html @@ -119,7 +119,7 @@ need to update twice.

Since you are operating on a really small base, you might need to build and install new programs to extend the functionality of your system. In order to build and install packages new packages in Carbs, you need to execute the -following. +following. “Package” is not actually a package and is given as an example.

$ cpt build package
diff --git a/docs/docs/Editing-the-build-file-during-pre_002dbuild.html b/docs/docs/Editing-the-build-file-during-pre_002dbuild.html
new file mode 100644
index 0000000..ba9b408
--- /dev/null
+++ b/docs/docs/Editing-the-build-file-during-pre_002dbuild.html
@@ -0,0 +1,85 @@
+
+
+
+
+
+
+Editing the build file during pre-build (Carbs Linux User Manual)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+Up: Hooks  

+
+
+

2.3.1 Editing the build file during pre-build

+ +

You can edit the build file during pre-build. The file is copied from the +repository to the build directory named as .build.cpt. You can use +sed or any other tool to edit the build file. After the build is +complete, a diff file will be placed to the package database named as +build.diff. Here is an example build file manipulation during the +pre-build hook. +

+
+
cat <<EOF> .build.cpt
+#!/bin/sh -e
+
+for patch in bash50-0??; do
+    patch -p0 < "\$patch"
+done
+
+export LDFLAGS=-static
+
+./configure \
+    --prefix=/usr \
+    --without-bash-malloc \
+    --disable-nls
+
+export MAKEFLAGS="TERMCAP_LIB=/usr/lib/libncursesw.a $MAKEFLAGS"
+
+make
+make DESTDIR="\$1" install
+
+ln -s bash "\$1/usr/bin/sh"
+EOF
+
+ + + + + + diff --git a/docs/docs/Environment-Variables.html b/docs/docs/Environment-Variables.html new file mode 100644 index 0000000..2482e37 --- /dev/null +++ b/docs/docs/Environment-Variables.html @@ -0,0 +1,159 @@ + + + + + + +Environment Variables (Carbs Linux User Manual) + + + + + + + + + + + + + + + + +
+

+Next: , Previous: , Up: Package Manager  

+
+
+

2.2 Environment Variables

+ +

Since there is no configuration file for cpt, the package manager is configured +through environment variables. These can be set per operation, or be set to your +shell configuration or ~/.profile. Here are the environment variables that +alter the behaviour of cpt: +

+
+
CPT_PATH
+

Set the locations of your repositories. This is set similar to the PATH +variable. +

+
XDG_CACHE_HOME
+

Unless this is set, the ~/.cache directory will be used instead. +

+
CPT_CACHE
+

The cache directory for cpt. Default: $XDG_CACHE_HOME/cpt +

+
CPT_CHOICE
+

If this is set to 0, a package installation will be aborted on conflicts. +Default: 1 +

+
CPT_COMPRESS
+

Program used to compress package tarballs. The values should be the default +suffixes for the program. Available values are: +

    +
  • gz +
  • zst +
  • bz2 +
  • xz +
+

Default: gz +

+
CPT_DEBUG
+

If this is set to 1, temporary build directories will not be removed after the +given operation. Default: unset +

+
CPT_FETCH
+

If this is set to 0, cpt-update will not fetch the repositories. +This behaviour can also be achieved by adding -n or --no-fetch +as an argument. Default: 0 +

+
CPT_FORCE
+

If this is set to 1, some of the cpt tools will continue regardless of +errors or skip certain checks. Here are some examples: +

+
    +
  • cpt-install will install a package without verifying its manifest. +
  • cpt-install will install a package even when there are missing +dependencies. +
  • cpt-remove will remove packages even when there are other packages +that depend on the current package. +
+ +

This behaviour can also be achieved by adding -f or --force +as an argument to those utilities. +

+

Default: 0 +

+
+
CPT_HOOK
+

Location for the hook file See Hooks. Default: unset +

+
CPT_KEEPLOG
+

Normally, logs are deleted if the package is built successfully. If set to 1, +logs will be kept even when the packages are built as intended. Default: 0 +

+
CPT_PID
+

If this variable is set, the temporary files will be created with this variable +as the suffix, instead of the PID of the cpt process. The advantage +is that you can know exactly where the build directory is located, while the +disadvantage is that there will be issues with multiple operations at the +same time. So the best way to use this variable is during one-time cpt +calls. +

+
CPT_PID=mesa cpt b mesa
+
+

By running the above, you will know that the created build directories will end +with the *-mesa suffix. +

+
CPT_PROMPT
+

If set to 0, the package manager will not prompt you for anything and will +continue with the default action. This behaviour can also be achieved by adding -y or --no-prompt +as an argument to some utilities. +Default: 1 +

+
CPT_ROOT
+

If this variable is set, cpt will assume this as the system root, and +will install/remove/update/list packages assuming this is the system root. +This behaviour can also be achieved by adding --root as an argument to some utilities. +

+
CPT_TEST
+

If set to 1, cpt-build will run tests where a package has the +test build file. This behaviour can also be achieved by adding -t or --test +as an argument to cpt-build. Default: 0 +

+
CPT_TMPDIR
+

The directory to create the build files. This can be changed (for example to +/tmp) for building on RAM, saving SSD space, etc. Default: $CPT_CACHE +

+
+ +
+
+

+Next: , Previous: , Up: Package Manager  

+
+ + + + + diff --git a/docs/docs/Hooks.html b/docs/docs/Hooks.html new file mode 100644 index 0000000..113738b --- /dev/null +++ b/docs/docs/Hooks.html @@ -0,0 +1,95 @@ + + + + + + +Hooks (Carbs Linux User Manual) + + + + + + + + + + + + + + + + + +
+

2.3 Hooks

+ +

Hooks can be used in order to change the runtime behaviour of the package manager. +There are a variety of package hooks, mostly self explanatory: +

+
    +
  • pre-build +
  • post-build +
  • build-fail +
  • pre-test +
  • test-fail +
  • pre-install +
  • post-install +
  • pre-remove +
  • post-remove +
  • pre-fetch +
  • post-fetch +
  • post-package +
+ +

In order to use hooks, you will need to set the CPT_HOOK variable pointing +to your hook file. Your hook file MUST be a POSIX shell script as its +contents are sourced by the package manager. +

+

The hook is given 3 variables when it is executed. Those are: +

+
$TYPE
+

The type of the hook, (pre-build, post-build, etc.) +

+
$PKG
+

The package that cpt is currently working on. Can be null. +

+
$DEST
+

The destination of the operation. Can be null. +

+
+ + + + + + + + + + + diff --git a/docs/docs/Package-Manager.html b/docs/docs/Package-Manager.html index 1d78750..b5d178e 100644 --- a/docs/docs/Package-Manager.html +++ b/docs/docs/Package-Manager.html @@ -53,13 +53,16 @@ fork of the kiss package manager a single file package manager, it revolves around the shell library cpt-lib, and many tools that wrap around it.

- - + + - diff --git a/docs/docs/Packaging-System.html b/docs/docs/Packaging-System.html index 3c4538a..44f539d 100644 --- a/docs/docs/Packaging-System.html +++ b/docs/docs/Packaging-System.html @@ -16,7 +16,7 @@ Licensed under Gnu Free Documentation License. --> - + + + + + + +
+

+Up: Hooks  

+
+
+

2.3.1 Editing the build file during pre-build

+ +

You can edit the build file during pre-build. The file is copied from the +repository to the build directory named as .build.cpt. You can use +sed or any other tool to edit the build file. After the build is +complete, a diff file will be placed to the package database named as +build.diff. Here is an example build file manipulation during the +pre-build hook. +

+
+
cat <<EOF> .build.cpt
+#!/bin/sh -e
+
+for patch in bash50-0??; do
+    patch -p0 < "\$patch"
+done
+
+export LDFLAGS=-static
+
+./configure \
+    --prefix=/usr \
+    --without-bash-malloc \
+    --disable-nls
+
+export MAKEFLAGS="TERMCAP_LIB=/usr/lib/libncursesw.a $MAKEFLAGS"
+
+make
+make DESTDIR="\$1" install
+
+ln -s bash "\$1/usr/bin/sh"
+EOF
+
+ + + + + + diff --git a/src/docs/Environment-Variables.html b/src/docs/Environment-Variables.html new file mode 100644 index 0000000..2482e37 --- /dev/null +++ b/src/docs/Environment-Variables.html @@ -0,0 +1,159 @@ + + + + + + +Environment Variables (Carbs Linux User Manual) + + + + + + + + + + + + + + + + +
+

+Next: , Previous: , Up: Package Manager  

+
+
+

2.2 Environment Variables

+ +

Since there is no configuration file for cpt, the package manager is configured +through environment variables. These can be set per operation, or be set to your +shell configuration or ~/.profile. Here are the environment variables that +alter the behaviour of cpt: +

+
+
CPT_PATH
+

Set the locations of your repositories. This is set similar to the PATH +variable. +

+
XDG_CACHE_HOME
+

Unless this is set, the ~/.cache directory will be used instead. +

+
CPT_CACHE
+

The cache directory for cpt. Default: $XDG_CACHE_HOME/cpt +

+
CPT_CHOICE
+

If this is set to 0, a package installation will be aborted on conflicts. +Default: 1 +

+
CPT_COMPRESS
+

Program used to compress package tarballs. The values should be the default +suffixes for the program. Available values are: +

    +
  • gz +
  • zst +
  • bz2 +
  • xz +
+

Default: gz +

+
CPT_DEBUG
+

If this is set to 1, temporary build directories will not be removed after the +given operation. Default: unset +

+
CPT_FETCH
+

If this is set to 0, cpt-update will not fetch the repositories. +This behaviour can also be achieved by adding -n or --no-fetch +as an argument. Default: 0 +

+
CPT_FORCE
+

If this is set to 1, some of the cpt tools will continue regardless of +errors or skip certain checks. Here are some examples: +

+
    +
  • cpt-install will install a package without verifying its manifest. +
  • cpt-install will install a package even when there are missing +dependencies. +
  • cpt-remove will remove packages even when there are other packages +that depend on the current package. +
+ +

This behaviour can also be achieved by adding -f or --force +as an argument to those utilities. +

+

Default: 0 +

+
+
CPT_HOOK
+

Location for the hook file See Hooks. Default: unset +

+
CPT_KEEPLOG
+

Normally, logs are deleted if the package is built successfully. If set to 1, +logs will be kept even when the packages are built as intended. Default: 0 +

+
CPT_PID
+

If this variable is set, the temporary files will be created with this variable +as the suffix, instead of the PID of the cpt process. The advantage +is that you can know exactly where the build directory is located, while the +disadvantage is that there will be issues with multiple operations at the +same time. So the best way to use this variable is during one-time cpt +calls. +

+
CPT_PID=mesa cpt b mesa
+
+

By running the above, you will know that the created build directories will end +with the *-mesa suffix. +

+
CPT_PROMPT
+

If set to 0, the package manager will not prompt you for anything and will +continue with the default action. This behaviour can also be achieved by adding -y or --no-prompt +as an argument to some utilities. +Default: 1 +

+
CPT_ROOT
+

If this variable is set, cpt will assume this as the system root, and +will install/remove/update/list packages assuming this is the system root. +This behaviour can also be achieved by adding --root as an argument to some utilities. +

+
CPT_TEST
+

If set to 1, cpt-build will run tests where a package has the +test build file. This behaviour can also be achieved by adding -t or --test +as an argument to cpt-build. Default: 0 +

+
CPT_TMPDIR
+

The directory to create the build files. This can be changed (for example to +/tmp) for building on RAM, saving SSD space, etc. Default: $CPT_CACHE +

+
+ +
+
+

+Next: , Previous: , Up: Package Manager  

+
+ + + + + diff --git a/src/docs/Hooks.html b/src/docs/Hooks.html new file mode 100644 index 0000000..113738b --- /dev/null +++ b/src/docs/Hooks.html @@ -0,0 +1,95 @@ + + + + + + +Hooks (Carbs Linux User Manual) + + + + + + + + + + + + + + + + + +
+

2.3 Hooks

+ +

Hooks can be used in order to change the runtime behaviour of the package manager. +There are a variety of package hooks, mostly self explanatory: +

+
    +
  • pre-build +
  • post-build +
  • build-fail +
  • pre-test +
  • test-fail +
  • pre-install +
  • post-install +
  • pre-remove +
  • post-remove +
  • pre-fetch +
  • post-fetch +
  • post-package +
+ +

In order to use hooks, you will need to set the CPT_HOOK variable pointing +to your hook file. Your hook file MUST be a POSIX shell script as its +contents are sourced by the package manager. +

+

The hook is given 3 variables when it is executed. Those are: +

+
$TYPE
+

The type of the hook, (pre-build, post-build, etc.) +

+
$PKG
+

The package that cpt is currently working on. Can be null. +

+
$DEST
+

The destination of the operation. Can be null. +

+
+ + + + + + + + + + + diff --git a/src/docs/Package-Manager.html b/src/docs/Package-Manager.html index 1d78750..b5d178e 100644 --- a/src/docs/Package-Manager.html +++ b/src/docs/Package-Manager.html @@ -53,13 +53,16 @@ fork of the kiss package manager a single file package manager, it revolves around the shell library cpt-lib, and many tools that wrap around it.

- - + + - diff --git a/src/docs/Packaging-System.html b/src/docs/Packaging-System.html index 3c4538a..44f539d 100644 --- a/src/docs/Packaging-System.html +++ b/src/docs/Packaging-System.html @@ -16,7 +16,7 @@ Licensed under Gnu Free Documentation License. --> - +