Commit

Author:

Hash:

Timestamp:

+119 -59 +/-7 browse

Kevin Schoon [me@kevinschoon.com]

eb975a0aedbd4da3b381dda40f26803b47942329

Sat, 13 Jun 2026 14:41:47 +0000 (1 month ago)

add support for debian packaging plus a few documentation updates
1diff --git a/.ayllu-build.jsonnet b/.ayllu-build.jsonnet
2index fa4e9ff..858822d 100644
3--- a/.ayllu-build.jsonnet
4+++ b/.ayllu-build.jsonnet
5 @@ -3,6 +3,7 @@ local build_image = 'ayllu-arch';
6 local version = '0.5.1';
7 local arch_package = 'ayllu-dev-' + version + '-1-x86_64.pkg.tar.zst';
8 local cargo_target_dir = '/home/ayllu/cargo-target';
9+ local debian_package = 'ayllu-' + version + '.deb';
10
11 local cargo_cache = {
12 name: 'cargo-cache',
13 @@ -11,7 +12,7 @@ local cargo_cache = {
14
15 local build_cache = {
16 name: 'build-cache',
17- path: '/home/ayllu/cargo-target',
18+ path: cargo_target_dir,
19 transient: true,
20 };
21
22 @@ -24,34 +25,13 @@ local binaries = [
23 'quipu',
24 ];
25
26- local subcommands = [
27- 'ayllu-shell-evaluate',
28- 'ayllu-shell-git-receive-pack',
29- 'ayllu-shell-git-upload-pack',
30- ];
31-
32 local compile_binary(name) = {
33 name: 'Cargo Build ' + name,
34 input: 'cargo build --frozen --release --bin=' + name,
35 environment: {
36 AYLLU_VERSION: version,
37 CARGO_TARGET_DIR: cargo_target_dir,
38- }
39- };
40-
41- local zsh_complete(name) = {
42- path: 'target/dist/completion/' + '_' + name,
43- sha256sum: null,
44- };
45-
46- local bash_complete(name) = {
47- path: 'target/dist/completion/' + name + '.bash',
48- sha256sum: null,
49- };
50-
51- local man_page(name, section) = {
52- path: 'target/dist/man/' + name + '.' + section,
53- sha256sum: null,
54+ },
55 };
56
57 local short_step(name, input) = {
58 @@ -122,16 +102,47 @@ local short_step(name, input) = {
59 steps: [
60 short_step('Man Pages', 'cargo run --frozen --package xtask -- gen_man'),
61 short_step('Shell Completion', 'cargo run --frozen --package xtask -- complete'),
62- short_step('Makepkg', 'makepkg')
63+ short_step('Makepkg', 'makepkg'),
64 ],
65 cache: [cargo_cache, build_cache],
66 depends_on: ['Compile Binaries'],
67 outputs: [
68 {
69 path: arch_package,
70- sha256sum: null
71- }
72- ]
73- }
74+ sha256sum: null,
75+ },
76+ ],
77+ },
78+ {
79+ name: 'Debian Distribution',
80+ image: 'ayllu-debian',
81+ steps: std.flattenArrays(
82+ [
83+ [
84+
85+ short_step('Fetch', 'cargo fetch --locked'),
86+ short_step('Cargo Test', 'cargo test --frozen --release'),
87+ short_step('Man Pages', 'cargo run --frozen --package xtask -- gen_man'),
88+ short_step('Shell Completion', 'cargo run --frozen --package xtask -- complete'),
89+ ],
90+ [compile_binary(binary) for binary in binaries],
91+ [short_step('Dpkg', 'scripts/build_deb.sh')]
92+ ]
93+ ),
94+ // NOTE: Build cache is excluded here
95+ cache: [cargo_cache, {
96+ name: "build-cache-debian",
97+ path: cargo_target_dir,
98+ transient: true
99+ }],
100+ depends_on: ['Arch Distribution'],
101+ // depends_on: ['Arch Distribution'],
102+ outputs: [
103+ {
104+ path: debian_package,
105+ sha256sum: null,
106+ },
107+ ],
108+ },
109 ],
110 }
111 diff --git a/PKGBUILD b/PKGBUILD
112index 8c6eff7..a961308 100644
113--- a/PKGBUILD
114+++ b/PKGBUILD
115 @@ -34,7 +34,7 @@ prepare() {
116 cp -v "$CARGO_TARGET_DIR/release/${BINARIES[i]}" .
117 done
118 cp -rv ../dist .
119- find dist/man -type f -exec gzip -f '{}' \;
120+ find dist/man -type f \( -iname '*.1' -o -iname '*.5' -o -iname '*.7' \) -exec gzip -f '{}' \;
121 cp -v ../LICENSE .
122 cp -v ../config.example.toml .
123 cp -rv ../contrib/systemd .
124 @@ -48,6 +48,9 @@ package() {
125 for man_page in $(find ./dist/man -type f -name '*.1.gz'); do
126 install -Dm644 "${srcdir}/${man_page}" "${pkgdir}/usr/share/man/man1/$(basename $man_page)"
127 done
128+ for man_page in $(find ./dist/man -type f -name '*.5.gz'); do
129+ install -Dm644 "${srcdir}/${man_page}" "${pkgdir}/usr/share/man/man7/$(basename $man_page)"
130+ done
131 for man_page in $(find ./dist/man -type f -name '*.7.gz'); do
132 install -Dm644 "${srcdir}/${man_page}" "${pkgdir}/usr/share/man/man7/$(basename $man_page)"
133 done
134 @@ -57,6 +60,9 @@ package() {
135 for script in $(find ./dist/completion -type f -name '_*'); do
136 install -Dm644 "${srcdir}/${man_page}" "${pkgdir}/usr/share/zsh/site-functions/$(basename $script)"
137 done
138+
139+ install -Dm644 ${srcdir}/LICENSE "${pkgdir}/usr/share/licenses/ayllu"
140+
141 install -Dm644 ${srcdir}/config.example.toml "${pkgdir}/etc/ayllu/config.example.toml"
142 install -Dm644 ${srcdir}/systemd/ayllu-sysusers.conf "${pkgdir}/usr/lib/sysusers.d/ayllu-sysusers.conf"
143 install -Dm644 ${srcdir}/systemd/system/ayllu-web.service "${pkgdir}/etc/systemd/system/ayllu-web.service"
144 diff --git a/README.md b/README.md
145index 22243f9..de66fae 100644
146--- a/README.md
147+++ b/README.md
148 @@ -51,6 +51,18 @@ We do not currently have a code of conduct however if/when the need arises to
149 adopt one it will be one which is characterized by inclusivity, empathy, and
150 one that encourages the promotion of independent internet communities.
151
152+ ## Installation
153+
154+ Although Ayllu uses container technologies and can itself be containerized it is
155+ best installed on a virtual machine or physical server. Originally Ayllu shipped
156+ with a container environment
157+
158+ Ayllu's internal CI system distributes packages for both Debian and Archlinux
159+ systems. It is discouraged to consume from these because we want to encourage
160+ upstream support for Ayllu by the various distributions. Our internal packages
161+ can also serve as a reference for packagers. See `scripts/build_deb.sh` and
162+ the `PKGBUILD` in the root of the Ayllu repository.
163+
164 ## Compiling From Source
165
166 Ayllu is written in [rust](https://www.rust-lang.org/) and you'll need its
167 @@ -59,6 +71,10 @@ compiler to build the project.
168 You can run the [check_build_dependencies.sh](https://ayllu-forge.org/ayllu/ayllu/blob/scripts/check_build_dependencies.sh)
169 script to verify you have all the necessary software on your system.
170
171+ ### Minimum Rust Version
172+
173+ Ayllu targets whatever version of Rust is available in [debian-testing](https://packages.debian.org/testing/cargo).
174+
175 ```sh
176 # check your build dependencies
177 scripts/check_build_dependencies.sh
178 diff --git a/ayllu.7.scd b/ayllu.7.scd
179index 10e1eac..c0a7430 100644
180--- a/ayllu.7.scd
181+++ b/ayllu.7.scd
182 @@ -2,7 +2,7 @@ AYLLU(7)
183
184 # NAME
185
186- *Ayllu* The Hyper Performant & Standards Compliant & Hackable Code Forge
187+ *Ayllu* The Hyper Performant & Hackable Code Forge
188
189 The name *Ayllu* _/ˈajʎu/_, _eye-joo_ is the Quechua word for the traditional
190 form of a community in the Andes region of South America, particularly in
191 @@ -12,7 +12,7 @@ Bolivia and Peru.
192
193 Ayllu is a lightweight code forge oriented towards multi-user single server
194 environments and is designed to be interoperable via open standards and
195- encourage the proliferation of independent software communities. Ayllu is built
196+ encourage the proliferation of independent software communities. Ayllu is built
197 with the assumption that a single computer is sufficiently powerful to satisfy
198 the computational needs of small to medium size FOSS community projects. It aims
199 to capture the ethos of old school Unix time-sharing systems paired with the
200 @@ -23,18 +23,13 @@ supply chain for free software.
201 For the moment Ayllu is considered ALPHA software and so it should not be
202 depended on unless you are willing to tolerate pain, suffering, or worse.
203
204- # INSTALLATION
205-
206- Although Ayllu uses container technologies and can itself be containerized it is
207- best installed on a virtual machine or physical server.
208-
209 # HISTORY
210
211 Ayllu started as a personal project to learn the Rust programming language but
212 was influenced by several attempts to setup a lightweight environment for
213 doing software development in a combination of private and public settings.
214
215- # What is a Software Forge?
216+ # WHAT IS A SOFTWARE FORGE?
217
218 Forge is a nebulous term but roughly refers to a virtual space in which software
219 is discussed, constructed, tested, and documented.
220 diff --git a/containers/Containerfile.debian b/containers/Containerfile.debian
221index 8c29b9a..60d13d5 100644
222--- a/containers/Containerfile.debian
223+++ b/containers/Containerfile.debian
224 @@ -1,4 +1,4 @@
225- FROM docker.io/library/debian:13
226+ FROM docker.io/library/debian:testing
227
228 RUN apt-get update && apt-get install -yyq \
229 curl \
230 @@ -10,7 +10,7 @@ RUN apt-get update && apt-get install -yyq \
231 sqlite3 \
232 scdoc
233
234- RUN useradd -d /home/ayllu -s /bin/bash ayllu
235+ RUN useradd -m -d /home/ayllu -s /bin/bash ayllu
236 RUN mkdir /src && chown ayllu:ayllu /src
237
238 USER ayllu
239 diff --git a/packaging/debian/postinst b/packaging/debian/postinst
240index 6a48aa1..5b9741a 100755
241--- a/packaging/debian/postinst
242+++ b/packaging/debian/postinst
243 @@ -5,9 +5,9 @@ AYLLU_HOME_PATH="/var/lib/ayllu"
244 AYLLU_SHARE_PATH="/usr/share/ayllu"
245 AYLLU_LIB_PATH="/usr/lib/ayllu"
246
247- if [ ! "$(id ayllu)" ] ; then
248- adduser --system --group --shell="$AYLLU_SHELL_PATH" --home="$AYLLU_HOME_PATH" ayllu
249- fi
250+ # if [ ! "$(id ayllu)" ] ; then
251+ # adduser --system --group --shell="$AYLLU_SHELL_PATH" --home="$AYLLU_HOME_PATH" ayllu
252+ # fi
253
254 if [ -d "$AYLLU_SHARE_PATH" ] ; then
255 mkdir -p "$AYLLU_SHARE_PATH"
256 diff --git a/scripts/build_deb.sh b/scripts/build_deb.sh
257index 8ecdf77..3890c6f 100755
258--- a/scripts/build_deb.sh
259+++ b/scripts/build_deb.sh
260 @@ -1,32 +1,64 @@
261- #!/bin/sh
262- # Build a debian package, assumes we are running on a debian host
263+ #!/bin/bash
264+ # This is an internal Debian package source for our Ayllu's distribution.
265+ set -e
266
267- cargo build --release
268+ if [ -z "${AYLLU_VERSION+x}" ]; then
269+ echo "AYLLU_VERSION is not set"
270+ exit 1
271+ fi
272
273- AYLLU_VERSION="$(cat ayllu/Cargo.toml |grep version | head -n 1 | \
274- cut -d ' ' -f 3 | sed -e 's/\"//g')"
275+ if [ -z "${CARGO_TARGET_DIR+x}" ]; then
276+ CARGO_TARGET_DIR="target"
277+ fi
278
279- BUILD_DIR="$(mktemp -d)"
280+ BUILD_DIR="$(mktemp -d --tmpdir=.)"
281 PACKAGE_OUTPUT="${BUILD_DIR}.deb"
282+
283 cp -rvp packaging/debian/ "${BUILD_DIR}/DEBIAN/"
284
285 sed -i "s/Version: X.X.X/Version: ${AYLLU_VERSION}/g" "${BUILD_DIR}/DEBIAN/control"
286
287- find migrations -name "*.sql" | xargs install -Dm644 -t "${BUILD_DIR}/usr/lib/ayllu/migrations"
288- install -Dm755 "target/release/ayllu" "${BUILD_DIR}/usr/bin/ayllu"
289- install -Dm755 "target/release/quipu" "${BUILD_DIR}/usr/bin/quipu"
290- install -Dm755 "target/release/ayllu-shell" "${BUILD_DIR}/usr/bin/ayllu-shell"
291- install -Dm755 "target/release/ayllu-keys" "${BUILD_DIR}/usr/bin/ayllu-keys"
292- install -Dm755 "target/release/ayllu-migrate" "${BUILD_DIR}/usr/bin/ayllu-migrate"
293- install -Dm755 "target/release/ayllu-build" "${BUILD_DIR}/usr/bin/ayllu-build"
294+ BINARIES=(
295+ 'ayllu-build'
296+ 'ayllu-keys'
297+ 'ayllu-migrate'
298+ 'ayllu-shell'
299+ 'ayllu-web'
300+ 'quipu'
301+ )
302+
303+ for i in "${!BINARIES[@]}"; do
304+ install -Dm755 "$CARGO_TARGET_DIR/release/${BINARIES[i]}" "${BUILD_DIR}/usr/bin/${BINARIES[i]}"
305+ done
306+
307+ find dist/man -type f \( -iname '*.1' -o -iname '*.5' -o -iname '*.7' \) -exec gzip -f '{}' \;
308+
309+ for man_page in $(find ./dist/man -type f -name '*.1.gz'); do
310+ install -Dm644 "${man_page}" "${BUILD_DIR}/usr/share/man/man1/$(basename $man_page)"
311+ done
312+ for man_page in $(find ./dist/man -type f -name '*.5.gz'); do
313+ install -Dm644 "${man_page}" "${BUILD_DIR}/usr/share/man/man5/$(basename $man_page)"
314+ done
315+ for man_page in $(find ./dist/man -type f -name '*.7.gz'); do
316+ install -Dm644 "${man_page}" "${BUILD_DIR}/usr/share/man/man7/$(basename $man_page)"
317+ done
318+ for script in $(find ./dist/completion -type f -name '*.bash'); do
319+ install -Dm644 "${man_page}" "${BUILD_DIR}/usr/share/bash-completion/$(basename $script)"
320+ done
321+ for script in $(find ./dist/completion -type f -name '_*'); do
322+ install -Dm644 "${man_page}" "${BUILD_DIR}/usr/share/zsh/site-functions/$(basename $script)"
323+ done
324+
325 install -Dm644 "LICENSE" "${BUILD_DIR}/usr/share/licenses/ayllu"
326+
327 install -Dm644 "config.example.toml" "${BUILD_DIR}/etc/ayllu/config.example.toml"
328+ install -Dm644 "contrib/systemd/ayllu-sysusers.conf" "${BUILD_DIR}/usr/lib/sysusers.d/ayllu.conf"
329 install -Dm644 \
330- "contrib/systemd/system/ayllu.service" \
331- "${BUILD_DIR}/usr/lib/systemd/system/ayllu.service"
332+ "contrib/systemd/system/ayllu-web.service" \
333+ "${BUILD_DIR}/usr/lib/systemd/system/ayllu-web.service"
334 install -Dm644 \
335- "contrib/systemd/user/ayllu.service" \
336- "${BUILD_DIR}/usr/lib/systemd/user/ayllu.service"
337+ "contrib/systemd/user/ayllu-web.service" \
338+ "${BUILD_DIR}/usr/lib/systemd/user/ayllu-web.service"
339
340 dpkg-deb --root-owner-group --build "$BUILD_DIR"
341