logo

overlay

My (experimental) gentoo overlay
commit: 90e1c10ef0f3fbb657aa9fcf42c608ddf6d51b75
parent: a6fcf36147662698b40d71e67a3bd6a35bf989bc
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Wed, 27 Feb 2019 10:12:21 +0100

net-misc/cjdns: Bump to EAPI-7, use contrib initd script

Diffstat:

Mnet-misc/cjdns/cjdns-20.2.ebuild17+++++++++--------
Dnet-misc/cjdns/files/cjdns.initd32--------------------------------
2 files changed, 9 insertions(+), 40 deletions(-)

diff --git a/net-misc/cjdns/cjdns-20.2.ebuild b/net-misc/cjdns/cjdns-20.2.ebuild @@ -1,11 +1,12 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2018 Gentoo Authors +# Copyright 2018-2019 Haelwenn (lanodan) Monnier <contact@hacktivis.me> # Distributed under the terms of the GNU General Public License v2 -EAPI=5 +EAPI=7 PYTHON_COMPAT=( python3_{4,5,6} ) -inherit eutils linux-info systemd python-single-r1 flag-o-matic +inherit linux-info systemd python-single-r1 flag-o-matic DESCRIPTION="encrypted IPv6 using public-key cryptography for allocation and DHT for routing" HOMEPAGE="https://github.com/cjdelisle/cjdns" @@ -18,6 +19,8 @@ IUSE="" S="${WORKDIR}/cjdns-cjdns-v${PV}" +PATCHES=( "${FILESDIR}/${PN}-fix_systemd_units.patch" ) + pkg_setup() { linux-info_pkg_setup if ! linux_config_exists; then @@ -28,10 +31,6 @@ pkg_setup() { fi } -src_prepare() { - epatch "${FILESDIR}/${PN}-fix_systemd_units.patch" -} - src_compile() { python-single-r1_pkg_setup append-flags -Wno-error @@ -41,7 +40,7 @@ src_compile() { src_install() { systemd_dounit contrib/systemd/cjdns.service systemd_dounit contrib/systemd/cjdns-resume.service - newinitd "${FILESDIR}/cjdns.initd" cjdns + newinitd contrib/openrc/cjdns cjdns dodoc README.md dosbin cjdroute @@ -59,12 +58,14 @@ pkg_postinst() { elog "The keys in ${config_path} have been autogenerated during" elog "emerge, they are not defaults and do not need to be overwritten." fi + ewarn "Protect ${config_path}! A lost conf file means you have " ewarn "lost your password and connections and anyone who connected " ewarn "to you will no longer be able to connect. A *compromised* " ewarn "conf file means that other people can impersonate you on " ewarn "the network." ewarn + einfo "The cjdns runscript will load the TUN kernel module automatically." einfo "If you are using systemd and have TUN built as a module, add tun " einfo "to /etc/modules-load.d/ for automatic loading at boot-time." diff --git a/net-misc/cjdns/files/cjdns.initd b/net-misc/cjdns/files/cjdns.initd @@ -1,32 +0,0 @@ -#!/sbin/openrc-run -description="Encrypted networking for regular people." - -CONFFILE=/etc/cjdroute.conf - -command="/usr/sbin/cjdroute" - -depend() { - use net dns - after precursor -} - -start() { - if [ ! -e /dev/net/tun ]; then - ebegin "Inserting TUN module" - - if ! modprobe tun; then - eerror "Failed to insert TUN kernel module" - exit 1 - fi - fi - - ebegin "Starting CJDNS" - start-stop-daemon --start --quiet --exec "${command}" -- < "${CONFFILE}" - eend $? -} - -stop() { - ebegin "Stopping CJDNS" - start-stop-daemon --stop --exec "${command}" - eend $? -}