public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-irc/psybnc/files/, net-irc/psybnc/
@ 2018-09-27 21:27 Patrice Clement
  0 siblings, 0 replies; 4+ messages in thread
From: Patrice Clement @ 2018-09-27 21:27 UTC (permalink / raw
  To: gentoo-commits

commit:     2c032948f9de88cae579a5e6a12705cce59f6ce5
Author:     Michael Mair-Keimberger <m.mairkeimberger <AT> gmail <DOT> com>
AuthorDate: Fri Sep 21 18:36:08 2018 +0000
Commit:     Patrice Clement <monsieurp <AT> gentoo <DOT> org>
CommitDate: Thu Sep 27 21:26:44 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2c032948

net-irc/psybnc: EAPI7, improve ebuild.

Closes: https://bugs.gentoo.org/666720
Signed-off-by: Michael Mair-Keimberger <m.mairkeimberger <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/9937

 net-irc/psybnc/files/compile.diff                  |  30 ++--
 .../psybnc/files/psybnc-2.3.2.9-multinetwork.patch |   4 +-
 net-irc/psybnc/files/psybnc-2.3.2.9-oidentd.patch  |   4 +-
 .../psybnc/files/psybnc-2.3.2.9-scripting.patch    |   4 +-
 net-irc/psybnc/psybnc-2.3.2.9-r3.ebuild            | 159 +++++++++++++++++++++
 5 files changed, 180 insertions(+), 21 deletions(-)

diff --git a/net-irc/psybnc/files/compile.diff b/net-irc/psybnc/files/compile.diff
index fdee75c6073..99e55b6d8cd 100644
--- a/net-irc/psybnc/files/compile.diff
+++ b/net-irc/psybnc/files/compile.diff
@@ -1,6 +1,6 @@
-diff -Naurp src/p_blowfish.c src/p_blowfish.c
---- src/p_blowfish.c	2007-02-26 12:16:53.000000000 +0000
-+++ src/p_blowfish.c	2007-02-26 12:17:11.000000000 +0000
+diff -Naurp a/src/p_blowfish.c b/src/p_blowfish.c
+--- a/src/p_blowfish.c	2007-02-26 12:16:53.000000000 +0000
++++ b/src/p_blowfish.c	2007-02-26 12:17:11.000000000 +0000
 @@ -31,7 +31,7 @@ static char rcsid[] = "@(#)# $Id$
  #include <string.h>
  #include <config.h>
@@ -10,9 +10,9 @@ diff -Naurp src/p_blowfish.c src/p_blowfish.c
  char *lngtxt(int msgnum);
  
  #define pcontext { strmncpy(ctxt,__FILE__,sizeof(ctxt));strmncpy(cfunc,__FUNCTION__,sizeof(cfunc)); cline=__LINE__; }
-diff -Naurp src/p_global.h src/p_global.h
---- src/p_global.h	2007-02-26 12:16:53.000000000 +0000
-+++ src/p_global.h	2007-02-26 12:17:11.000000000 +0000
+diff -Naurp a/src/p_global.h b/src/p_global.h
+--- a/src/p_global.h	2007-02-26 12:16:53.000000000 +0000
++++ b/src/p_global.h	2007-02-26 12:17:11.000000000 +0000
 @@ -972,8 +972,8 @@ int checklogging(int usern);
  #endif
  
@@ -33,9 +33,9 @@ diff -Naurp src/p_global.h src/p_global.h
  int strmncasecmp(char *one, char *two);
  int strmcmp(char *one, char *two);
  int strmwildcmp(char *line, char *wildcard);
-diff -Naurp src/p_memory.c src/p_memory.c
---- src/p_memory.c	2007-02-26 12:16:53.000000000 +0000
-+++ src/p_memory.c	2007-02-26 12:17:11.000000000 +0000
+diff -Naurp a/src/p_memory.c b/src/p_memory.c
+--- a/src/p_memory.c	2007-02-26 12:16:53.000000000 +0000
++++ b/src/p_memory.c	2007-02-26 12:17:11.000000000 +0000
 @@ -32,7 +32,7 @@ FILE *logm=NULL;
  
  /* malloc-wrapper. No memory will log an error entry and kill the bouncer */
@@ -54,9 +54,9 @@ diff -Naurp src/p_memory.c src/p_memory.c
  {
  #ifdef LOGALLOC
      if(logm==NULL)
-diff -Naurp src/p_string.c src/p_string.c
---- src/p_string.c	2007-02-26 12:16:53.000000000 +0000
-+++ src/p_string.c	2007-02-26 12:17:11.000000000 +0000
+diff -Naurp a/src/p_string.c b/src/p_string.c
+--- a/src/p_string.c	2007-02-26 12:16:53.000000000 +0000
++++ b/src/p_string.c	2007-02-26 12:17:11.000000000 +0000
 @@ -51,7 +51,7 @@ char *lngtxt(unsigned int msgnum)
  
  /* string copy with len and zero delimit */
@@ -66,9 +66,9 @@ diff -Naurp src/p_string.c src/p_string.c
  {
      char bf[strlen(source)+2];
      char *pt;
-diff -Naurp src/match.c src/match.c
---- src/match.c	2007-02-26 12:26:10.000000000 +0000
-+++ src/match.c	2007-02-26 12:26:17.000000000 +0000
+diff -Naurp a/src/match.c b/src/match.c
+--- a/src/match.c	2007-02-26 12:26:10.000000000 +0000
++++ b/src/match.c	2007-02-26 12:26:17.000000000 +0000
 @@ -36,6 +36,7 @@
  /* Remove the next line to use this in IrcII */
  #define EGGDROP

diff --git a/net-irc/psybnc/files/psybnc-2.3.2.9-multinetwork.patch b/net-irc/psybnc/files/psybnc-2.3.2.9-multinetwork.patch
index 4d796961d6f..b4688d7584c 100644
--- a/net-irc/psybnc/files/psybnc-2.3.2.9-multinetwork.patch
+++ b/net-irc/psybnc/files/psybnc-2.3.2.9-multinetwork.patch
@@ -1,5 +1,5 @@
---- config.h.orig	2009-06-10 21:30:24.000000000 +0000
-+++ config.h	2009-06-10 21:30:39.000000000 +0000
+--- a/config.h.orig	2009-06-10 21:30:24.000000000 +0000
++++ b/config.h	2009-06-10 21:30:39.000000000 +0000
 @@ -50,6 +50,10 @@
  
  #define BLOCKDNS

diff --git a/net-irc/psybnc/files/psybnc-2.3.2.9-oidentd.patch b/net-irc/psybnc/files/psybnc-2.3.2.9-oidentd.patch
index fbb4b163e3a..afc0dcfa140 100644
--- a/net-irc/psybnc/files/psybnc-2.3.2.9-oidentd.patch
+++ b/net-irc/psybnc/files/psybnc-2.3.2.9-oidentd.patch
@@ -1,5 +1,5 @@
---- config.h.orig	2008-12-14 20:02:57.000000000 +0000
-+++ config.h	2008-12-14 20:03:35.000000000 +0000
+--- a/config.h	2008-12-14 20:02:57.000000000 +0000
++++ b/config.h	2008-12-14 20:03:35.000000000 +0000
 @@ -14,6 +14,10 @@
  
  #define TRANSLATE

diff --git a/net-irc/psybnc/files/psybnc-2.3.2.9-scripting.patch b/net-irc/psybnc/files/psybnc-2.3.2.9-scripting.patch
index 08dce4fa715..a8586e0638d 100644
--- a/net-irc/psybnc/files/psybnc-2.3.2.9-scripting.patch
+++ b/net-irc/psybnc/files/psybnc-2.3.2.9-scripting.patch
@@ -1,5 +1,5 @@
---- config.h.orig	2009-01-03 17:30:41.000000000 +0000
-+++ config.h	2009-01-03 17:31:27.000000000 +0000
+--- a/config.h.orig	2009-01-03 17:30:41.000000000 +0000
++++ b/config.h	2009-01-03 17:31:27.000000000 +0000
 @@ -26,6 +26,10 @@
  
  #define TRAFFICLOG

diff --git a/net-irc/psybnc/psybnc-2.3.2.9-r3.ebuild b/net-irc/psybnc/psybnc-2.3.2.9-r3.ebuild
new file mode 100644
index 00000000000..f7dc538ded2
--- /dev/null
+++ b/net-irc/psybnc/psybnc-2.3.2.9-r3.ebuild
@@ -0,0 +1,159 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs user
+
+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"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~sparc ~x86 ~ppc"
+IUSE="ipv6 ssl oidentd scripting multinetwork"
+
+DEPEND="ssl? ( >=dev-libs/openssl-0.9.7d )
+		oidentd? ( >=net-misc/oidentd-2.0 )"
+RDEPEND="${DEPEND}"
+S="${WORKDIR}"/"${PN}"
+
+pkg_setup() {
+	enewgroup psybnc
+	enewuser psybnc -1 -1 ${PSYBNC_HOME} psybnc
+}
+
+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 ${ROOT}/usr/share/psybnc/salt.h ]]; then
+		einfo "Using existing salt.h for password encryption"
+		cp "${ROOT}"/usr/share/psybnc/salt.h salt.h || die
+	fi
+}
+
+src_prepare() {
+	default
+	eapply "${FILESDIR}/compile.diff"
+	eapply "${FILESDIR}/ldflags-fix.patch"
+
+	# add oidentd
+	use oidentd && eapply "${FILESDIR}/${P}-oidentd.patch"
+
+	# add scripting support
+	use scripting && eapply "${FILESDIR}/${P}-scripting.patch"
+
+	# add multinetwork support
+	use multinetwork && eapply "${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 ${ROOT}/etc/psybnc/ssl/psybnc.cert.pem || -f ${ROOT}/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 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"
+	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
+	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 "version of psyBNC. It is needed for password encryption and decryption."
+	elog
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-irc/psybnc/files/, net-irc/psybnc/
@ 2022-10-24 11:47 Sam James
  0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2022-10-24 11:47 UTC (permalink / raw
  To: gentoo-commits

commit:     d91b772cb89aadf1ee8d66f9711ea1220297658d
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 24 11:46:29 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Oct 24 11:46:29 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d91b772c

net-irc/psybnc: rename patches

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

 net-irc/psybnc/Manifest                            |  1 +
 .../{compile.diff => psybnc-2.3.2.9-compile.patch} |  0
 ...-fix.patch => psybnc-2.3.2.9-ldflags-fix.patch} |  0
 net-irc/psybnc/psybnc-2.3.2.9-r4.ebuild            | 26 ++++++++++++----------
 4 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/net-irc/psybnc/Manifest b/net-irc/psybnc/Manifest
index 7feaa0cb2399..9ff638d4d120 100644
--- a/net-irc/psybnc/Manifest
+++ b/net-irc/psybnc/Manifest
@@ -1 +1,2 @@
 DIST psyBNC-2.3.2-9.tar.gz 318676 BLAKE2B 0197aa3bc8c770738a7d4d5a5a79b77f7a0cafeef60ccca1167172b28af05c0cd9836f7e9816c873dafa2e55b0bf9ce54cfbe3958939405f58f7f3874ec7ea64 SHA512 b664f57610e54fadd938b359a0e8052b8fe3dd36bd1ee339f36ee22ae4d36a76e803425c5133f925ac18c01767ffbc8a2f471c014b5b76b05894cfea9fe5416b
+DIST psyBNC-2.4.3.tar.gz 1108733 BLAKE2B e0f02cab97b503301db0a4c111497e4f99b75d8d2c798b2b5d97997a4c4921d8a7de8dabad79c1291fa4b7efce0d1ed0c7dede1345b155561bb6ce6033b591bb SHA512 02228baef6fa889d5e12bfa715facc2eab3b033c01b1f799a1c6c995ef9eedfacf3ed328c875f52595d64c47124c20e4145288b2636182dea17ec9027d367bb7

diff --git a/net-irc/psybnc/files/compile.diff b/net-irc/psybnc/files/psybnc-2.3.2.9-compile.patch
similarity index 100%
rename from net-irc/psybnc/files/compile.diff
rename to net-irc/psybnc/files/psybnc-2.3.2.9-compile.patch

diff --git a/net-irc/psybnc/files/ldflags-fix.patch b/net-irc/psybnc/files/psybnc-2.3.2.9-ldflags-fix.patch
similarity index 100%
rename from net-irc/psybnc/files/ldflags-fix.patch
rename to net-irc/psybnc/files/psybnc-2.3.2.9-ldflags-fix.patch

diff --git a/net-irc/psybnc/psybnc-2.3.2.9-r4.ebuild b/net-irc/psybnc/psybnc-2.3.2.9-r4.ebuild
index 001c32520db9..684b08d88a1f 100644
--- a/net-irc/psybnc/psybnc-2.3.2.9-r4.ebuild
+++ b/net-irc/psybnc/psybnc-2.3.2.9-r4.ebuild
@@ -11,7 +11,7 @@ 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}"
+S="${WORKDIR}"/${PN}
 
 LICENSE="GPL-2"
 SLOT="0"
@@ -26,6 +26,11 @@ DEPEND="
 "
 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
@@ -45,17 +50,14 @@ src_unpack() {
 src_prepare() {
 	default
 
-	eapply "${FILESDIR}/compile.diff"
-	eapply "${FILESDIR}/ldflags-fix.patch"
-
-	# add oidentd
-	use oidentd && eapply "${FILESDIR}/${P}-oidentd.patch"
+	# Add oidentd
+	use oidentd && PATCHES+=( "${FILESDIR}"/${P}-oidentd.patch )
 
-	# add scripting support
-	use scripting && eapply "${FILESDIR}/${P}-scripting.patch"
+	# Add scripting support
+	use scripting && PATCHES+=( "${FILESDIR}"/${P}-scripting.patch )
 
-	# add multinetwork support
-	use multinetwork && eapply "${FILESDIR}/${P}-multinetwork.patch"
+	# Add multinetwork support
+	use multinetwork && PATCHES+=( "${FILESDIR}"/${P}-multinetwork.patch )
 
 	# Prevent stripping the binary
 	sed -i -e "/@strip/ d" tools/autoconf.c || die
@@ -103,10 +105,10 @@ src_install() {
 		insinto /etc
 		doins "${FILESDIR}"/oidentd.conf.psybnc
 		fperms 640 /etc/oidentd.conf.psybnc
-		# install init-script with oidentd-support
+		# Install init-script with oidentd-support
 		newinitd "${FILESDIR}"/psybnc-oidentd.initd psybnc
 	else
-		# install init-script without oidentd-support
+		# Install init-script without oidentd-support
 		newinitd "${FILESDIR}"/psybnc.initd psybnc
 	fi
 


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-irc/psybnc/files/, net-irc/psybnc/
@ 2022-10-24 11:47 Sam James
  0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2022-10-24 11:47 UTC (permalink / raw
  To: gentoo-commits

commit:     94f95c98b33988c57038800875bcb2ce830a67af
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 24 11:46:29 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Oct 24 11:46:29 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=94f95c98

net-irc/psybnc: add 2.4.3

Bug: https://bugs.gentoo.org/724916
Bug: https://bugs.gentoo.org/831310
Bug: https://bugs.gentoo.org/861464
Bug: https://bugs.gentoo.org/874105
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../psybnc-2.4.3-Fix-build-with-Clang-16.patch     | 212 +++++++++++++++++++++
 net-irc/psybnc/psybnc-2.4.3.ebuild                 | 165 ++++++++++++++++
 2 files changed, 377 insertions(+)

diff --git a/net-irc/psybnc/files/psybnc-2.4.3-Fix-build-with-Clang-16.patch b/net-irc/psybnc/files/psybnc-2.4.3-Fix-build-with-Clang-16.patch
new file mode 100644
index 000000000000..83b9b07d73a0
--- /dev/null
+++ b/net-irc/psybnc/files/psybnc-2.4.3-Fix-build-with-Clang-16.patch
@@ -0,0 +1,212 @@
+From 9ced946bc4f6da7ccb74573af4a9a89400f9cd69 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Sun, 23 Oct 2022 18:21:25 +0100
+Subject: [PATCH] Fix build with Clang 16
+
+Bug: https://bugs.gentoo.org/724916
+Bug: https://bugs.gentoo.org/831310
+Bug: https://bugs.gentoo.org/861464
+Bug: https://bugs.gentoo.org/874105
+--- a/src/p_client.c
++++ b/src/p_client.c
+@@ -213,7 +213,7 @@ int repeatserverinit(int usern)
+ }
+ 
+ /* who is on the bounce ? */
+-int cmdbwho(usern)
++int cmdbwho(int usern)
+ {
+     struct usernodes *th;
+     int userl;
+@@ -508,7 +508,7 @@ int firstwelcome(void)
+ }
+ 
+ /* first user connects */
+-int firstuser(npeer)
++int firstuser(int npeer)
+ {
+     int linkto;
+     pcontext;
+--- a/tools/autoconf.c
++++ b/tools/autoconf.c
+@@ -38,6 +38,7 @@
+ #include <ctype.h>
+ #include <signal.h>
+ #include <errno.h>
++#include <time.h>
+ #include "config.h"
+ #include "src/p_version.h"
+ 
+From 907107edea5f9d74b59a7c24762cfa8413a42f90 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Sun, 23 Oct 2022 18:41:05 +0100
+Subject: [PATCH] Fix build with Clang 16
+
+--- a/src/p_client.c
++++ b/src/p_client.c
+@@ -22,6 +22,8 @@
+ #define P_CLIENT
+ 
+ #include <p_global.h>
++#include <stdio.h>
++#include <stdlib.h>
+ 
+ int cmdaddlink(int usern, int type);
+ int quitclient(int usern);
+--- a/src/p_dcc.c
++++ b/src/p_dcc.c
+@@ -22,6 +22,7 @@
+ #define P_DCC
+ 
+ #include <p_global.h>
++#include <stdlib.h>
+ 
+ #ifdef DCCCHAT
+ 
+--- a/src/p_hash.c
++++ b/src/p_hash.c
+@@ -25,6 +25,11 @@
+ 
+ /* local types */
+ 
++#ifdef IPV6
++int cmddefaultipv6(int usern);
++int cmdpreferipv6(int usern);
++#endif
++
+ struct hasht {
+     int commandmsgnum;
+     int(*handler)(int);
+@@ -174,8 +179,10 @@ struct hasht inboundhash[]={
+     {1252,	printhelp,	1253,	1254	,0,0},
+     {1450,	cmdbdone,	1451,	1452	,0,0},
+     {1460,	cmdsetconnectdelay,	1461,	1462	,0,1},
++#ifdef IPV6
+     {1480,	cmddefaultipv6,		1481,   1482    ,0,1},
+     {1490,	cmdpreferipv6,		1491,   1492    ,0,0},
++#endif
+ #ifdef MYSQL_IPCHECK
+ #ifdef HAVE_MYSQL
+     {2001,	cmdmysqlipcheck,	2002,	2003	,0,1},
+--- a/src/p_inifunc.c
++++ b/src/p_inifunc.c
+@@ -22,6 +22,7 @@
+ #define P_INIFUNC
+ 
+ #include <p_global.h>
++#include <stdlib.h>
+ 
+ /* reset the config cache */
+ 
+--- a/src/p_memory.c
++++ b/src/p_memory.c
+@@ -22,6 +22,7 @@
+ #define P_MEMORY
+ 
+ #include <p_global.h>
++#include <stdlib.h>
+ 
+ FILE *logm=NULL;
+ 
+--- a/src/p_network.c
++++ b/src/p_network.c
+@@ -22,6 +22,7 @@
+ #define P_NETWORK
+ 
+ #include <p_global.h>
++#include <stdlib.h>
+ 
+ int netdefault(int usern, char *netname, char *myparentnick);
+ 
+--- a/src/p_peer.c
++++ b/src/p_peer.c
+@@ -22,6 +22,7 @@
+ #define P_PEER
+ 
+ #include <p_global.h>
++#include <stdlib.h>
+ 
+ /* MySQL for IP check */
+ #ifdef MYSQL_IPCHECK
+--- a/src/p_script.c
++++ b/src/p_script.c
+@@ -22,6 +22,7 @@
+ #define P_SCRIPT
+ 
+ #include <p_global.h>
++#include <stdlib.h>
+ 
+ #ifdef SCRIPTING
+ 
+--- a/src/p_server.c
++++ b/src/p_server.c
+@@ -22,6 +22,8 @@
+ #define P_SERVER
+ 
+ #include <p_global.h>
++#include <stdlib.h>
++
+ void create_oidentd_conf();
+ 
+ sigjmp_buf serveralarmret;
+--- a/src/p_socket.c
++++ b/src/p_socket.c
+@@ -22,6 +22,7 @@
+ #define P_SOCKET
+ 
+ #include <p_global.h>
++#include <stdlib.h>
+ 
+ #define MAX_SENDQ 1000
+ 
+--- a/src/p_string.c
++++ b/src/p_string.c
+@@ -22,6 +22,7 @@
+ #define P_STRING
+ 
+ #include <p_global.h>
++#include <stdlib.h>
+ 
+ char langname[100];
+ 
+--- a/src/p_topology.c
++++ b/src/p_topology.c
+@@ -22,7 +22,7 @@
+ #define P_TOPOLOGY
+ 
+ #include <p_global.h>
+-
++#include <stdlib.h>
+ 
+ #define TP_ROOT		0
+ #define TP_LTO		1
+--- a/src/p_uchannel.c
++++ b/src/p_uchannel.c
+@@ -22,6 +22,7 @@
+ #define P_UCHANNEL
+ 
+ #include <p_global.h>
++#include <stdlib.h>
+ 
+ /* bring the channel modes into the right order, return formulated mode */
+ 
+--- a/src/p_userfile.c
++++ b/src/p_userfile.c
+@@ -22,6 +22,7 @@
+ #define P_USERFILE
+ 
+ #include <p_global.h>
++#include <stdlib.h>
+ 
+ /* loading a specific user */
+ 
+--- a/src/psybnc.c
++++ b/src/psybnc.c
+@@ -34,6 +34,7 @@
+ 
+ #include <p_global.h>
+ #include <p_data.h>
++#include <stdlib.h>
+ 
+ int slice=0;
+ 

diff --git a/net-irc/psybnc/psybnc-2.4.3.ebuild b/net-irc/psybnc/psybnc-2.4.3.ebuild
new file mode 100644
index 000000000000..b1d13c41d580
--- /dev/null
+++ b/net-irc/psybnc/psybnc-2.4.3.ebuild
@@ -0,0 +1,165 @@
+# Copyright 1999-2022 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
+	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
+)
+
+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
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-irc/psybnc/files/, net-irc/psybnc/
@ 2024-03-12  4:04 Sam James
  0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2024-03-12  4:04 UTC (permalink / raw
  To: gentoo-commits

commit:     dd619923c273bcc95d69be933e30c043b23941d9
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 12 04:03:12 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Mar 12 04:03:12 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dd619923

net-irc/psybnc: fix build w/ LTO

Closes: https://bugs.gentoo.org/861464
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/psybnc-2.4.3-strmncpy-lto-mismatch.patch |  23 +++
 net-irc/psybnc/psybnc-2.4.3-r1.ebuild              | 170 +++++++++++++++++++++
 2 files changed, 193 insertions(+)

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/psybnc-2.4.3-r1.ebuild b/net-irc/psybnc/psybnc-2.4.3-r1.ebuild
new file mode 100644
index 000000000000..ebcd857f24bb
--- /dev/null
+++ b/net-irc/psybnc/psybnc-2.4.3-r1.ebuild
@@ -0,0 +1,170 @@
+# 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
+	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
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-12  4:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-27 21:27 [gentoo-commits] repo/gentoo:master commit in: net-irc/psybnc/files/, net-irc/psybnc/ Patrice Clement
  -- strict thread matches above, loose matches on Subject: below --
2022-10-24 11:47 Sam James
2022-10-24 11:47 Sam James
2024-03-12  4:04 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox