net-proxy/v2ray-bin: improve dependencies
[gentoo-zh.git] / net-proxy / v2ray-bin / v2ray-bin-5.12.1-r1.ebuild
blob62d16ed0190d44a19661b2c50bc97df8633ab4c4
1 # Copyright 2021-2023 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
18 arm64? (
19 https://github.com/v2fly/v2ray-core/releases/download/v${PV}/v2ray-linux-arm64-v8a.zip -> v2ray-${PV}-linux-arm64.zip
23 S=${WORKDIR}
25 LICENSE="MIT"
26 SLOT="0"
27 KEYWORDS="-* ~amd64 ~arm ~arm64 ~x86"
29 RESTRICT="mirror"
31 DEPEND="
32 app-alternatives/v2ray-geoip
33 app-alternatives/v2ray-geosite
35 RDEPEND="
36 !net-proxy/v2ray
37 ${DEPEND}
39 BDEPEND="app-arch/unzip"
40 QA_PREBUILT="
41 /usr/bin/v2ray
44 src_install() {
45 dobin v2ray
47 insinto /etc/v2ray
48 doins *.json
50 sed -i 's|/usr/local/bin|/usr/bin|;s|/usr/local/etc|/etc|' systemd/system/*.service || die
51 sed -i '/^User=/s/nobody/v2ray/;/^User=/aDynamicUser=true' systemd/system/*.service || die
53 newinitd "${FILESDIR}/v2ray.initd-r1" v2ray
54 systemd_dounit systemd/system/v2ray.service
55 systemd_dounit systemd/system/v2ray@.service