summaryrefslogtreecommitdiff
path: root/net-im/bbctl/bbctl-0.15.0.ebuild
blob: f7a109cd7f7638bad4753be24e8765c1b26ee1b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Copyright 2025-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=9

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 ISC MIT MPL-2.0"
SLOT="0"
KEYWORDS="~amd64"

DEPEND="dev-db/sqlite:3"
RDEPEND="${DEPEND}"
BDEPEND=">=dev-lang/go-1.25.0"

src_compile() {
	local BUILD_TIME=$(date -Iseconds)
	local go_ldflags=(
		-X "main.Tag=v${PV}"
		-X "main.Commit=unknown"
		-X "main.BuildTime=${BUILD_TIME}"
	)

	# https://github.com/mattn/go-sqlite3#linux
	# -tags libsqlite3: use system sqlite3 instead of bundled
	ego build -tags "libsqlite3" -ldflags "${go_ldflags[*]}" ./cmd/bbctl
}

src_install() {
	dobin bbctl
	einstalldocs

	exeinto /etc/user/init.d
	newexe "${FILESDIR}"/bbctl.initd bbctl
}