| 1 |
|
# Copyright 1999-2022 Gentoo Authors
|
|
1 |
# Copyright 1999-2026 Gentoo Authors
|
| 2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
3 |
|
| 4 |
4 |
EAPI=8
|
| 5 |
5 |
|
| 6 |
|
inherit autotools
|
|
6 |
inherit systemd
|
| 7 |
7 |
|
| 8 |
8 |
DESCRIPTION="Out-of-kernel stateless NAT64 implementation based on TUN"
|
| 9 |
|
HOMEPAGE="http://www.litech.org/tayga/"
|
| 10 |
|
SRC_URI="http://www.litech.org/${PN}/${P}.tar.bz2"
|
|
9 |
HOMEPAGE="https://github.com/apalrd/tayga"
|
|
10 |
SRC_URI="https://github.com/apalrd/${PN}/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
|
| 11 |
11 |
|
| 12 |
12 |
LICENSE="GPL-2"
|
| 13 |
13 |
SLOT="0"
|
| 14 |
|
KEYWORDS="amd64 ~arm64 ~riscv"
|
| 15 |
|
|
| 16 |
|
PATCHES=(
|
| 17 |
|
"${FILESDIR}"/${P}-static-EAM.patch
|
| 18 |
|
"${FILESDIR}"/${P}-manpage-RFC.patch
|
| 19 |
|
"${FILESDIR}"/${P}-release-reserved-addr.patch
|
| 20 |
|
"${FILESDIR}"/${PN}-0.9.2-Fix-implicit-function-declaration.patch
|
| 21 |
|
)
|
|
14 |
KEYWORDS="~amd64 ~arm64 ~riscv"
|
| 22 |
15 |
|
| 23 |
16 |
src_prepare() {
|
| 24 |
17 |
default
|
| 25 |
|
sed -e '/^CFLAGS/d' \
|
| 26 |
|
-i configure.ac || die "sed failed"
|
| 27 |
|
eautoreconf
|
|
18 |
|
|
19 |
export prefix="${EPREFIX}/usr"
|
|
20 |
export sysconfdir="${EPREFIX}/etc"
|
|
21 |
export servicedir="$(systemd_get_systemunitdir)"
|
|
22 |
|
|
23 |
# Unconditionally install init scripts
|
|
24 |
export WITH_SYSTEMD=1
|
|
25 |
export WITH_OPENRC=1
|
| 28 |
26 |
}
|
| 29 |
27 |
|
| 30 |
|
src_install() {
|
| 31 |
|
default
|
| 32 |
|
newconfd "${FILESDIR}"/tayga.confd ${PN}
|
| 33 |
|
newinitd "${FILESDIR}"/tayga.initd ${PN}
|
|
28 |
src_compile() {
|
|
29 |
# Disable dynamic version detection
|
|
30 |
emake TAYGA_VERSION="${PV}" TAYGA_BRANCH=main TAYGA_COMMIT=RELEASE
|
|
31 |
}
|
|
32 |
|
|
33 |
pkg_postinst() {
|
|
34 |
local src="${EROOT}/var/db/tayga"
|
|
35 |
local dst="${EROOT}/var/lib/tayga"
|
|
36 |
|
|
37 |
if [[ -d "${src}" ]]; then
|
|
38 |
einfo "${src} exists. Upstream moved the state directory"
|
|
39 |
einfo "to ${dst}. Attempting to follow suit..."
|
|
40 |
|
|
41 |
if [[ -e "${dst}" ]]; then
|
|
42 |
ewarn "${dst} exists, skipping move."
|
|
43 |
else
|
|
44 |
mv -- "${src}" "${dst}" || ewarn "Move failed."
|
|
45 |
fi
|
|
46 |
fi
|
| 34 |
47 |
}
|