209 lines
No EOL
5 KiB
Markdown
209 lines
No EOL
5 KiB
Markdown
# Deb-Mock Configuration
|
|
|
|
Deb-Mock uses YAML configuration files to define build environments and behavior. This document describes all available configuration options.
|
|
|
|
## Configuration File Format
|
|
|
|
Deb-Mock configuration files use YAML format. Here's a complete example:
|
|
|
|
```yaml
|
|
# Basic configuration
|
|
chroot_name: bookworm-amd64
|
|
architecture: amd64
|
|
suite: bookworm
|
|
output_dir: ./output
|
|
keep_chroot: false
|
|
verbose: false
|
|
debug: false
|
|
|
|
# Chroot configuration
|
|
chroot_dir: /var/lib/deb-mock/chroots
|
|
chroot_config_dir: /etc/schroot/chroot.d
|
|
|
|
# sbuild configuration
|
|
sbuild_config: /etc/sbuild/sbuild.conf
|
|
sbuild_log_dir: /var/log/sbuild
|
|
|
|
# Build configuration
|
|
build_deps: []
|
|
build_env:
|
|
DEB_BUILD_OPTIONS: parallel=4
|
|
DEB_BUILD_PROFILES: nocheck
|
|
build_options:
|
|
- --verbose
|
|
- --debug
|
|
|
|
# Metadata configuration
|
|
metadata_dir: ./metadata
|
|
capture_logs: true
|
|
capture_changes: true
|
|
```
|
|
|
|
## Configuration Options
|
|
|
|
### Basic Configuration
|
|
|
|
| Option | Type | Default | Description |
|
|
|--------|------|---------|-------------|
|
|
| `chroot_name` | string | `bookworm-amd64` | Name of the chroot environment to use |
|
|
| `architecture` | string | `amd64` | Target architecture for builds |
|
|
| `suite` | string | `bookworm` | Debian suite (bookworm, sid, bullseye, buster) |
|
|
| `output_dir` | string | `./output` | Directory for build artifacts |
|
|
| `keep_chroot` | boolean | `false` | Whether to keep chroot after build |
|
|
| `verbose` | boolean | `false` | Enable verbose output |
|
|
| `debug` | boolean | `false` | Enable debug output |
|
|
|
|
### Chroot Configuration
|
|
|
|
| Option | Type | Default | Description |
|
|
|--------|------|---------|-------------|
|
|
| `chroot_dir` | string | `/var/lib/deb-mock/chroots` | Directory for chroot environments |
|
|
| `chroot_config_dir` | string | `/etc/schroot/chroot.d` | Directory for schroot configuration files |
|
|
|
|
### sbuild Configuration
|
|
|
|
| Option | Type | Default | Description |
|
|
|--------|------|---------|-------------|
|
|
| `sbuild_config` | string | `/etc/sbuild/sbuild.conf` | Path to sbuild configuration file |
|
|
| `sbuild_log_dir` | string | `/var/log/sbuild` | Directory for sbuild logs |
|
|
|
|
### Build Configuration
|
|
|
|
| Option | Type | Default | Description |
|
|
|--------|------|---------|-------------|
|
|
| `build_deps` | list | `[]` | Additional build dependencies to install |
|
|
| `build_env` | dict | `{}` | Environment variables for builds |
|
|
| `build_options` | list | `[]` | Additional sbuild options |
|
|
|
|
### Metadata Configuration
|
|
|
|
| Option | Type | Default | Description |
|
|
|--------|------|---------|-------------|
|
|
| `metadata_dir` | string | `./metadata` | Directory for build metadata |
|
|
| `capture_logs` | boolean | `true` | Whether to capture build logs |
|
|
| `capture_changes` | boolean | `true` | Whether to capture .changes files |
|
|
|
|
## Supported Architectures
|
|
|
|
- `amd64` - 64-bit x86
|
|
- `i386` - 32-bit x86
|
|
- `arm64` - 64-bit ARM
|
|
- `armhf` - 32-bit ARM (hard float)
|
|
- `ppc64el` - 64-bit PowerPC (little endian)
|
|
- `s390x` - 64-bit IBM S390
|
|
|
|
## Supported Suites
|
|
|
|
- `bookworm` - Debian 12 (stable)
|
|
- `sid` - Debian unstable
|
|
- `bullseye` - Debian 11 (oldstable)
|
|
- `buster` - Debian 10 (oldoldstable)
|
|
|
|
## Environment Variables
|
|
|
|
Common environment variables you can set in `build_env`:
|
|
|
|
```yaml
|
|
build_env:
|
|
DEB_BUILD_OPTIONS: parallel=4,nocheck
|
|
DEB_BUILD_PROFILES: nocheck
|
|
DEB_CFLAGS_SET: -O2
|
|
DEB_CXXFLAGS_SET: -O2
|
|
DEB_LDFLAGS_SET: -Wl,-z,defs
|
|
```
|
|
|
|
## Build Options
|
|
|
|
Common sbuild options you can add to `build_options`:
|
|
|
|
```yaml
|
|
build_options:
|
|
- --verbose
|
|
- --debug
|
|
- --no-clean-source
|
|
- --no-run-lintian
|
|
- --no-run-autopkgtest
|
|
```
|
|
|
|
## Configuration File Locations
|
|
|
|
Deb-Mock looks for configuration files in the following order:
|
|
|
|
1. Command line specified file (`--config` option)
|
|
2. `./deb-mock.conf`
|
|
3. `~/.config/deb-mock/config.yaml`
|
|
4. `/etc/deb-mock/config.yaml`
|
|
5. Default configuration
|
|
|
|
## Example Configurations
|
|
|
|
### Minimal Configuration
|
|
|
|
```yaml
|
|
chroot_name: bookworm-amd64
|
|
architecture: amd64
|
|
suite: bookworm
|
|
```
|
|
|
|
### Development Configuration
|
|
|
|
```yaml
|
|
chroot_name: sid-amd64
|
|
architecture: amd64
|
|
suite: sid
|
|
output_dir: ./build-output
|
|
keep_chroot: true
|
|
verbose: true
|
|
debug: true
|
|
build_env:
|
|
DEB_BUILD_OPTIONS: parallel=8,nocheck
|
|
DEB_BUILD_PROFILES: nocheck
|
|
build_options:
|
|
- --verbose
|
|
- --no-run-lintian
|
|
```
|
|
|
|
### Production Configuration
|
|
|
|
```yaml
|
|
chroot_name: bookworm-amd64
|
|
architecture: amd64
|
|
suite: bookworm
|
|
output_dir: /var/lib/deb-mock/output
|
|
keep_chroot: false
|
|
verbose: false
|
|
debug: false
|
|
build_env:
|
|
DEB_BUILD_OPTIONS: parallel=4
|
|
build_options:
|
|
- --run-lintian
|
|
- --run-autopkgtest
|
|
metadata_dir: /var/lib/deb-mock/metadata
|
|
```
|
|
|
|
## Validation
|
|
|
|
Deb-Mock validates configuration files and will report errors for:
|
|
|
|
- Invalid architectures
|
|
- Invalid suites
|
|
- Missing required directories
|
|
- Invalid file paths
|
|
|
|
## Command Line Overrides
|
|
|
|
Most configuration options can be overridden on the command line:
|
|
|
|
```bash
|
|
# Override chroot
|
|
deb-mock build --chroot=sid-amd64 package.dsc
|
|
|
|
# Override architecture
|
|
deb-mock build --arch=arm64 package.dsc
|
|
|
|
# Override output directory
|
|
deb-mock build --output-dir=/tmp/build package.dsc
|
|
|
|
# Keep chroot for debugging
|
|
deb-mock build --keep-chroot package.dsc
|
|
``` |