Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions srcpkgs/stalwart-cli/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Template file for 'stalwart-cli'
pkgname=stalwart-cli
version=2.0.1
revision=1
build_style=cargo
short_desc="Stalwart Command Line Interface"
maintainer="John <me@johnnynator.dev>"
license="AGPL-3.0-only"
homepage="https://stalw.art"
distfiles="https://github.com/stalwartlabs/cli/archive/refs/tags/v${version}.tar.gz"
checksum=4471e99d2ef2ad87155c80a1261c20eaa06f71e2a58fdff5804bea8af5caaaa9

post_install() {
vlicense LICENSES/AGPL-3.0-only.txt
}
26 changes: 26 additions & 0 deletions srcpkgs/stalwart-webui/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Template file for 'stalwart-webui'
pkgname=stalwart-webui
version=2.1.3
revision=1
hostmakedepends="nodejs"
short_desc="Stalwart WebUI"
maintainer="John <me@johnnynator.dev>"
license="AGPL-3.0-only"
homepage="https://stalw.art"
distfiles="https://github.com/stalwartlabs/webui/archive/refs/tags/v${version}.tar.gz"
checksum=d72c2bc49387bf958285240b0aa76d99277205efeff0707f947700053f53fd87

do_configure() {
npm ci
}

do_build() {
npm run build
bsdtar -a -cf webui.zip -C./dist .
}

do_install() {
vmkdir usr/share/stalwart
vinstall webui.zip 644 usr/share/stalwart
vlicense LICENSES/AGPL-3.0-only.txt
}
11 changes: 11 additions & 0 deletions srcpkgs/stalwart/create-archive.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
# create-archive GIT-DIR VERSION
DIR="${1?no directory given}"
VER="${2?no version given}"

chdir "${1}"
git checkout "v${2}"
python3 resources/scripts/ossify.py crates
git add .
git commit -m "Remove non oss code"
git archive --format=tar "--prefix=stalwart-v${version}/" HEAD | zstd > "stalwart-v${version}.tar.zst"
4 changes: 4 additions & 0 deletions srcpkgs/stalwart/files/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"@type": "RocksDb",
"path": "/var/lib/stalwart/"
}
9 changes: 9 additions & 0 deletions srcpkgs/stalwart/files/stalwart/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
[ -r conf ] && . ./conf

exec 2>&1
exec setpriv --reuid _stalwart --regid _stalwart --clear-groups \
--ambient-caps -all,+net_bind_service \
--inh-caps -all,+net_bind_service \
--bounding-set -all,+net_bind_service \
--no-new-privs -- /usr/bin/stalwart -c /etc/stalwart.json
12 changes: 12 additions & 0 deletions srcpkgs/stalwart/patches/sonic-simd-i686.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Upstream: nop
Reason: last sonic-simd release does not compile on i686, future releases will pick this up

diff --git a/Cargo.toml b/Cargo.toml
index 6392a66c1..f1a0cadd4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -144,3 +144,4 @@ hickory-net = { git = "https://github.com/stalwartlabs/hickory-dns", branch = "s
hickory-resolver = { git = "https://github.com/stalwartlabs/hickory-dns", branch = "stalwart/0.26" }
librocksdb-sys = { git = "https://github.com/stalwartlabs/rust-rocksdb", branch = "stalwart/0.25" }
rxing = { git = "https://github.com/stalwartlabs/rxing", branch = "finder-candidate-cap-0.9.4" }
+sonic-simd = { git = "https://github.com/cloudwego/sonic-rs", rev = "3b829600ca347bcaa182155794871385222bc2ba" }
16 changes: 16 additions & 0 deletions srcpkgs/stalwart/patches/use-local-webui.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
source: https://gitlab.archlinux.org/archlinux/packaging/packages/stalwart/-/raw/main/use-local-webui-archive.patch
upstream: no

--- a/crates/common/src/manager/defaults.rs
+++ b/crates/common/src/manager/defaults.rs
@@ -62,9 +62,7 @@ async fn insert_safe_defaults(bp: &mut Bootstrap) -> trc::Result<()> {
description: "Stalwart Web Interface".to_string(),
enable: true,
#[cfg(not(feature = "dev_mode"))]
- resource_url:
- "https://github.com/stalwartlabs/webui/releases/download/v2/webui.zip"
- .into(),
+ resource_url: "file:///usr/share/stalwart/webui.zip".into(),
#[cfg(feature = "dev_mode")]
resource_url: "file://../webui/.ignore/webui.zip".into(),
url_prefix: Map::new(vec!["/admin".into(), "/account".into()]),
38 changes: 38 additions & 0 deletions srcpkgs/stalwart/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Template file for 'stalwart'
pkgname=stalwart
version=1.2.3
revision=1
build_style=cargo
configure_args="--no-default-features --features sqlite,postgres,mysql,rocks,s3,redis,keep,azure,nats,exchange"
make_build_args="-p stalwart"
make_install_args="--path crates/main"
hostmakedepends="pkg-config libzstd-devel clang23-devel"
makedepends="libzstd-devel clang23-devel sqlite-devel rocksdb-devel"
depends="stalwart-webui"
short_desc="Mail & Collaboration server (IMAP, JMAP, SMTP, CalDAV, CardDAV, WebDAV)"
maintainer="John <me@johnnynator.dev>"
license="AGPL-3.0-only AND MIT AND Unlicense"
homepage="https://stalw.art/"
# The default archive contains source code we aren't allowed to distribute
distfiles="https://void.johnnynator.dev/distfiles/stalwart-v${version}.tar.zst"
checksum=f5a39b0a1d36c020e98f5aff204b405f7063c100fdaaeddd3ab0b755c8078ac7
conf_files="/etc/stalwart.json"
system_accounts="_stalwart"

make_dirs="/var/lib/stalwart 0750 ${system_accounts} ${system_accounts}
/var/lib/stalwart 0755 ${system_accounts} ${system_accounts}"

export CARGO_PROFILE_RELEASE_LTO=thin
export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=16
export ROCKSDB_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib"
export HOST_PKG_CONFIG_PATH=/usr/bin/pkg-config

post_patch() {
cargo metadata > /dev/null
}

post_install() {
vsv stalwart
vconf "${FILESDIR}/config.json" stalwart.json
vlicense LICENSES/AGPL-3.0-only.txt
}
Loading