diff --git a/net-im/bbctl/Manifest b/net-im/bbctl/Manifest new file mode 100644 index 0000000000..f982579e53 --- /dev/null +++ b/net-im/bbctl/Manifest @@ -0,0 +1,2 @@ +DIST bbctl-0.13.0.tar.gz 76461 BLAKE2B f05b23d5e69e8ea78114df57e225f07456cc9ed895c95772cc0f90d2792b57edebb7aa5fa820f6a093d8f30c94d9e814913aa197d2294a0b6860525f23e28056 SHA512 6ce826acd8f58e2b5128c852d23159a3cd15496f99606fad6d4247a8f07159396ba0754b69cc866df67db88d41daf0c5267f8141a75591f9a246c8a2af4fbe4d +DIST bridge-manager-0.13.0-vendor.tar.xz 1439060 BLAKE2B 5da9a3cdf36021b3acda5c4ebd916ea4c8607fda2d7c1556f7fd0711ecd7aabd591ec3137ddeb3499a8f13af88313e1d296b311824a441403f15e2ed34b9ebb3 SHA512 7f6e6bcd1fd962ba9895c7dc4ab1bbfb4c774b981740b97bc5c05b0aebb1ce8b23966435feff704ce4c246d1ea017bd405c81c00501e55a369474a0cb3cddb17 diff --git a/net-im/bbctl/bbctl-0.13.0.ebuild b/net-im/bbctl/bbctl-0.13.0.ebuild new file mode 100644 index 0000000000..02fd5f8758 --- /dev/null +++ b/net-im/bbctl/bbctl-0.13.0.ebuild @@ -0,0 +1,39 @@ +# Copyright 2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit go-module + +MY_PN="bridge-manager" +MY_P="${MY_PN}-${PV}" +DESCRIPTION="Beeper Bridge Manager" +HOMEPAGE="https://github.com/beeper/bridge-manager" +SRC_URI="https://github.com/beeper/${MY_PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz + https://github.com/gentoo-golang-dist/${MY_PN}/releases/download/v${PV}/${MY_P}-vendor.tar.xz +" +S="${WORKDIR}/${MY_P}" + +LICENSE="Apache-2.0" +# Go dependency licenses +LICENSE+=" BSD BSD-2 MIT MPL-2.0" +SLOT="0" +KEYWORDS="~amd64" + +src_compile() { + local BUILD_TIME=$(date -Iseconds) + local go_ldflags=( + -X "main.Tag=v${PV}" + -X "main.BuildTime=${BUILD_TIME}" + ) + + ego build -ldflags "${go_ldflags[*]}" ./cmd/bbctl +} + +src_install() { + dobin bbctl + einstalldocs + + exeinto /etc/user/init.d + newexe "${FILESDIR}"/bbctl.initd bbctl +} diff --git a/net-im/bbctl/files/bbctl.initd b/net-im/bbctl/files/bbctl.initd new file mode 100755 index 0000000000..7060cbf93d --- /dev/null +++ b/net-im/bbctl/files/bbctl.initd @@ -0,0 +1,26 @@ +#!/sbin/openrc-run +# shellcheck shell=sh +# +# Copyright 2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +bridge=${RC_SVCNAME#*.} + +supervisor="supervise-daemon" +command="/usr/bin/bbctl" +command_args="${BBCTL_OPTS} run ${bridge?} ${BBCTL_BRIDGE_OPTS}" +respawn_max=0 + +depend() { + use dns firewall + need net +} + +start_pre() { + if [ "${bridge?}" = "${RC_SVCNAME?}" ]; then + eerror "${RC_SVCNAME?} cannot be started directly. You must create" + eerror "symbolic links to it for the bridges you want to start" + eerror "(e.g. bbctl.sh-irc) and add those to the appropriate runlevels." + return 1 + fi +} diff --git a/net-im/bbctl/metadata.xml b/net-im/bbctl/metadata.xml new file mode 100644 index 0000000000..4214c65361 --- /dev/null +++ b/net-im/bbctl/metadata.xml @@ -0,0 +1,11 @@ + + + + + cyber+gentoo@sysrq.in + Anna + + + beeper/bridge-manager + +