knowledge/technology/applications/package managers/arch-linux/makepkg.md

60 lines
7.8 KiB
Markdown
Raw Normal View History

2023-12-04 10:02:23 +00:00
---
arch-wiki: https://wiki.archlinux.org/title/Makepkg
obj: application
---
# makepkg
2024-02-12 14:32:44 +00:00
makepkg is a tool for creating [pacman](Pacman.md) packages based on [PKGBUILD](PKGBUILD.md) files.
2023-12-04 10:02:23 +00:00
## Usage
Make a package:
```shell
makepkg
```
Make a package and install its dependencies:
```shell
makepkg --syncdeps
```
Make a package, install its dependencies then install it to the system:
```shell
makepkg --syncdeps --install
```
Make a package, but skip checking the source's hashes:
```shell
makepkg --skipchecksums
```
Clean up work directories after a successful build:
```shell
makepkg --clean
```
Verify the hashes of the sources:
```shell
makepkg --verifysource
```
## Options
| Option | Description |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `-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 |
2024-02-12 14:32:44 +00:00
| `-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). |
2024-01-17 08:00:45 +00:00
| `--skipinteg` | Do not perform any integrity checks (checksum and [PGP](../../../cryptography/GPG.md)) on source files |
2023-12-04 10:02:23 +00:00
| `--skipchecksums` | Do not verify checksums of source files |
2024-01-17 08:00:45 +00:00
| `--skippgpcheck` | Do not verify [PGP](../../../cryptography/GPG.md) signatures of source files |
2024-02-12 14:32:44 +00:00
| `-i, --install` | Install or upgrade the package after a successful build using [pacman](Pacman.md) |
2023-12-04 10:02:23 +00:00
| `-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 |
2024-02-12 14:32:44 +00:00
| `-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 |
2023-12-04 10:02:23 +00:00
| `-C, --cleanbuild` | Remove the $srcdir before building the package |
2024-02-12 14:32:44 +00:00
| `--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) |
2024-01-17 08:00:45 +00:00
| `--sign` | Sign the resulting package with [gpg](../../../cryptography/GPG.md) |
2023-12-04 10:02:23 +00:00
| `--nosign` | Do not create a signature for the built package |
| `--key <key>` | Specify a key to use when signing packages |
2024-02-12 14:32:44 +00:00
| `--noconfirm` | (Passed to [pacman](Pacman.md)) Prevent [pacman](Pacman.md) from waiting for user input before proceeding with operations |