diff options
author | Sam James <sam@gentoo.org> | 2022-10-24 12:46:29 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-10-24 12:46:29 +0100 |
commit | 94f95c98b33988c57038800875bcb2ce830a67af (patch) | |
tree | b615671a9bc693bd82abbfcb72f26526baa38c52 /net-irc | |
parent | net-irc/psybnc: rename patches (diff) | |
download | gentoo-94f95c98b33988c57038800875bcb2ce830a67af.tar.gz gentoo-94f95c98b33988c57038800875bcb2ce830a67af.tar.bz2 gentoo-94f95c98b33988c57038800875bcb2ce830a67af.zip |
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@gentoo.org>
Diffstat (limited to 'net-irc')
-rw-r--r-- | net-irc/psybnc/files/psybnc-2.4.3-Fix-build-with-Clang-16.patch | 212 | ||||
-rw-r--r-- | net-irc/psybnc/psybnc-2.4.3.ebuild | 165 |
2 files changed, 377 insertions, 0 deletions
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 +} |