add initial alpine packaging
notes: - to build the package, you must use the cargo version from the edge branch (by building on edge or by installing it manually) - building from git requires some work (abuild supports snapshots for getting the release from git, but the version number would remain unchanged) - the apkbuild doesn't include any packaging tests (as i don't know what to include)
This commit is contained in:
parent
4158c1cf62
commit
80e8900f04
5 changed files with 96 additions and 0 deletions
63
alpine/APKBUILD
Normal file
63
alpine/APKBUILD
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
# Contributor: magmaus3 <maia@magmaus3.eu.org>
|
||||||
|
# Maintainer: magmaus3 <maia@magmaus3.eu.org>
|
||||||
|
pkgname=continuwuity
|
||||||
|
|
||||||
|
# abuild doesn't like the format of v0.5.0-rc.5, so i had to change it
|
||||||
|
# see https://wiki.alpinelinux.org/wiki/Package_policies
|
||||||
|
pkgver=0.5.0_rc5
|
||||||
|
pkgrel=0
|
||||||
|
pkgdesc="a continuwuation of a very cool, featureful fork of conduit"
|
||||||
|
url="https://continuwuity.org/"
|
||||||
|
arch="all"
|
||||||
|
license="Apache-2.0"
|
||||||
|
depends="liburing"
|
||||||
|
|
||||||
|
# cargo version on alpine v3.21 is too old to use the 2024 edition
|
||||||
|
# i recommend either building everything on edge, or adding
|
||||||
|
# the edge repo as a tag
|
||||||
|
makedepends="cargo liburing-dev clang-dev linux-headers"
|
||||||
|
checkdepends=""
|
||||||
|
install="$pkgname.pre-install"
|
||||||
|
subpackages="$pkgname-openrc"
|
||||||
|
source="https://forgejo.ellis.link/continuwuation/continuwuity/archive/v0.5.0-rc.5.tar.gz
|
||||||
|
continuwuity.initd
|
||||||
|
continuwuity.confd
|
||||||
|
"
|
||||||
|
builddir="$srcdir/continuwuity"
|
||||||
|
options="net !check"
|
||||||
|
|
||||||
|
prepare() {
|
||||||
|
default_prepare
|
||||||
|
cd $srcdir/continuwuity
|
||||||
|
|
||||||
|
# add the default database path to the config (commented out)
|
||||||
|
cat conduwuit-example.toml \
|
||||||
|
| sed '/#database_path/ s:$: "/var/lib/continuwuity":' \
|
||||||
|
> "$srcdir"/continuwuity.toml
|
||||||
|
|
||||||
|
cargo fetch --target="$CTARGET" --locked
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cargo build --frozen --release --all-features
|
||||||
|
}
|
||||||
|
|
||||||
|
check() {
|
||||||
|
# TODO: make sure the tests work
|
||||||
|
#cargo test --frozen
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
cd $srcdir
|
||||||
|
install -Dm755 continuwuity/target/release/conduwuit "$pkgdir"/usr/bin/continuwuity
|
||||||
|
install -Dm644 "$srcdir"/continuwuity.toml -t "$pkgdir"/etc/continuwuity
|
||||||
|
install -Dm755 "$srcdir"/continuwuity.initd "$pkgdir"/etc/init.d/continuwuity
|
||||||
|
install -Dm644 "$srcdir"/continuwuity.confd "$pkgdir"/etc/conf.d/continuwuity
|
||||||
|
}
|
||||||
|
|
||||||
|
sha512sums="
|
||||||
|
66f6da5e98b6f7bb8c1082500101d5c87b1b79955c139b44c6ef5123919fb05feb0dffc669a3af1bc8d571ddb9f3576660f08dc10a6b19eab6db9e391175436a v0.5.0-rc.5.tar.gz
|
||||||
|
0482674be24740496d70da256d4121c5a5e3b749f2445d2bbe0e8991f1449de052724f8427da21a6f55574bc53eac9ca1e47e5012b4c13049b2b39044734d80d continuwuity.initd
|
||||||
|
38e2576278b450d16ba804dd8f4a128f18cd793e6c3ce55aedee1e186905755b31ee23baaa6586b1ab0e25a1f29bf1ea86bfaae4185b0cb1a29203726a199426 continuwuity.confd
|
||||||
|
"
|
7
alpine/README.md
Normal file
7
alpine/README.md
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# building
|
||||||
|
|
||||||
|
1. [set up your build
|
||||||
|
environment](https://wiki.alpinelinux.org/wiki/Include:Setup_your_system_and_account_for_building_packages)
|
||||||
|
|
||||||
|
2. run `abuild` (or `abuild -K` if you want to keep the source directory to make
|
||||||
|
rebuilding faster)
|
3
alpine/continuwuity.confd
Normal file
3
alpine/continuwuity.confd
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
supervisor=supervise-daemon
|
||||||
|
export CONTINUWUITY_CONFIG=/etc/continuwuity/continuwuity.toml
|
||||||
|
|
19
alpine/continuwuity.initd
Normal file
19
alpine/continuwuity.initd
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
|
command="/usr/bin/continuwuity"
|
||||||
|
command_user="continuwuity:continuwuity"
|
||||||
|
command_args="--config ${CONTINUWUITY_CONFIG=/etc/continuwuity/continuwuity.toml}"
|
||||||
|
command_background=true
|
||||||
|
pidfile="/run/$RC_SVCNAME.pid"
|
||||||
|
|
||||||
|
output_log="/var/log/continuwuity.log"
|
||||||
|
error_log="/var/log/continuwuity.log"
|
||||||
|
|
||||||
|
depend() {
|
||||||
|
need net
|
||||||
|
}
|
||||||
|
|
||||||
|
start_pre() {
|
||||||
|
checkpath -d -m 0755 -o "$command_user" /var/lib/continuwuity
|
||||||
|
checkpath -f -m 0644 -o "$command_user" "$output_log"
|
||||||
|
}
|
4
alpine/continuwuity.pre-install
Normal file
4
alpine/continuwuity.pre-install
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
addgroup -S continuwuity 2>/dev/null
|
||||||
|
adduser -S -D -H -h /var/lib/continuwuity -s /sbin/nologin -G continuwuity -g continuwuity continuwuity 2>/dev/null
|
||||||
|
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue