From c6e62298405d39e635c0d8dd6e026c8cb667a478 Mon Sep 17 00:00:00 2001
From: V3n3RiX <venerix@koprulu.sector>
Date: Tue, 12 Mar 2024 06:46:08 +0000
Subject: gentoo auto-resync : 12:03:2024 - 06:46:08

---
 net-irc/psybnc/Manifest                            |   8 +-
 .../files/psybnc-2.4.3-strmncpy-lto-mismatch.patch |  23 +++
 net-irc/psybnc/files/psybnc-oidentd.initd          |   8 +-
 net-irc/psybnc/files/psybnc.initd                  |   8 +-
 net-irc/psybnc/psybnc-2.3.2.9-r4.ebuild            | 166 --------------------
 net-irc/psybnc/psybnc-2.4.3-r1.ebuild              | 171 +++++++++++++++++++++
 6 files changed, 206 insertions(+), 178 deletions(-)
 create mode 100644 net-irc/psybnc/files/psybnc-2.4.3-strmncpy-lto-mismatch.patch
 delete mode 100644 net-irc/psybnc/psybnc-2.3.2.9-r4.ebuild
 create mode 100644 net-irc/psybnc/psybnc-2.4.3-r1.ebuild

(limited to 'net-irc/psybnc')

diff --git a/net-irc/psybnc/Manifest b/net-irc/psybnc/Manifest
index 7a73d0155999..a9083162fbeb 100644
--- a/net-irc/psybnc/Manifest
+++ b/net-irc/psybnc/Manifest
@@ -5,12 +5,12 @@ AUX psybnc-2.3.2.9-multinetwork.patch 265 BLAKE2B 3bca2c18d521fe34445433090564e7
 AUX psybnc-2.3.2.9-oidentd.patch 236 BLAKE2B 1af1ba8e2ca6edc8fa64040bfb4e195b9486356284bf83a95df9cbc69c5307a3845dc70586978dc2ee0ffd75cc48f9e88e9fb6c709b504a01e7e8906636c5257 SHA512 60e528060582f07e7b81d522bd93d0b69adba4ec56babde704baa820edc420b7a50d4158ce916f3a767a7d705f98fa30ac8229f64e8549eb551a47780ae002f4
 AUX psybnc-2.3.2.9-scripting.patch 248 BLAKE2B b0dec6f5202f6c5a38020c179fdd3cbe932028141c2c95d4a236a1f0140c1feddc60165197ab69ccad6a481f8e84c16dc950644e56bfd9af2c678a80ff9b6898 SHA512 8fbaa82295c53a8b592500c87aab92d46cc0f28d7d89cb8e3957671cc94f785dee52e405196cea8782a192ae942f3b29c892c03cdc2e94d00a2c73b196d4de36
 AUX psybnc-2.4.3-Fix-build-with-Clang-16.patch 4045 BLAKE2B e59d829f759d39993e95bffaec8f38384161ab456280f70e5ccfc26567a883d29da979f5e97759015c571f1c3b065396779a5d9ae3d636179d011e7fb88909ae SHA512 97588a9220100d9da28badb265d41c8d34ec4ec794a86433c30f5397aa05fa18f36845ee49e02ac11dea3a951788f314cd854659966b1b27b5e6aa5e933b2fa5
-AUX psybnc-oidentd.initd 931 BLAKE2B d50dbad91198c457254edf568b7c203ba8f4c1dfdbb9c8a38b12ca5086b74b337f85fe514bd8ed74c0eacad9ba25bc36d1c385d96c03ea41d20ccf5150aac407 SHA512 bc338b243d5cf73da0c662601ea2e5fadbe34a64f57cd0d09be55c773e1e1f807fb0c43d46d225a9461d353762b16cf6010710fbf4f43a9dece5130374952e12
+AUX psybnc-2.4.3-strmncpy-lto-mismatch.patch 779 BLAKE2B 7a105e10763b26696454598c6bf6fa8a54d4f9fc093852fbd7c2fc8fab9430427e02385a93873ba4ef1bdb037908a47e7158f1f3d26e5785124f246769512bdf SHA512 33643b4428ec1656eb3a7214c0d1d0bdeed13525776cdd3a073f29b099e9ee89d6c3942bddab703ea3ed36fc3bc4cea193749c5200fe77a84a9b3dfb58448930
+AUX psybnc-oidentd.initd 929 BLAKE2B 11334134fb6b91a401dd56048ff41fdc79ca99245928ff4026995ff1491a8af51688fd8a08889b41b1c692243eb69612c1b453cbf7503aa947566120d06ee567 SHA512 baabf5a8fee9526ec1aa73f7d8db01cf579da4a20313de52df7840b60bd3b0f2c4a48b80b2cfadf187f65b2f0c6486d4f18dfb8f2b0323e00aaba3d45c5c38d9
 AUX psybnc.conf 313 BLAKE2B c56022b42942b100479b6c539e9da85178db679b6596fc2b416299c929cdfac35b83cb1181d8ff3eedb4f17b1c711c97e6c73ae1a40e2f09b7c756ad3415025e SHA512 0a5f587e70f9c9a83da820a03e77b6b119c5094fa334397762c4838c0a88bb5574a17d7aded274dab9bb6b041d1758e08e3f0d78df71b382bdc04fc8aabe3317
 AUX psybnc.confd 113 BLAKE2B e4fddc3cb37c5b9defea0d4d6e6c2b26f34bf50fbbe51679b8f0e686b504c2caf980c5a97864fac86a251431126c5a0338bb50a8eba9d3976156cf1eaf1b7681 SHA512 e58704dec299271d9a450eb243d0af1323aca58d555b61fc3aa899324a6bdc9aa82afc0597c190dc07c278f22c7cb448592a271e9ee6e4aa3552518ce6254753
-AUX psybnc.initd 898 BLAKE2B 7be60ef0dda81cb917e23e06e3fec88af952d71c2eef4255c316baf5a218e8bdc2d8d8bc4eb353ab7c19a697e97685441ec2a0c3503e4f22adf0d55c9a895e13 SHA512 2ea77dfd515b81d53d7fe1b38fe3069d7d2081d939fdbb2c6ff97cd859a86ad8a52dd1b40e0b592a9368488759a3fb35741e25c6a5ade3045eb7159acd64bbbd
-DIST psyBNC-2.3.2-9.tar.gz 318676 BLAKE2B 0197aa3bc8c770738a7d4d5a5a79b77f7a0cafeef60ccca1167172b28af05c0cd9836f7e9816c873dafa2e55b0bf9ce54cfbe3958939405f58f7f3874ec7ea64 SHA512 b664f57610e54fadd938b359a0e8052b8fe3dd36bd1ee339f36ee22ae4d36a76e803425c5133f925ac18c01767ffbc8a2f471c014b5b76b05894cfea9fe5416b
+AUX psybnc.initd 896 BLAKE2B 2ce596d089c8da1b32020571bbc8bebc9ab3aa2a7aa7dbacb8e62646bbc3876308cc5204a56acfddf003bf69defa879c94b7564fba78ba494478fde237a520c0 SHA512 101a8d5926c779b7de2df767070ea230fc14a0c9ff42449f0f2b7355fefb74956c18817253b30cd2d9db048d62b3e32ce24d61038023e33702034b2923c26461
 DIST psyBNC-2.4.3.tar.gz 1108733 BLAKE2B e0f02cab97b503301db0a4c111497e4f99b75d8d2c798b2b5d97997a4c4921d8a7de8dabad79c1291fa4b7efce0d1ed0c7dede1345b155561bb6ce6033b591bb SHA512 02228baef6fa889d5e12bfa715facc2eab3b033c01b1f799a1c6c995ef9eedfacf3ed328c875f52595d64c47124c20e4145288b2636182dea17ec9027d367bb7
-EBUILD psybnc-2.3.2.9-r4.ebuild 4694 BLAKE2B 31e2720550293deb08b875d63fc7fd7eedae29386b106e72580c5aa4c972fd1515f4e6226c6e008c6f630b440dcf03409acbfd7a744f327c7def505dfa03382e SHA512 b9e1617ae16d5a06d15b48c56275d8ba6855316d3940d2874b9e137209402bf7b990c192c5912ba5fb7a06e109b393f341c672c7e61da31a69a8aa7622791d80
+EBUILD psybnc-2.4.3-r1.ebuild 4759 BLAKE2B 4327f0cf5525103af222dbf4d973d0afcd8c48c787801bc3388636c768f04b0ad26e4ef876aa52fcb58abc0d6de14c60c6a7b5f91ec82086bbd56c4165e347d8 SHA512 7414878dc90be59ee9301657f2a31e8c521b5c783d94d6f1bb7b1421d08c10469fb12ae59d6041c938e9dd6ac9f1ad89b46c0b1759df2977028dce077050d2e3
 EBUILD psybnc-2.4.3.ebuild 4688 BLAKE2B 69ec35e57f32b129bd4d46bf0f2179ec833ca0bc5b4b3d94ab0dfe199809f2061a9ce679f5425b8d34ef165a169c84ce38b62a37a672c28a326b7f533915a75e SHA512 48f79fbb6b5d7379e117e4eb8d01877f45a061d17bb545585ae65ca66a208ce454e756e13ab25dd2346a1305cd2813de99c7d58fa5f20cfc432282035543c5b4
 MISC metadata.xml 361 BLAKE2B 66e3ce95043d6691e73a6e5efc2637e0f0d0e6638e034fe7687ba67f9e5c40c6e416ae020e1508e9d0f9636c5e833aa364051bacedb15ad3ca9f48cd726854d1 SHA512 75103320e23878d078c05c1a763aa2526ed79a7cf953f3f3c2a272e7d215b5ba95dcc60581186ac73db07a2891abe9ab4e82d906f4e2494e63004ce435a8f9e8
diff --git a/net-irc/psybnc/files/psybnc-2.4.3-strmncpy-lto-mismatch.patch b/net-irc/psybnc/files/psybnc-2.4.3-strmncpy-lto-mismatch.patch
new file mode 100644
index 000000000000..cd0325613fe1
--- /dev/null
+++ b/net-irc/psybnc/files/psybnc-2.4.3-strmncpy-lto-mismatch.patch
@@ -0,0 +1,23 @@
+https://bugs.gentoo.org/861464
+--- a/src/p_global.h
++++ b/src/p_global.h
+@@ -1109,7 +1109,7 @@ int replace(char *rps, char whatc, char toc);
+ char *nobreak(char *tobreak);
+ char *randstring(int length);
+ char *strmcat(char *first,char *second);
+-char *strmncpy(char *dest, char *source, unsigned int len);
++char *strmncpy(char *dest, char *source, size_t len);
+ int strmncasecmp(char *one, char *two);
+ int strmcmp(char *one, char *two);
+ int strmwildcmp(char *line, char *wildcard);
+--- a/src/p_string.c
++++ b/src/p_string.c
+@@ -56,7 +56,7 @@ int ucase (char *inc)
+ 
+ /* string copy with len and zero delimit */
+ 
+-char *strmncpy(char *dest, char *source, unsigned int len)
++char *strmncpy(char *dest, char *source, size_t len)
+ {
+     char bf[strlen(source)+2];
+     char *pt;
diff --git a/net-irc/psybnc/files/psybnc-oidentd.initd b/net-irc/psybnc/files/psybnc-oidentd.initd
index 354e6416c23e..b50c8b132c7c 100644
--- a/net-irc/psybnc/files/psybnc-oidentd.initd
+++ b/net-irc/psybnc/files/psybnc-oidentd.initd
@@ -7,19 +7,19 @@ depend() {
 }
 
 check_config() {
-	if [[ ! -f ${PSYBNC_CONFIG} ]]
+	if [ ! -f ${PSYBNC_CONFIG} ]
 	then
 	    eerror "Please set \$PSYBNC_CONFIG in /etc/conf.d/psybnc!"
 	    return 1
 	fi
 
-	if [[ ! -d "${PSYBNC_HOME}" ]]
+	if [ ! -d "${PSYBNC_HOME}" ]
 	then
 	    eerror "Please set \$PSYBNC_HOME in /etc/conf.d/psybnc!"
 	    return 1
 	fi
 
-	if [[ -z "${PSYBNC_USER}" ]]
+	if [ -z "${PSYBNC_USER}" ]
 	then
 	    eerror "Please set \$PSYBNC_USER in /etc/conf.d/psybnc!"
 	    return 1
@@ -29,7 +29,7 @@ check_config() {
 start() {
 	check_config || return 1
 	ebegin "Starting psyBNC"
-	start-stop-daemon --start --quiet --chuid "${PSYBNC_USER}" --chdir "${PSYBNC_HOME}" -e HOME="${PSYBNC_HOME}" --exec /usr/bin/psybnc -- "${PSYBNC_CONFIG}" &>/dev/null
+	start-stop-daemon --start --quiet --chuid "${PSYBNC_USER}" --chdir "${PSYBNC_HOME}" -e HOME="${PSYBNC_HOME}" --exec /usr/bin/psybnc -- "${PSYBNC_CONFIG}" >/dev/null 2>&1
 	eend $?
 }
 
diff --git a/net-irc/psybnc/files/psybnc.initd b/net-irc/psybnc/files/psybnc.initd
index add37167139b..da01ec9ac422 100644
--- a/net-irc/psybnc/files/psybnc.initd
+++ b/net-irc/psybnc/files/psybnc.initd
@@ -7,19 +7,19 @@ depend() {
 }
 
 check_config() {
-	if [[ ! -f ${PSYBNC_CONFIG} ]]
+	if [ ! -f ${PSYBNC_CONFIG} ]
 	then
 	    eerror "Please set \$PSYBNC_CONFIG in /etc/conf.d/psybnc!"
 	    return 1
 	fi
 
-	if [[ ! -d "${PSYBNC_HOME}" ]]
+	if [ ! -d "${PSYBNC_HOME}" ]
 	then
 	    eerror "Please set \$PSYBNC_HOME in /etc/conf.d/psybnc!"
 	    return 1
 	fi
 
-	if [[ -z "${PSYBNC_USER}" ]]
+	if [ -z "${PSYBNC_USER}" ]
 	then
 	    eerror "Please set \$PSYBNC_USER in /etc/conf.d/psybnc!"
 	    return 1
@@ -29,7 +29,7 @@ check_config() {
 start() {
 	check_config || return 1
 	ebegin "Starting psyBNC"
-	start-stop-daemon --start --quiet --chuid "${PSYBNC_USER}" --chdir "${PSYBNC_HOME}" --exec /usr/bin/psybnc -- "${PSYBNC_CONFIG}" &>/dev/null
+	start-stop-daemon --start --quiet --chuid "${PSYBNC_USER}" --chdir "${PSYBNC_HOME}" --exec /usr/bin/psybnc -- "${PSYBNC_CONFIG}" >/dev/null 2>&1
 	eend $?
 }
 
diff --git a/net-irc/psybnc/psybnc-2.3.2.9-r4.ebuild b/net-irc/psybnc/psybnc-2.3.2.9-r4.ebuild
deleted file mode 100644
index 684b08d88a1f..000000000000
--- a/net-irc/psybnc/psybnc-2.3.2.9-r4.ebuild
+++ /dev/null
@@ -1,166 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit toolchain-funcs
-
-MY_PV="$(ver_rs 3 -)"
-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="
-	acct-group/psybnc
-	acct-user/psybnc
-	ssl? ( >=dev-libs/openssl-0.9.7d:= )
-	oidentd? ( >=net-misc/oidentd-2.0 )
-"
-RDEPEND="${DEPEND}"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.3.2.9-compile.patch
-	"${FILESDIR}"/${PN}-2.3.2.9-ldflags-fix.patch
-)
-
-src_unpack() {
-	unpack ${A}
-	cd "${S}" || die
-
-	# Useless files
-	rm -f */INFO || die
-
-	# Pretend we already have a certificate, we generate it in pkg_config
-	touch key/psybnc.cert.pem || die
-
-	if [[ -f "${EPREFIX}"/usr/share/psybnc/salt.h ]]; then
-		einfo "Using existing salt.h for password encryption"
-		cp "${EPREFIX}"/usr/share/psybnc/salt.h salt.h || die
-	fi
-}
-
-src_prepare() {
-	default
-
-	# Add oidentd
-	use oidentd && PATCHES+=( "${FILESDIR}"/${P}-oidentd.patch )
-
-	# Add scripting support
-	use scripting && PATCHES+=( "${FILESDIR}"/${P}-scripting.patch )
-
-	# Add multinetwork support
-	use multinetwork && PATCHES+=( "${FILESDIR}"/${P}-multinetwork.patch )
-
-	# Prevent stripping the binary
-	sed -i -e "/@strip/ d" tools/autoconf.c || die
-}
-
-src_compile() {
-	if use ipv6; then
-		rm -f tools/chkipv6.c || die
-	fi
-
-	if use ssl; then
-		rm -f tools/chkssl.c || die
-	fi
-
-	emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
-}
-
-src_install() {
-	dobin psybnc
-
-	insinto /usr/share/psybnc
-	doins -r help lang salt.h
-	fperms 0600 /usr/share/psybnc/salt.h
-
-	insinto /etc/psybnc
-	doins "${FILESDIR}"/psybnc.conf
-
-	keepdir "${PSYBNC_HOME}"/{log,motd,scripts}
-	dosym ../../../usr/share/psybnc/lang "${PSYBNC_HOME}"/lang
-	dosym ../../../usr/share/psybnc/help "${PSYBNC_HOME}"/help
-
-	fowners psybnc:psybnc "${PSYBNC_HOME}"/{,log,motd,scripts} /etc/psybnc/psybnc.conf
-	fperms 0750 "${PSYBNC_HOME}"/{,log,motd,scripts}
-	fperms 0640 /etc/psybnc/psybnc.conf
-
-	if use ssl; then
-		keepdir /etc/psybnc/ssl
-		dosym ../../../etc/psybnc/ssl "${PSYBNC_HOME}"/key
-	else
-		# Drop SSL listener from psybnc.conf
-		sed -i -e "/^# Default SSL listener$/,+4 d" "${D}"/etc/psybnc/psybnc.conf || die
-	fi
-
-	if use oidentd; then
-		insinto /etc
-		doins "${FILESDIR}"/oidentd.conf.psybnc
-		fperms 640 /etc/oidentd.conf.psybnc
-		# Install init-script with oidentd-support
-		newinitd "${FILESDIR}"/psybnc-oidentd.initd psybnc
-	else
-		# Install init-script without oidentd-support
-		newinitd "${FILESDIR}"/psybnc.initd psybnc
-	fi
-
-	newconfd "${FILESDIR}"/psybnc.confd psybnc
-
-	dodoc CHANGES FAQ README SCRIPTING TODO
-	docinto example-script
-	dodoc scripts/example/DEFAULT.SCRIPT
-}
-
-pkg_config() {
-	if use ssl; 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
-		fi
-
-		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
-	fi
-}
-
-pkg_postinst() {
-	if use ssl; then
-		elog
-		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 ${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 ${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 ${EROOT}/usr/share/psybnc/salt.h when compiling a new"
-	elog "version of psyBNC. It is needed for password encryption and decryption."
-	elog
-}
diff --git a/net-irc/psybnc/psybnc-2.4.3-r1.ebuild b/net-irc/psybnc/psybnc-2.4.3-r1.ebuild
new file mode 100644
index 000000000000..e9be325cd095
--- /dev/null
+++ b/net-irc/psybnc/psybnc-2.4.3-r1.ebuild
@@ -0,0 +1,171 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+MY_PV="$(ver_rs 3 -)"
+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://psybnc.org/download/psyBNC-${PV}.tar.gz"
+S="${WORKDIR}"/${PN}
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+IUSE="ipv6 ssl oidentd scripting multinetwork"
+
+DEPEND="
+	acct-group/psybnc
+	acct-user/psybnc
+	net-dns/c-ares
+	ssl? ( >=dev-libs/openssl-0.9.7d:= )
+	oidentd? ( >=net-misc/oidentd-2.0 )
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.4.3-Fix-build-with-Clang-16.patch
+	"${FILESDIR}"/${PN}-2.4.3-strmncpy-lto-mismatch.patch
+)
+
+src_unpack() {
+	unpack ${A}
+	cd "${S}" || die
+
+	# Useless files
+	rm -f */INFO || die
+
+	# Pretend we already have a certificate, we generate it in pkg_config
+	touch key/psybnc.cert.pem || die
+
+	if [[ -f "${EPREFIX}"/usr/share/psybnc/salt.h ]]; then
+		einfo "Using existing salt.h for password encryption"
+		cp "${EPREFIX}"/usr/share/psybnc/salt.h salt.h || die
+	fi
+}
+
+src_prepare() {
+	default
+
+	# Add oidentd
+	use oidentd && PATCHES+=( "${FILESDIR}"/${P}-oidentd.patch )
+
+	# Add scripting support
+	use scripting && PATCHES+=( "${FILESDIR}"/${P}-scripting.patch )
+
+	# Add multinetwork support
+	use multinetwork && PATCHES+=( "${FILESDIR}"/${P}-multinetwork.patch )
+
+	# Prevent stripping the binary
+	sed -i -e "/@strip/ d" tools/autoconf.c || die
+}
+
+src_compile() {
+	if use ipv6; then
+		rm -f tools/chkipv6.c || die
+	fi
+
+	if use ssl; then
+		rm -f tools/chkssl.c || die
+	fi
+
+	emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+	dobin psybnc
+
+	insinto /usr/share/psybnc
+	doins -r help lang salt.h
+	fperms 0600 /usr/share/psybnc/salt.h
+
+	insinto /etc/psybnc
+	doins "${FILESDIR}"/psybnc.conf
+
+	keepdir "${PSYBNC_HOME}"/{log,motd,scripts}
+	dosym ../../../usr/share/psybnc/lang "${PSYBNC_HOME}"/lang
+	dosym ../../../usr/share/psybnc/help "${PSYBNC_HOME}"/help
+
+	fowners psybnc:psybnc "${PSYBNC_HOME}"/{,log,motd,scripts} /etc/psybnc/psybnc.conf
+	fperms 0750 "${PSYBNC_HOME}"/{,log,motd,scripts}
+	fperms 0640 /etc/psybnc/psybnc.conf
+
+	if use ssl; then
+		keepdir /etc/psybnc/ssl
+		dosym ../../../etc/psybnc/ssl "${PSYBNC_HOME}"/key
+	else
+		# Drop SSL listener from psybnc.conf
+		sed -i -e "/^# Default SSL listener$/,+4 d" "${D}"/etc/psybnc/psybnc.conf || die
+	fi
+
+	if use oidentd; then
+		insinto /etc
+		doins "${FILESDIR}"/oidentd.conf.psybnc
+		fperms 640 /etc/oidentd.conf.psybnc
+		# Install init-script with oidentd-support
+		newinitd "${FILESDIR}"/psybnc-oidentd.initd psybnc
+	else
+		# Install init-script without oidentd-support
+		newinitd "${FILESDIR}"/psybnc.initd psybnc
+	fi
+
+	if use scripting ; then
+		dodoc SCRIPTING
+	fi
+
+	newconfd "${FILESDIR}"/psybnc.confd psybnc
+
+	dodoc CHANGES FAQ README TODO
+	docinto example-script
+	dodoc scripts/example/DEFAULT.SCRIPT
+}
+
+pkg_config() {
+	if use ssl; 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
+		fi
+
+		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
+	fi
+}
+
+pkg_postinst() {
+	if use ssl; then
+		elog
+		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 ${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 ${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 ${EROOT}/usr/share/psybnc/salt.h when compiling a new"
+	elog "version of psyBNC. It is needed for password encryption and decryption."
+	elog
+}
-- 
cgit v1.2.3