config.md 2.7 KB
Newer Older
Jakub Ružička's avatar
Jakub Ružička committed
1
2
# apkg config

3
`apkg` looks for config file `distro/config/apkg.toml`.
Jakub Ružička's avatar
Jakub Ružička committed
4
5
6

Please see {{ 'distro/config/apkg.toml' | file_link }} for up-to-date example.

7
8
9
This document describes apkg configuration
[compat level](#apkgcompat) **{{ compat_level }}**.

Jakub Ružička's avatar
Jakub Ružička committed
10

11
12
13
## [project]

The primary config section containing project-specific settings.
Jakub Ružička's avatar
Jakub Ružička committed
14
15
16

### project.name

17
18
19
By default, project name is guessed from project dir name but that can break
easily when the project dir is renamed so it's better to specify it explicitly
in using `project.name`
Jakub Ružička's avatar
Jakub Ružička committed
20
21
22
23
24
25
26
27
28
29

```
[project]
name = "banana"
```

This is available to templates through {% raw %}`{{ project.name }}`{% endraw %}.

### project.make_archive_script

30
31
In order to create packages from your project source, `apkg` requires a script
which creates archive from current project state.
Jakub Ružička's avatar
Jakub Ružička committed
32

33
The script MUST return the path to created archive on first line of its
34
`stdout`.
Jakub Ružička's avatar
Jakub Ružička committed
35

36
37
38
The script can output additional files (such as signatures) and print their
paths on individual `stdout` lines after the main archive.

Jakub Ružička's avatar
Jakub Ružička committed
39
40
41
42
43
44
45
Include such script in your project and then point to it using `make_archive_script`:

```
[project]
make_archive_script = "scripts/make-dev-archive.sh"
```

46
47
48
script example: {{ 'scripts/make-dev-archive.sh' | file_link  }}

## [upstream]
Jakub Ružička's avatar
Jakub Ružička committed
49

50
Config section related to project upstream settings.
Jakub Ružička's avatar
Jakub Ružička committed
51

52
53
54
55
56
### upstream.archive_url

To easily download upstream archives using `apkg` you can specify
`upstream.archive_url` with [templating](templates.md) available including
special `version` variable:
Jakub Ružička's avatar
Jakub Ružička committed
57
58
59

{% raw %}
```
60
61
[upstream]
archive_url = "https://banana.proj/dl/{{ project.name }}/{{ project.name }}-{{ version }}.tar.xz"
Jakub Ružička's avatar
Jakub Ružička committed
62
63
```
{% endraw %}
64
65
66
67
68
69
70
71
72
73

### upstream.signature_url

Optional signature file to download alongside upstream archive.

### upstream.version_script

If default upstream version auto-detection from HTML listing of files at
`upstream.archive_url` parent doesn't work for your project or you want full
control over the process, you can create a custom executable script which
74
75
prints current upstream version to `stdout` and tell `apkg` to use it
with `upstream.version_script` option:
76
77
78
79
80
81
82
83
84

```
[upstream]
version_script = "scripts/upstream-version.py"
```

This option overrides default auto-detection mechanism.

script example: {{ 'scripts/upstream-version.py' | file_link  }}
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103


## [apkg]

Config section related to `apkg` configuration and settings.

### apkg.compat

In order to allow config file format changes without breaking compatibility,
it's **strongly recommended** to include current apkg compatibility level in the config file.

That way `apkg` will be able work with old and new config formats without disruption in the future.

**current apkg compat level: {{ compat_level }}**

```
[apkg]
compat = {{ compat_level }}
```