restructure

This commit is contained in:
JMARyA 2024-01-17 09:00:45 +01:00
parent ef7661245b
commit 598a10bc28
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
182 changed files with 342 additions and 336 deletions

View file

@ -6,4 +6,4 @@ obj: meta/collection
# Package Managers
- [Brew](Brew.md)
- [Flatpak](Flatpak.md)
- [Pacman](Pacman.md)
- [Pacman](arch-linux/Pacman.md)

View file

@ -4,7 +4,7 @@ source: https://wiki.alpinelinux.org/wiki/APKBUILD_Reference
---
# APKBUILD
APKBUILDs are the scripts that are created in order to build [Alpine Packages](Alpine%20Package.md) using the abuild tool on [Alpine Linux](../../linux/Alpine%20Linux.md).
APKBUILDs are the scripts that are created in order to build [Alpine Packages](alpine/Alpine%20Package.md) using the abuild tool on [Alpine Linux](../../../linux/Alpine%20Linux.md).
To generate a template APKBUILD to start from use `newapkbuild package_name-version` on your build system.
## abuild-defined variables
@ -27,11 +27,11 @@ The following variables should be defined by the user:
- `depends_libs` : Run-time dependency package(s) for the `$pkgname-libs` subpackage.
- `depends_static` : Run-time dependency package(s) for the `$pkgname-static` subpackage.
- `checkdepends` : Dependencies that are only required during the check phase, they are only installed if the check option is enabled
- `giturl` : [Git](../../dev/Git.md) repository from which abuild checkout checks out. You can checkout a specific branch in [git](../../dev/Git.md) by adding `-b $branch`.
- `giturl` : [Git](../../../dev/Git.md) repository from which abuild checkout checks out. You can checkout a specific branch in [git](../../../dev/Git.md) by adding `-b $branch`.
- `install` : There are 6 different types of install scripts. Install scripts are named `$pkgname.action`, where action can be: `pre-install`, `post-install`, `pre-upgrade`, `post-upgrade`, `pre-deinstall`, or `post-deinstall`. For example, if `pkgname` is set to mypackage and install is set to `$pkgname.post-install`, then a script named `mypackage.post-install` must exist along-side the APKBUILD.
- `$pkgname.pre-install` : This script is executed before installing the package. Typical use is when the package needs a group and a user to be created.
- `$pkgname.post-install` : This script is executed after installing the package.
- `$pkgname.pre-upgrade` : This script is executed before upgrading/downgrading/reinstalling the package. Note that exiting with failure will not cause [apk](apk.md) to exit with failure, but will mark the package as broken.
- `$pkgname.pre-upgrade` : This script is executed before upgrading/downgrading/reinstalling the package. Note that exiting with failure will not cause [apk](alpine/apk.md) to exit with failure, but will mark the package as broken.
- `$pkgname.post-upgrade` : This script is executed after upgrading/downgrading/reinstalling the package.
- `$pkgname.pre-deinstall` : This script is executed before uninstalling the package.
- `$pkgname.post-deinstall` : This script is executed after uninstalling the package.
@ -63,15 +63,15 @@ The following variables should be defined by the user:
- `pkgdesc` : A brief, one-line description of what the package does.
- `pkggroups` : System group(s) to be created during build-time. System group(s) should also be created in the `$pkgname.pre-install` script, so that the system group(s) are also created prior to package installation for run-time use.
- `pkgname` : The name of the package. All letters should be lowercase.
- `pkgrel` : [Alpine package](Alpine%20Package.md) release number. Starts at 0 (zero). Always increment pkgrel when making updates to an aport; reset pkgrel to 0 (zero) when incrementing pkgver.
- `pkgrel` : [Alpine package](alpine/Alpine%20Package.md) release number. Starts at 0 (zero). Always increment pkgrel when making updates to an aport; reset pkgrel to 0 (zero) when incrementing pkgver.
- `pkgusers` : System user(s) to be created during build-time. System user(s) should also be created in the `$pkgname.pre-install` script, so that the system user(s) are also created prior to package installation for run-time use.
- `pkgver` : The version of the software being packaged. Format for valid versions: `{digit}{.digit}...{letter}{_suf{#}}...{-r#}`. A Suffix suf in the above format can be one of the following to indicate that the release is less recent than the version without the suffix: `alpha`, `beta`, `pre`, `rc`. These are for indicating more recent releases: `cvs`, `svn`, `git`, `hg`, `p`. All other suffices are invalid. To package a specific [git](../../dev/Git.md) commit, the date of the commit gets appended to the latest release, e.g. `1.0.0_git20180204`.
- `provides` : List of package names (and optionally version info) this package provides. If package with a version is provided (provides='foo=1.2') [apk](apk.md) will consider it as an alternate name and it will automatically consider the package for installation by the alternate name, and conflict with other packages having the same name, or provides. If version is not provided (provides='foo'), [apk](apk.md) will consider it as virtual package name. Several package with same non-versioned provides can be installed simultaneously. However, none of them will be installed by default when requested by the virtual name - instead, error message is given and user is asked to choose which package providing the virtual name should be installed.
- `pkgver` : The version of the software being packaged. Format for valid versions: `{digit}{.digit}...{letter}{_suf{#}}...{-r#}`. A Suffix suf in the above format can be one of the following to indicate that the release is less recent than the version without the suffix: `alpha`, `beta`, `pre`, `rc`. These are for indicating more recent releases: `cvs`, `svn`, `git`, `hg`, `p`. All other suffices are invalid. To package a specific [git](../../../dev/Git.md) commit, the date of the commit gets appended to the latest release, e.g. `1.0.0_git20180204`.
- `provides` : List of package names (and optionally version info) this package provides. If package with a version is provided (provides='foo=1.2') [apk](alpine/apk.md) will consider it as an alternate name and it will automatically consider the package for installation by the alternate name, and conflict with other packages having the same name, or provides. If version is not provided (provides='foo'), [apk](alpine/apk.md) will consider it as virtual package name. Several package with same non-versioned provides can be installed simultaneously. However, none of them will be installed by default when requested by the virtual name - instead, error message is given and user is asked to choose which package providing the virtual name should be installed.
- `provider_priority` : A numeric value which is used by apk-tools to break ties when choosing a virtual package to satisfy a dependency. Higher values have higher priority. The primary use case is to specify the primary package that satisfies a virtual (provider).
- `replaces` : Allow this package to be installed at the same time as the listed packages, even if they have conflicting files. The files from this package will override ("take over") the conflicting files. This can be used to override config files with "policy packages".Another use case is renaming packages (or moving files from one package to another): "replaces" will avoid the file conflict error that [apk](apk.md) reports if it happens to install the new package before uninstalling the old package. A common misconception is that "replaces" is used to replace packages (like in [PKGBUILD](PKGBUILD.md)). This is not the case, it is only for solving file conflicts. To let [apk](apk.md) consider installing one package instead of another one, refer to provides (with the version).
- `replaces` : Allow this package to be installed at the same time as the listed packages, even if they have conflicting files. The files from this package will override ("take over") the conflicting files. This can be used to override config files with "policy packages".Another use case is renaming packages (or moving files from one package to another): "replaces" will avoid the file conflict error that [apk](alpine/apk.md) reports if it happens to install the new package before uninstalling the old package. A common misconception is that "replaces" is used to replace packages (like in [PKGBUILD](../arch-linux/PKGBUILD.md)). This is not the case, it is only for solving file conflicts. To let [apk](alpine/apk.md) consider installing one package instead of another one, refer to provides (with the version).
- `replaces_priority` : The priority of the replaces. If multiple packages replace files of each other, then the package with the highest replaces_priority will win.
- `source` : The source variable is not only used to list the remote source files to fetch, it is also used to list the local files that abuild will need in order to build the apk. Examples of such local files include: init.d files, conf.d files, install files (see install variable), patches, and all other necessary files.
- `triggers` : Apk-tools can "monitor" directories and execute a trigger if any package installed/uninstalled any file in the monitored dir. The triggers are always executed after the [apk](apk.md) action (install, uninstall, upgrade). The triggers are specified in the format: `scriptname=pathlist` where scriptname is the (sub)package name + `.trigger` suffix and pathlist is `:` separated list of the dirs to monitor. The triggers variable must include the triggers for subpackages too if they have any. It is possible to use wildcards (`*`) in the dir list.
- `triggers` : Apk-tools can "monitor" directories and execute a trigger if any package installed/uninstalled any file in the monitored dir. The triggers are always executed after the [apk](alpine/apk.md) action (install, uninstall, upgrade). The triggers are specified in the format: `scriptname=pathlist` where scriptname is the (sub)package name + `.trigger` suffix and pathlist is `:` separated list of the dirs to monitor. The triggers variable must include the triggers for subpackages too if they have any. It is possible to use wildcards (`*`) in the dir list.
- `url` : The homepage for the package. This is to help users find upstream documentation and other information regarding the package.
## Functions

View file

@ -4,10 +4,10 @@ source: https://wiki.alpinelinux.org/wiki/Creating_an_Alpine_package
---
# Alpine Package
Alpine Packages are packages for [Alpine Linux](../../linux/Alpine%20Linux.md) and installable via [apk](apk.md).
Alpine Packages are packages for [Alpine Linux](../../../linux/Alpine%20Linux.md) and installable via [apk](apk.md).
## Setup
The alpine-sdk is a metapackage that pulls in the most essential packages used to build new packages. Also install and configure a way to elevate privileges, such as sudo or [doas](../cli/doas.md), and an editor, such as vi, nano, [micro](../cli/micro.md).
The alpine-sdk is a metapackage that pulls in the most essential packages used to build new packages. Also install and configure a way to elevate privileges, such as sudo or [doas](../../cli/system/doas.md), and an editor, such as vi, nano, [micro](../../cli/micro.md).
```shell
apk add alpine-sdk
addgroup user abuild

View file

@ -3,9 +3,9 @@ obj: application
---
# APK
APK is a package manager used on [Alpine Linux](../../linux/Alpine%20Linux.md).
APK is a package manager used on [Alpine Linux](../../../linux/Alpine%20Linux.md).
Software packages for [Alpine Linux](../../linux/Alpine%20Linux.md) are digitally signed [tar.gz](../cli/tar.md) archives containing programs, configuration files, and dependency metadata. They have the extension `.apk`, and are often called "a-packs".
Software packages for [Alpine Linux](../../../linux/Alpine%20Linux.md) are digitally signed [tar.gz](../../cli/compression/tar.md) archives containing programs, configuration files, and dependency metadata. They have the extension `.apk`, and are often called "a-packs".
The packages are stored in one or more repositories. A repository is simply a directory with a collection of `*.apk` files. The directory must include a special index file, named `APKINDEX.tar.gz` to be considered a repository.
@ -85,7 +85,7 @@ Give detailed information about packages or repositories
| `-r, --rdepends` | List reverse dependencies of the package (all other packages which depend on the package) |
| `-R, --depends` | List the dependencies of the package |
| `-s, --size` | Print the package's installed size |
| `-w, --webpage` | Print the [URL](../../internet/URL.md) for the package's upstream webpage |
| `-w, --webpage` | Print the [URL](../../../internet/URL.md) for the package's upstream webpage |
### `apk list`
List packages matching a pattern or other criteria
@ -118,7 +118,7 @@ apk fetch downloads the requested packages from the configured package repositor
| `-s, --stdout` | Dump the .apk file(s) to stdout |
| `-w, --world` | Download packages needed to satisfy WORLD |
| `--simulate` | Simulate the requested operation without making any changes |
| `--url` | Print the full [URL](../../internet/URL.md) for downloaded packages |
| `--url` | Print the full [URL](../../../internet/URL.md) for downloaded packages |
### `apk manifest`
Show checksums of package contents

View file

@ -5,9 +5,9 @@ obj: concept
# PKGBUILD
A `PKGBUILD` is a shell script containing the build information required by [Arch Linux](../../linux/Arch%20Linux.md) packages. [Arch Wiki](https://wiki.archlinux.org/title/PKGBUILD)
A `PKGBUILD` is a shell script containing the build information required by [Arch Linux](../../../linux/Arch%20Linux.md) packages. [Arch Wiki](https://wiki.archlinux.org/title/PKGBUILD)
Packages in [Arch Linux](../../linux/Arch%20Linux.md) are built using the [makepkg](makepkg.md) utility. When [makepkg](makepkg.md) is run, it searches for a PKGBUILD file in the current directory and follows the instructions therein to either compile or otherwise acquire the files to build a package archive (pkgname.pkg.tar.zst). The resulting package contains binary files and installation instructions, readily installable with [pacman](Pacman.md).
Packages in [Arch Linux](../../../linux/Arch%20Linux.md) are built using the [makepkg](makepkg.md) utility. When [makepkg](makepkg.md) is run, it searches for a PKGBUILD file in the current directory and follows the instructions therein to either compile or otherwise acquire the files to build a package archive (pkgname.pkg.tar.zst). The resulting package contains binary files and installation instructions, readily installable with [pacman](Pacman.md).
Mandatory variables are `pkgname`, `pkgver`, `pkgrel`, and `arch`. `license` is not strictly necessary to build a package, but is recommended for any PKGBUILD shared with others, as [makepkg](makepkg.md) will produce a warning if not present.

View file

@ -2,7 +2,7 @@
obj: application
---
# Pacman
Pacman is the default [Arch Linux](../../linux/Arch%20Linux.md) Package Manager
Pacman is the default [Arch Linux](../../../linux/Arch%20Linux.md) Package Manager
## Usage
Search for a package:

View file

@ -4,7 +4,7 @@ obj: application
---
# makepkg
makepkg is a tool for creating [pacman](Pacman.md) packages based on [PKGBUILD](PKGBUILD.md) files.
makepkg is a tool for creating [pacman](arch-linux/Pacman.md) packages based on [PKGBUILD](arch-linux/PKGBUILD.md) files.
## Usage
Make a package:
@ -43,17 +43,17 @@ makepkg --verifysource
| `-A, --ignorearch` | Ignore a missing or incomplete arch field in the build script |
| `-c, --clean` | Clean up leftover work files and directories after a successful build |
| `-d, --nodeps` | Do not perform any dependency checks. This will let you override and ignore any dependencies required. There is a good chance this option will break the build process if all of the dependencies are not installed |
| `-e, --noextract` | Do not extract source files or run the prepare() function (if present); use whatever source already exists in the $srcdir/ directory. This is handy if you want to go into $srcdir/ and manually patch or tweak code, then make a package out of the result. Keep in mind that creating a patch may be a better solution to allow others to use your [PKGBUILD](PKGBUILD.md). |
| `--skipinteg` | Do not perform any integrity checks (checksum and [PGP](../../tools/GPG.md)) on source files |
| `-e, --noextract` | Do not extract source files or run the prepare() function (if present); use whatever source already exists in the $srcdir/ directory. This is handy if you want to go into $srcdir/ and manually patch or tweak code, then make a package out of the result. Keep in mind that creating a patch may be a better solution to allow others to use your [PKGBUILD](arch-linux/PKGBUILD.md). |
| `--skipinteg` | Do not perform any integrity checks (checksum and [PGP](../../../cryptography/GPG.md)) on source files |
| `--skipchecksums` | Do not verify checksums of source files |
| `--skippgpcheck` | Do not verify [PGP](../../tools/GPG.md) signatures of source files |
| `-i, --install` | Install or upgrade the package after a successful build using [pacman](Pacman.md) |
| `--skippgpcheck` | Do not verify [PGP](../../../cryptography/GPG.md) signatures of source files |
| `-i, --install` | Install or upgrade the package after a successful build using [pacman](arch-linux/Pacman.md) |
| `-o, --nobuild` | Download and extract files, run the prepare() function, but do not build them. Useful with the `--noextract` option if you wish to tweak the files in $srcdir/ before building |
| `-r, --rmdeps` | Upon successful build, remove any dependencies installed by makepkg during dependency auto-resolution and installation |
| `-s, --syncdeps` | Install missing dependencies using [pacman](Pacman.md). When build-time or run-time dependencies are not found, [pacman](Pacman.md) will try to resolve them. If successful, the missing packages will be downloaded and installed |
| `-s, --syncdeps` | Install missing dependencies using [pacman](arch-linux/Pacman.md). When build-time or run-time dependencies are not found, [pacman](arch-linux/Pacman.md) will try to resolve them. If successful, the missing packages will be downloaded and installed |
| `-C, --cleanbuild` | Remove the $srcdir before building the package |
| `--noarchive` | Do not create the archive at the end of the build process. This can be useful to test the package() function or if your target distribution does not use [pacman](Pacman.md) |
| `--sign` | Sign the resulting package with [gpg](../../tools/GPG.md) |
| `--noarchive` | Do not create the archive at the end of the build process. This can be useful to test the package() function or if your target distribution does not use [pacman](arch-linux/Pacman.md) |
| `--sign` | Sign the resulting package with [gpg](../../../cryptography/GPG.md) |
| `--nosign` | Do not create a signature for the built package |
| `--key <key>` | Specify a key to use when signing packages |
| `--noconfirm` | (Passed to [pacman](Pacman.md)) Prevent [pacman](Pacman.md) from waiting for user input before proceeding with operations |
| `--noconfirm` | (Passed to [pacman](arch-linux/Pacman.md)) Prevent [pacman](arch-linux/Pacman.md) from waiting for user input before proceeding with operations |