|
| 1 | +# SPDX-License-Identifier: GPL-2.0 |
| 2 | +# Copyright 2022-2024 Jason André Charles Gantner |
| 3 | +# Distributed under the terms of the GNU General Public License v2 |
| 4 | + |
| 5 | +EAPI=8 |
| 6 | + |
| 7 | +DESCRIPTION="An Open Source implementation of multiple NAT64 RFC for linux" |
| 8 | +HOMEPAGE="https://jool.mx/" |
| 9 | +IUSE="bash-completion dist-kernel doc iptables +nat64 +siit +tools" |
| 10 | +SLOT="0" |
| 11 | +LICENSE="GPL-2 doc? ( FDL-1.3 )" |
| 12 | +KEYWORDS="~amd64" |
| 13 | +SRC_URI=" |
| 14 | + https://github.com/NICMx/Jool/releases/download/v${PV}/${P}.tar.gz |
| 15 | + verify-sig? ( https://github.com/NICMx/Jool/releases/download/v${PV}/${P}.tar.gz.asc ) |
| 16 | + " |
| 17 | + |
| 18 | +REQUIRED_USE=" |
| 19 | + || ( nat64 siit ) |
| 20 | + " |
| 21 | + |
| 22 | +inherit linux-mod bash-completion-r1 |
| 23 | + |
| 24 | +# Autotools config |
| 25 | +WANT_AUTOCONF='latest' |
| 26 | +WANT_LIBTOOL='latest' |
| 27 | +AUTOTOOLS_AUTO_DEPEND='no' |
| 28 | + |
| 29 | +# verify-sig config |
| 30 | +VERIFY_SIG_OPENPGP_KEY_PATH= |
| 31 | + |
| 32 | +# inherit now that necessary config has been added |
| 33 | +inherit verify-sig autotools |
| 34 | + |
| 35 | +DEPEND=" |
| 36 | + iptables? ( net-firewall/iptables ) |
| 37 | +" |
| 38 | +RDEPEND="${DEPEND}" |
| 39 | +BDEPEND=" |
| 40 | + sys-kernel/linux-headers |
| 41 | + tools? ( ${AUTOTOOLS_DEPEND} ) |
| 42 | + doc? ( www-apps/jekyll ) |
| 43 | + dist-kernel? ( virtual/dist-kernel ) |
| 44 | +" |
| 45 | + |
| 46 | +#TODO: add te following line once the upstream signing keys has been identified and packaged |
| 47 | +# verify-sig? ( sec-keys/openpgp-keys- ) |
| 48 | + |
| 49 | +# linux-mod config |
| 50 | +BUILD_TARGETS='clean modules' |
| 51 | +MODULES_NAMES='jool_common(extra:src/mod/common)' |
| 52 | + |
| 53 | +pkg_pretend(){ |
| 54 | + use_m 3 13 0 || { |
| 55 | + eerror 'Supported Linux kernels are >= 3.13.0' |
| 56 | + die |
| 57 | + } |
| 58 | + if use siit;then |
| 59 | + MODULES_NAMES+=' jool_siit(extra:src/mod/jool_siit)' |
| 60 | + fi |
| 61 | + if use nat64;then |
| 62 | + MODULES_NAMES+=' jool(extra:src/mod/jool)' |
| 63 | + fi |
| 64 | +} |
| 65 | + |
| 66 | +pkg_setup(){ |
| 67 | + linux-mod_pkg_setup |
| 68 | +} |
| 69 | + |
| 70 | +src_prepare(){ |
| 71 | + eautoreconf && econf |
| 72 | +} |
| 73 | + |
| 74 | +src_compile(){ |
| 75 | + linux-mod_src_compile |
| 76 | + |
| 77 | + if use tools; then |
| 78 | + emake -C "${S}/src/tools" |
| 79 | + fi |
| 80 | + |
| 81 | + if use doc; then |
| 82 | + cd docs && jekyll build || die |
| 83 | + fi |
| 84 | +} |
| 85 | + |
| 86 | +src_install(){ |
| 87 | + default |
| 88 | + if use doc;then |
| 89 | + dodoc -r docs/_site |
| 90 | + fi |
| 91 | + use bash-completion && dobashcomp src/*/*/*.bash |
| 92 | + dodoc src/*/*/*.? |
| 93 | +} |
| 94 | + |
| 95 | +# vim: set syntax=modeline notabexpand |
0 commit comments