From 0bb5d0a810b28fb1acc396356d37c716c057e597 Mon Sep 17 00:00:00 2001 From: Alex Denes Date: Mon, 8 Feb 2021 15:49:20 +0000 Subject: [PATCH] Add fastd --- config/fastd/APKBUILD | 29 +++++++++++++++++++++++++++++ openrc/fastd/APKBUILD | 39 +++++++++++++++++++++++++++++++++++++++ openrc/fastd/runfile | 12 ++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 config/fastd/APKBUILD create mode 100644 openrc/fastd/APKBUILD create mode 100644 openrc/fastd/runfile diff --git a/config/fastd/APKBUILD b/config/fastd/APKBUILD new file mode 100644 index 0000000..1f8102c --- /dev/null +++ b/config/fastd/APKBUILD @@ -0,0 +1,29 @@ +# Contributor: Alex Denes +# Maintainer: Alex Denes +_svcname=fastd +_configpath="/etc/fastd/redxen" +_cfgumask=400 + +. ../APKBUILD-config.common + +pkgver=2021.02.08 +pkgrel=0 +subpackages="$pkgname-crxnrouter" # $pkgname-crxnclient" TODO +source=" + crxn-router.conf +" + #crxn-client.conf + +package() { + mkdir -p "$pkgdir" +} + +crxnrouter() { + install -Dm400 crxn-router.conf "$subpkgdir"/"$_configpath"/crxn-router.conf +} + +crxnclient() { + install -Dm400 crxn-client.conf "$subpkgdir"/"$_configpath"/crxn-client.conf +} + +sha512sums="f0c4dfd3c0cd6c00ece98f3be9c8b70c1654713167da20f12d9867737d9f98b7ee0286ad311e9bf31536d44632ba9dc4b659d9d42c047dba0a14169b32f3849c crxn-router.conf" diff --git a/openrc/fastd/APKBUILD b/openrc/fastd/APKBUILD new file mode 100644 index 0000000..788fa14 --- /dev/null +++ b/openrc/fastd/APKBUILD @@ -0,0 +1,39 @@ +# Contributor: Alex Denes +# Maintainer: Alex Denes +_svcname=fastd +_grpname=network + +. ../APKBUILD-openrc.common + +pkgver=2021.02.08 +pkgrel=4 +subpackages="$pkgname-crxnrouter" # $pkgname-crxnclient" # TODO +depends="" +source=" + runfile +" + +build() { + echo "FASTD_CONF=\"/etc/fastd/redxen/crxn-router.conf\"" > conffile.crxnrouter + echo "FASTD_CONF=\"/etc/fastd/redxen/crxn-client.conf\"" > conffile.crxnclient +} + +package() { + openrc_rx_install_runfile +} + +crxnrouter() { + depends="redxen-config-$_svcname-crxnrouter" + openrc_rx_add_to_runlevel "$subpkgdir" "fastd.crxnrouter.redxen" + openrc_rx_link_instance "$subpkgdir" "$_svcname" "crxnrouter" + openrc_rx_install_conffile "$subpkgdir" "$builddir"/"conffile.crxnrouter" "fastd.crxnrouter" +} + +crxnclient() { + depends="redxen-config-$_svcname-crxnrouter" + openrc_rx_add_to_runlevel "$subpkgdir" "fastd.crxnrouter.redxen" + openrc_rx_link_instance "$subpkgdir" "$_svcname" "crxnclient" + openrc_rx_install_conffile "$subpkgdir" "$builddir"/"conffile.crxnclient" "fastd.crxnclient" +} + +sha512sums="68699b730ca24994227c4487f5046e433ba82e475b9f586755e525f9b6c7da7346f6ac04bb17d370bfed7121bb660f11a8e243169e25af391f6d1e87928d9d77 runfile" diff --git a/openrc/fastd/runfile b/openrc/fastd/runfile new file mode 100644 index 0000000..5339dcc --- /dev/null +++ b/openrc/fastd/runfile @@ -0,0 +1,12 @@ +#!/sbin/openrc-run + +: ${FASTD_CONF:=/etc/fastd/fastd.conf} + +pidfile="/run/${RC_SVCNAME}.pid" +command=/usr/bin/fastd +command_args="--daemon --pid-file $pidfile --config $FASTD_CONF" + +depend() { + need net + after firewall syslog yggdrasil +}