net-misc/hoppscotch-bin: bump version to 24.11.0.0
[gentoo-zh.git] / net-proxy / v2ray-bin / v2ray-bin-5.22.0.ebuild
blob73345c06a26bfea2db7db36324d4e1e3fb73e646
1 # Copyright 2021-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
5 inherit systemd
7 DESCRIPTION="A platform for building proxies to bypass network restrictions"
8 HOMEPAGE="
9         https://www.v2fly.org
10         https://github.com/v2fly/v2ray-core
12 SRC_URI="
13         amd64? ( https://github.com/v2fly/v2ray-core/releases/download/v${PV}/v2ray-linux-64.zip -> v2ray-${PV}-linux-64.zip )
14         x86? ( https://github.com/v2fly/v2ray-core/releases/download/v${PV}/v2ray-linux-32.zip -> v2ray-${PV}-linux-32.zip )
15         arm? (
16                 https://github.com/v2fly/v2ray-core/releases/download/v${PV}/v2ray-linux-arm32-v7a.zip -> v2ray-${PV}-linux-arm.zip
17         )
18         arm64? (
19                 https://github.com/v2fly/v2ray-core/releases/download/v${PV}/v2ray-linux-arm64-v8a.zip -> v2ray-${PV}-linux-arm64.zip
20         )
23 S=${WORKDIR}
25 LICENSE="MIT"
26 SLOT="0"
27 KEYWORDS="-* ~amd64 ~arm ~arm64 ~x86"
29 DEPEND="
30         app-alternatives/v2ray-geoip
31         app-alternatives/v2ray-geosite
33 RDEPEND="
34         !net-proxy/v2ray
35         ${DEPEND}
37 BDEPEND="app-arch/unzip"
38 QA_PREBUILT="
39         /usr/bin/v2ray
42 src_install() {
43         dobin v2ray
45         insinto /etc/v2ray
46         doins *.json
48         sed -i 's|/usr/local/bin|/usr/bin|;s|/usr/local/etc|/etc|' systemd/system/*.service || die
49         sed -i '/^User=/s/nobody/v2ray/;/^User=/aDynamicUser=true' systemd/system/*.service || die
51         newinitd "${FILESDIR}/v2ray.initd-r1" v2ray
52         systemd_dounit systemd/system/v2ray.service
53         systemd_dounit systemd/system/v2ray@.service