diff --git a/srcpkgs/mycelium/files/mycelium/run b/srcpkgs/mycelium/files/mycelium/run new file mode 100755 index 00000000000000..b72025e24c455d --- /dev/null +++ b/srcpkgs/mycelium/files/mycelium/run @@ -0,0 +1,10 @@ +#!/bin/sh +exec 2>&1 +modprobe tun +caps='-all,+NET_ADMIN,+NET_RAW' +drop_caps="setpriv --inh-caps $caps --bounding-set $caps" +if [ -f /etc/mycelium.toml ]; then + exec $drop_caps mycelium --config-file /etc/mycelium.toml 2>&1 +else + exec $drop_caps mycelium 2>&1 +fi diff --git a/srcpkgs/mycelium/template b/srcpkgs/mycelium/template new file mode 100644 index 00000000000000..e541683cda0b52 --- /dev/null +++ b/srcpkgs/mycelium/template @@ -0,0 +1,36 @@ +# Template file for 'mycelium' +pkgname=mycelium +version=0.7.10 +revision=1 +build_style=cargo +hostmakedepends="pkg-config" +makedepends="openssl-devel" +short_desc="End-to-end encrypted IPv6 overlay network" +maintainer="Orphaned " +license=Apache-2.0 +homepage="https://github.com/threefoldtech/mycelium" +changelog="https://raw.githubusercontent.com/threefoldtech/mycelium/main/CHANGELOG.md" +distfiles="https://github.com/threefoldtech/mycelium/archive/refs/tags/v${version}.tar.gz" +checksum=cc5d624366dd90b1b96d91faddeb3cbe5862128da5b3628f9327a3dfdc9db5d6 + +post_install() { + vsv mycelium +} + +do_build() { + : ${make_cmd:=cargo auditable} + : ${make_verbose:=-v} + CARGO_TARGET_DIR=target ${make_cmd} build \ + ${XBPS_VERBOSE+${make_verbose}} --release --locked --target ${RUST_TARGET} \ + --manifest-path myceliumd/Cargo.toml +} + +do_install() { + vbin target/${RUST_TARGET}/release/mycelium +} + +do_check() { + : ${make_cmd:=cargo auditable} + : ${make_verbose:=-v} + ${make_cmd} test ${XBPS_VERBOSE+${make_verbose}} --locked --target ${RUST_TARGET} +}