# Copyright 2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# Autogenerated by pycargoebuild 0.15.0

EAPI=8

CRATES="
"

inherit cargo systemd

DESCRIPTION="A reverse proxy for NAT traversal"
HOMEPAGE="https://github.com/rathole-org/rathole"
SRC_URI="
	https://codeload.github.com/rathole-org/rathole/tar.gz/v${PV} -> ${P}.tar.gz
	https://minio.dream-universe.org/posts/distfiles/${P}-crates.tar.xz
"

LICENSE="Apache-2.0"
# Dependent crate licenses
LICENSE+="
	0BSD Apache-2.0 BSD ISC MIT Unicode-DFS-2016
	|| ( Artistic-2 CC0-1.0 )
"
SLOT="0"
KEYWORDS="~amd64"

PATCHES=("${FILESDIR}/${P}-fix-rust-1.80.patch")

src_install(){
	keepdir /etc/rathole
	dobin $(cargo_target_dir)/rathole
	systemd_dounit examples/systemd/ratholes@.service
	systemd_dounit examples/systemd/ratholes.service
	systemd_dounit examples/systemd/ratholec@.service
	systemd_dounit examples/systemd/ratholec.service
	systemd_dounit examples/systemd/rathole@.service
}