dev-libs/v2ray-geoip - 202408220047 (Miezhiko)

Search

Package Information

Description:
GeoIP for V2Ray.
Homepage:
https://github.com/v2fly/geoip
License:
CC-BY-SA-4.0 GeoLite2

Ebuild Details

Version EAPI Keywords Slot
202408220047 8 ~amd64 0
View Raw Ebuild
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit go-module

DESCRIPTION="GeoIP for V2Ray."
HOMEPAGE="https://github.com/v2fly/geoip"
SRC_URI="
	https://github.com/v2fly/geoip/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz
	https://github.com/blackteahamburger/gentoo-deps/releases/download/${P}/${P}-vendor.tar.xz
"

S="${WORKDIR}/geoip-${PV}"

LICENSE="CC-BY-SA-4.0 GeoLite2"
SLOT="0"
KEYWORDS="~amd64"

RDEPEND="!dev-libs/v2ray-geoip-bin"
BDEPEND="
	>=dev-lang/go-1.21
	app-arch/unzip
"

src_unpack() {
	local distdir="${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}"
	if ! [ -f "${distdir}/GeoLite2-Country-CSV.zip" ]; then
		eerror "Please first download GeoLite2-Country-CSV.zip from MaxMind"
		eerror "https://dev.maxmind.com/geoip/geoip2/geolite2/"
		die "GeoLite2-Country-CSV.zip not found"
	fi
	unpack "${distdir}/GeoLite2-Country-CSV.zip"
	go-module_src_unpack

	mv "${WORKDIR}"/GeoLite2* "${S}/geolite2" || die
}

src_compile() {
	ego run ./
}

src_install() {
	insinto /usr/share/geoip/
	newins output/geoip.dat v2fly.dat
}

Dependencies

RDEPEND

!dev-libs/v2ray-geoip-bin

BDEPEND

	>=dev-lang/go-1.21
	app-arch/unzip

Manifest for 202408220047

Type File Size Source URLs
DIST v2ray-geoip-202408220047-vendor.tar.xz 1293488 bytes https://github.com/blackteahamburger/gentoo-deps/releases/download/v2ray-geoip-202408220047/v2ray-geoip-202408220047-vendor.tar.xz
DIST v2ray-geoip-202408220047.tar.gz 33467 bytes https://github.com/v2fly/geoip/archive/refs/tags/202408220047.tar.gz