# Copyright 1999-2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 inherit go-module systemd tmpfiles DESCRIPTION="Ultimate camera streaming application" HOMEPAGE="https://github.com/AlexxIT/go2rtc" SRC_URI="https://github.com/AlexxIT/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz https://www.inode64.com/dist/${P}-vendor.tar.xz " LICENSE="MIT" # Dependent licenses LICENSE+=" Apache-2.0 BSD BSD-2 EPL-2.0 ISC" SLOT="0" KEYWORDS="~amd64 ~x86" RDEPEND=" acct-user/go2rtc media-video/ffmpeg[x264,x265,opus] " # fowners in src_install needs them on the build host. DEPEND=" acct-user/go2rtc " BDEPEND=">=dev-lang/go-1.26.0" DOCS=(README.md) PATCHES=( "${FILESDIR}/${PN}-release-version.patch" ) src_compile() { CGO_ENABLED=0 ego build -trimpath } src_test() { ego test || die "test failed" } src_install() { default insinto /usr/bin dobin go2rtc insinto /etc/logrotate.d newins "${FILESDIR}/go2rtc.logrotate" go2rtc insinto /etc/${PN} doins "${FILESDIR}/go2rtc.yaml" fowners -R go2rtc:go2rtc /etc/${PN} newinitd "${FILESDIR}/go2rtc.initd" go2rtc dotmpfiles "${FILESDIR}"/${PN}.conf systemd_newunit "${FILESDIR}/${PN}.service" "${PN}@.service" } pkg_postinst() { tmpfiles_process go2rtc.conf }