commit:     b09cb12d8eaf6c08054b42f67730a84a4b23aa66
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 10 00:42:26 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Mar 10 00:42:26 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b09cb12d

net-irc/psybnc: modernise, fix invalid EROOT in src_*

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-irc/psybnc/psybnc-2.3.2.9-r3.ebuild | 32 ++++++++++++++++++++------------
 1 file changed, 20 insertions(+), 12 deletions(-)

diff --git a/net-irc/psybnc/psybnc-2.3.2.9-r3.ebuild 
b/net-irc/psybnc/psybnc-2.3.2.9-r3.ebuild
index b6593d48d19..5a3deaeb55f 100644
--- a/net-irc/psybnc/psybnc-2.3.2.9-r3.ebuild
+++ b/net-irc/psybnc/psybnc-2.3.2.9-r3.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -11,16 +11,18 @@ PSYBNC_HOME="/var/lib/psybnc"
 DESCRIPTION="A multi-user and multi-server gateway to IRC networks"
 HOMEPAGE="http://www.psybnc.at/index.html";
 SRC_URI="http://www.psybnc.at/download/beta/psyBNC-${MY_PV}.tar.gz";
+S="${WORKDIR}/${PN}"
 
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~amd64 ~ppc ~sparc ~x86"
 IUSE="ipv6 ssl oidentd scripting multinetwork"
 
-DEPEND="ssl? ( >=dev-libs/openssl-0.9.7d )
-               oidentd? ( >=net-misc/oidentd-2.0 )"
+DEPEND="
+       ssl? ( >=dev-libs/openssl-0.9.7d:= )
+       oidentd? ( >=net-misc/oidentd-2.0 )
+"
 RDEPEND="${DEPEND}"
-S="${WORKDIR}"/"${PN}"
 
 pkg_setup() {
        enewgroup psybnc
@@ -37,14 +39,15 @@ src_unpack() {
        # Pretend we already have a certificate, we generate it in pkg_config
        touch key/psybnc.cert.pem || die
 
-       if [[ -f ${ROOT}/usr/share/psybnc/salt.h ]]; then
+       if [[ -f "${EPREFIX}"/usr/share/psybnc/salt.h ]]; then
                einfo "Using existing salt.h for password encryption"
-               cp "${ROOT}"/usr/share/psybnc/salt.h salt.h || die
+               cp "${EPREFIX}"/usr/share/psybnc/salt.h salt.h || die
        fi
 }
 
 src_prepare() {
        default
+
        eapply "${FILESDIR}/compile.diff"
        eapply "${FILESDIR}/ldflags-fix.patch"
 
@@ -65,6 +68,7 @@ src_compile() {
        if use ipv6; then
                rm -f tools/chkipv6.c || die
        fi
+
        if use ssl; then
                rm -f tools/chkssl.c || die
        fi
@@ -118,7 +122,7 @@ src_install() {
 
 pkg_config() {
        if use ssl; then
-               if [[ -f ${ROOT}/etc/psybnc/ssl/psybnc.cert.pem || -f 
${ROOT}/etc/psybnc/ssl/psybnc.key.pem ]]; then
+               if [[ -f "${EROOT}"/etc/psybnc/ssl/psybnc.cert.pem || -f 
"${EROOT}"/etc/psybnc/ssl/psybnc.key.pem ]]; then
                        ewarn "Existing /etc/psybnc/psybnc.cert.pem or 
/etc/psybnc/psybnc.key.pem found!"
                        ewarn "Remove /etc/psybnc/psybnc.*.pem and run emerge 
--config =${CATEGORY}/${PF} again."
                        return
@@ -127,10 +131,12 @@ pkg_config() {
                einfo "Generating certificate request..."
                openssl req -new -out "${ROOT}"/etc/psybnc/ssl/psybnc.req.pem \
                        -keyout "${ROOT}"/etc/psybnc/ssl/psybnc.key.pem -nodes 
|| die
+
                einfo "Generating self-signed certificate..."
                openssl req -x509 -days 365 -in 
"${ROOT}"/etc/psybnc/ssl/psybnc.req.pem \
                        -key "${ROOT}"/etc/psybnc/ssl/psybnc.key.pem \
                        -out "${ROOT}"/etc/psybnc/ssl/psybnc.cert.pem || die
+
                einfo "Setting permissions on files..."
                chown root:psybnc 
"${ROOT}"/etc/psybnc/ssl/psybnc.{cert,key,req}.pem || die
                chmod 0640 "${ROOT}"/etc/psybnc/ssl/psybnc.{cert,key,req}.pem 
|| die
@@ -140,20 +146,22 @@ pkg_config() {
 pkg_postinst() {
        if use ssl; then
                elog
-               elog "Please run \"emerge --config =${CATEGORY}/${PF}\" to 
create needed SSL certificates."
+               elog "Please run \"emerge --config =${CATEGORY}/${PF}\" to 
create the needed SSL certificates."
        fi
+
        if use oidentd; then
                elog
                elog "You have enabled oidentd-support. You will need to set"
-               elog "up your /etc/oident.conf file before running psybnc. An 
example"
-               elog "for psyBNC can be found under /etc/oidentd.conf.psybnc"
+               elog "up your ${EROOT}/etc/oident.conf file before running 
psybnc. An example"
+               elog "for psyBNC can be found under 
${EROOT}/etc/oidentd.conf.psybnc"
        fi
+
        elog
        elog "You can connect to psyBNC on port 23998 with user gentoo and 
password gentoo."
-       elog "Please edit the psyBNC configuration at /etc/psybnc/psybnc.conf 
to change this."
+       elog "Please edit the psyBNC configuration at 
${EROOT}/etc/psybnc/psybnc.conf to change this."
        elog
        elog "To be able to reuse an existing psybnc.conf, you need to make 
sure that the"
-       elog "old salt.h is available at /usr/share/psybnc/salt.h when 
compiling a new"
+       elog "old salt.h is available at ${EROOT}/usr/share/psybnc/salt.h when 
compiling a new"
        elog "version of psyBNC. It is needed for password encryption and 
decryption."
        elog
 }

Reply via email to