public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-irc/znc/, net-irc/znc/files/
@ 2015-09-15 15:41 Julian Ospald
  0 siblings, 0 replies; 11+ messages in thread
From: Julian Ospald @ 2015-09-15 15:41 UTC (permalink / raw
  To: gentoo-commits

commit:     547aaaa7b0764e2351ff7e939f468ab5812527bf
Author:     Thomas D <whissi <AT> whissi <DOT> de>
AuthorDate: Mon Sep 14 00:36:25 2015 +0000
Commit:     Julian Ospald <hasufell <AT> gentoo <DOT> org>
CommitDate: Mon Sep 14 00:36:25 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=547aaaa7

net-irc/znc: Bump to v1.6.1

Non-maintainer commit.

See https://bugs.gentoo.org/show_bug.cgi?id=542168#c7 for detailed changelog.

Bug: https://bugs.gentoo.org/show_bug.cgi?id=542168

 net-irc/znc/Manifest                               |   2 +
 .../znc-1.6.1-create-pidfile-per-default.patch     |  23 +++
 net-irc/znc/files/znc-1.6.1-systemwideconfig.patch | 215 +++++++++++++++++++++
 net-irc/znc/files/znc.confd-r1                     |  24 +++
 net-irc/znc/files/znc.initd-r1                     |  40 ++++
 net-irc/znc/znc-1.6.1.ebuild                       | 198 +++++++++++++++++++
 6 files changed, 502 insertions(+)

diff --git a/net-irc/znc/Manifest b/net-irc/znc/Manifest
index 7ceadbc..2e4aebe 100644
--- a/net-irc/znc/Manifest
+++ b/net-irc/znc/Manifest
@@ -1,2 +1,4 @@
+DIST gtest-1.7.0.zip 1164254 SHA256 247ca18dd83f53deb1328be17e4b1be31514cedfc1e3424f672bf11fd7e0d60d SHA512 8859369f2dd32cbc2ac01aba029aa3ff20a321f40658b9643aff442d34c33468221866b801b28c66a28af47dbcd362d26941fc98db92b6efb7e41ea5b7be1a07 WHIRLPOOL 0c31a385159551859c1afe76480b3fb1b560d666db9a0afc5cbda92bcd53bf129f85a8f902c6ded0779c2b4c49aacec59ba5a4d5ce316a07bf08174f4fc64049
 DIST znc-1.2.tar.gz 1235150 SHA256 d9a2cd2a484ff23e6fc9cbde8dd8a43efbcd8d288afca7b1268914ca0d18701d SHA512 dff24e56127e5599d64b4c62de967d5d48d8ebf23ca8597d33bf0b3622640512db7a462bfa7c2031cd8307f402bab8efa345f6d1fc813e78eb0dcae581de3cf7 WHIRLPOOL b0810eb66e63be762f74f04eb2289e3634b18d6ecbd36d55f6a6772697e0397637d59b9ea01eaf62ef1cbe5f6e65b06432a254f4ada35194aa06b65c4a2f7994
 DIST znc-1.4.tar.gz 1239648 SHA256 86e98fd0ed182d39828c926809f8075d836ee3b70a6dd43dfbb434822f2a7b52 SHA512 0c33b05e8232084999812cbaa467dc7d37b80cafc1001b82e89c702b4303d8db9a27b948fe653e7090404eb1c66f5492f02f3524bc39efabade4be8bdb476671 WHIRLPOOL 420e665fa193b3f0284a070e021c4c467e3d40a0812eedeef9b2f65a6626a050b7af8bf15a754ac571d12261705832cfa18a0f7a7817cce96d220028a86230cf
+DIST znc-1.6.1.tar.gz 1463397 SHA256 ba49397364f48d6d32ae5242bc1166f21d972f85dd390d6bbe68a63ecbb6c140 SHA512 92c0acca6b585df394cf8d6d295948fc1342ff7b15d081017d2e0ba521129f914fa2b019a82d801f826f1009456294e4f578e978f34677bbfe436e87e2734aba WHIRLPOOL ff4a22742d5e1e8da66325fdc8a2fd88a467674a5f13f6d353b1c3588affd86f2c33c24d48f1b61dfba14311d6f1c13b2939851316cb302ab031073baa05ec17

diff --git a/net-irc/znc/files/znc-1.6.1-create-pidfile-per-default.patch b/net-irc/znc/files/znc-1.6.1-create-pidfile-per-default.patch
new file mode 100644
index 0000000..8419e93
--- /dev/null
+++ b/net-irc/znc/files/znc-1.6.1-create-pidfile-per-default.patch
@@ -0,0 +1,23 @@
+Add PidFile option to new configurations per default
+
+Our runscript requires that ZNC creates a pidfile. This patch will add
+the PidFile directive to ZNC's default configuration.
+---
+ src/znc.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/znc.cpp b/src/znc.cpp
+index b33e860..4a02568 100644
+--- a/src/znc.cpp
++++ b/src/znc.cpp
+@@ -575,6 +575,7 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) {
+ 	VCString vsLines;
+ 
+ 	vsLines.push_back(MakeConfigHeader());
++	vsLines.push_back("PidFile = /run/znc/znc.pid");
+ 	vsLines.push_back("Version = " + CString(VERSION_STR));
+ 
+ 	m_sConfigFile = ExpandConfigPath(sConfigFile);
+-- 
+2.5.0
+

diff --git a/net-irc/znc/files/znc-1.6.1-systemwideconfig.patch b/net-irc/znc/files/znc-1.6.1-systemwideconfig.patch
new file mode 100644
index 0000000..d28fa30
--- /dev/null
+++ b/net-irc/znc/files/znc-1.6.1-systemwideconfig.patch
@@ -0,0 +1,215 @@
+Add system-wide daemon support.
+
+This patch adds system-wide daemon support to ZNC so that you can run
+one ZNC instance system-wide using the new "--system-wide-config-as"
+option.
+
+Patch is based on @mrueg version from 2012.
+
+X-Gentoo-Bug: 438430
+X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=438430
+---
+ include/znc/znc.h |  3 ++
+ src/main.cpp      | 83 ++++++++++++++++++++++++++++++++++++++++---------------
+ src/znc.cpp       |  7 ++++-
+ 3 files changed, 70 insertions(+), 23 deletions(-)
+
+diff --git a/include/znc/znc.h b/include/znc/znc.h
+index cf2326e..16394f9 100644
+--- a/include/znc/znc.h
++++ b/include/znc/znc.h
+@@ -187,6 +187,8 @@ public:
+ 
+ 	static void DumpConfig(const CConfig* Config);
+ 
++	void SetSystemWideConfig(bool systemWideConfig);
++
+ private:
+ 	CFile* InitPidFile();
+ 	bool DoRehash(CString& sError);
+@@ -231,6 +233,7 @@ protected:
+ 	unsigned int           m_uiConnectPaused;
+ 	TCacheMap<CString>     m_sConnectThrottle;
+ 	bool                   m_bProtectWebSessions;
++	bool                   m_bSystemWideConfig;
+ 	bool                   m_bHideVersion;
+ };
+ 
+diff --git a/src/main.cpp b/src/main.cpp
+index 09b2c9c..bd5cca6 100644
+--- a/src/main.cpp
++++ b/src/main.cpp
+@@ -16,6 +16,9 @@
+ 
+ #include <znc/znc.h>
+ #include <signal.h>
++#include <sys/types.h>
++#include <pwd.h>
++#include <grp.h>
+ 
+ #if defined(HAVE_LIBSSL) && defined(HAVE_PTHREAD)
+ #include <znc/Threads.h>
+@@ -99,34 +102,36 @@ static inline int getopt_long(int argc, char * const argv[], const char *optstri
+ #endif
+ 
+ static const struct option g_LongOpts[] = {
+-	{ "help",        no_argument,       0, 'h' },
+-	{ "version",     no_argument,       0, 'v' },
+-	{ "debug",       no_argument,       0, 'D' },
+-	{ "foreground",  no_argument,       0, 'f' },
+-	{ "no-color",    no_argument,       0, 'n' },
+-	{ "allow-root",  no_argument,       0, 'r' },
+-	{ "makeconf",    no_argument,       0, 'c' },
+-	{ "makepass",    no_argument,       0, 's' },
+-	{ "makepem",     no_argument,       0, 'p' },
+-	{ "datadir",     required_argument, 0, 'd' },
++	{ "help",                  no_argument,       0, 'h' },
++	{ "version",               no_argument,       0, 'v' },
++	{ "debug",                 no_argument,       0, 'D' },
++	{ "foreground",            no_argument,       0, 'f' },
++	{ "no-color",              no_argument,       0, 'n' },
++	{ "allow-root",            no_argument,       0, 'r' },
++	{ "makeconf",              no_argument,       0, 'c' },
++	{ "makepass",              no_argument,       0, 's' },
++	{ "makepem",               no_argument,       0, 'p' },
++	{ "datadir",               required_argument, 0, 'd' },
++	{ "system-wide-config-as", required_argument, 0, 'S' },
+ 	{ 0, 0, 0, 0 }
+ };
+ 
+ static void GenerateHelp(const char *appname) {
+ 	CUtils::PrintMessage("USAGE: " + CString(appname) + " [options]");
+ 	CUtils::PrintMessage("Options are:");
+-	CUtils::PrintMessage("\t-h, --help         List available command line options (this page)");
+-	CUtils::PrintMessage("\t-v, --version      Output version information and exit");
+-	CUtils::PrintMessage("\t-f, --foreground   Don't fork into the background");
+-	CUtils::PrintMessage("\t-D, --debug        Output debugging information (Implies -f)");
+-	CUtils::PrintMessage("\t-n, --no-color     Don't use escape sequences in the output");
+-	CUtils::PrintMessage("\t-r, --allow-root   Don't complain if ZNC is run as root");
+-	CUtils::PrintMessage("\t-c, --makeconf     Interactively create a new config");
+-	CUtils::PrintMessage("\t-s, --makepass     Generates a password for use in config");
++	CUtils::PrintMessage("\t-h, --help                    List available command line options (this page)");
++	CUtils::PrintMessage("\t-v, --version                 Output version information and exit");
++	CUtils::PrintMessage("\t-f, --foreground              Don't fork into the background");
++	CUtils::PrintMessage("\t-D, --debug                   Output debugging information (Implies -f)");
++	CUtils::PrintMessage("\t-n, --no-color                Don't use escape sequences in the output");
++	CUtils::PrintMessage("\t-r, --allow-root              Don't complain if ZNC is run as root");
++	CUtils::PrintMessage("\t-c, --makeconf                Interactively create a new config");
++	CUtils::PrintMessage("\t-s, --makepass                Generates a password for use in config");
+ #ifdef HAVE_LIBSSL
+-	CUtils::PrintMessage("\t-p, --makepem      Generates a pemfile for use with SSL");
++	CUtils::PrintMessage("\t-p, --makepem                 Generates a pemfile for use with SSL");
+ #endif /* HAVE_LIBSSL */
+-	CUtils::PrintMessage("\t-d, --datadir      Set a different ZNC repository (default is ~/.znc)");
++	CUtils::PrintMessage("\t-d, --datadir                 Set a different ZNC repository (default is ~/.znc)");
++	CUtils::PrintMessage("\t-S, --system-wide-config-as   Create a system-wide ZNC daemon configuration");
+ }
+ 
+ static void die(int sig) {
+@@ -192,6 +197,8 @@ int main(int argc, char** argv) {
+ 	bool bMakeConf = false;
+ 	bool bMakePass = false;
+ 	bool bAllowRoot = false;
++	bool bSystemWideConfig = false;
++	CString sSystemWideConfigUser = "znc";
+ 	bool bForeground = false;
+ #ifdef ALWAYS_RUN_IN_FOREGROUND
+ 	bForeground = true;
+@@ -201,7 +208,7 @@ int main(int argc, char** argv) {
+ #endif
+ 	CZNC::CreateInstance();
+ 
+-	while ((iArg = getopt_long(argc, argv, "hvnrcspd:Df", g_LongOpts, &iOptIndex)) != -1) {
++	while ((iArg = getopt_long(argc, argv, "hvnrcspd:DfS:", g_LongOpts, &iOptIndex)) != -1) {
+ 		switch (iArg) {
+ 		case 'h':
+ 			GenerateHelp(argv[0]);
+@@ -219,6 +226,10 @@ int main(int argc, char** argv) {
+ 		case 'c':
+ 			bMakeConf = true;
+ 			break;
++		case 'S':
++			bSystemWideConfig = true;
++			sSystemWideConfigUser = optarg;
++			break;
+ 		case 's':
+ 			bMakePass = true;
+ 			break;
+@@ -254,8 +265,36 @@ int main(int argc, char** argv) {
+ 		return 1;
+ 	}
+ 
++	if (bSystemWideConfig && getuid() == 0) {
++		struct passwd *pwd;
++
++		pwd = getpwnam(sSystemWideConfigUser.c_str());
++		if (pwd == NULL) {
++			CUtils::PrintError("Daemon user not found.");
++			return 1;
++		}
++
++		if ((long) pwd->pw_uid == 0) {
++			CUtils::PrintError("Please define a daemon user other than root.");
++			return 1;
++		}
++		if (setgroups(0, NULL) != 0) {
++			CUtils::PrintError("setgroups: Unable to clear supplementary group IDs");
++			return 1;
++		}
++		if (setgid((long) pwd->pw_gid) != 0) {
++			CUtils::PrintError("setgid: Unable to drop group privileges");
++			return 1;
++		}
++		if (setuid((long) pwd->pw_uid) != 0) {
++			CUtils::PrintError("setuid: Unable to drop user privileges");
++			return 1;
++		}
++	}
++
+ 	CZNC* pZNC = &CZNC::Get();
+ 	pZNC->InitDirs(((argc) ? argv[0] : ""), sDataDir);
++	pZNC->SetSystemWideConfig(bSystemWideConfig);
+ 
+ #ifdef HAVE_LIBSSL
+ 	if (bMakePem) {
+@@ -304,7 +343,7 @@ int main(int argc, char** argv) {
+ 		CUtils::PrintStatus(true, "");
+ 	}
+ 
+-	if (isRoot()) {
++	if (isRoot() && !bSystemWideConfig) {
+ 		CUtils::PrintError("You are running ZNC as root! Don't do that! There are not many valid");
+ 		CUtils::PrintError("reasons for this and it can, in theory, cause great damage!");
+ 		if (!bAllowRoot) {
+diff --git a/src/znc.cpp b/src/znc.cpp
+index 78cda1a..b33e860 100644
+--- a/src/znc.cpp
++++ b/src/znc.cpp
+@@ -55,6 +55,7 @@ CZNC::CZNC() {
+ 	m_sConnectThrottle.SetTTL(30000);
+ 	m_pLockFile = NULL;
+ 	m_bProtectWebSessions = true;
++	m_bSystemWideConfig = false;
+ 	m_bHideVersion = false;
+ 	m_uDisabledSSLProtocols = Csock::EDP_SSL;
+ 	m_sSSLProtocols = "";
+@@ -861,7 +862,7 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) {
+ 	CUtils::PrintMessage("");
+ 
+ 	File.UnLock();
+-	return bFileOpen && CUtils::GetBoolInput("Launch ZNC now?", true);
++	return bFileOpen && !m_bSystemWideConfig && CUtils::GetBoolInput("Launch ZNC now?", true);
+ }
+ 
+ void CZNC::BackupConfigOnce(const CString& sSuffix) {
+@@ -1973,3 +1974,7 @@ void CZNC::LeakConnectQueueTimer(CConnectQueueTimer *pTimer) {
+ bool CZNC::WaitForChildLock() {
+ 	return m_pLockFile && m_pLockFile->ExLock();
+ }
++
++void CZNC::SetSystemWideConfig(bool systemWideConfig) {
++	m_bSystemWideConfig = systemWideConfig;
++}
+-- 
+2.5.0
+

diff --git a/net-irc/znc/files/znc.confd-r1 b/net-irc/znc/files/znc.confd-r1
new file mode 100644
index 0000000..b78e053
--- /dev/null
+++ b/net-irc/znc/files/znc.confd-r1
@@ -0,0 +1,24 @@
+# /etc/conf.d/znc
+
+# Location of the znc configuration folder
+ZNC_DATADIR="/var/lib/znc"
+
+# User to run znc as
+ZNC_USER="znc"
+
+# Group to run znc as
+ZNC_GROUP="znc"
+
+# PID file
+ZNC_PIDFILE="/run/znc/znc.pid"
+
+# You can use this configuration option to pass additional options to the
+# start-stop-daemon, see start-stop-daemon(8) for more details.
+# Per default we wait 1000ms after we have started the service to ensure
+# that the daemon is really up and running.
+ZNC_SSDARGS="--wait 1000"
+
+# The termination timeout (start-stop-daemon parameter "retry") ensures
+# that the service will be terminated within a given time (30 + 5 seconds
+# per default) when you are stopping the service.
+ZNC_TERMTIMEOUT="TERM/30/KILL/5"

diff --git a/net-irc/znc/files/znc.initd-r1 b/net-irc/znc/files/znc.initd-r1
new file mode 100644
index 0000000..903a4fe
--- /dev/null
+++ b/net-irc/znc/files/znc.initd-r1
@@ -0,0 +1,40 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+extra_commands="config"
+extra_started_commands="reload save"
+command="/usr/bin/znc"
+command_args="--datadir ${ZNC_DATADIR}"
+pidfile="${ZNC_PIDFILE:-/run/znc/znc.pid}"
+user=${ZNC_USER:-znc}
+group=${ZNC_GROUP:-znc}
+start_stop_daemon_args="--chdir \"${ZNC_DATADIR}\" --user ${user} --group ${group} ${ZNC_SSDARGS}"
+retry="${ZNC_TERMTIMEOUT}"
+
+required_dirs="${ZNC_DATADIR}"
+
+depend() {
+	use dns logger
+}
+
+start_pre() {
+	checkpath -d -m 0770 -o ${user}:${group} $(dirname ${pidfile})
+}
+
+stop_post() {
+	rm -f ${pidfile}
+}
+
+reload() {
+	ebegin "Reloading ZNC Configuration File from Disk"
+	start-stop-daemon --signal SIGHUP --pidfile ${pidfile}
+	eend $?
+}
+
+save() {
+	ebegin "Saving ZNC Configuration File to Disk"
+	start-stop-daemon --signal SIGUSR1 --pidfile ${pidfile}
+	eend $?
+}

diff --git a/net-irc/znc/znc-1.6.1.ebuild b/net-irc/znc/znc-1.6.1.ebuild
new file mode 100644
index 0000000..6098cc0
--- /dev/null
+++ b/net-irc/znc/znc-1.6.1.ebuild
@@ -0,0 +1,198 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python{3_3,3_4} )
+inherit base python-single-r1 systemd user
+
+MY_PV=${PV/_/-}
+GTEST_VER="1.7.0"
+GTEST_URL="https://googletest.googlecode.com/files/gtest-${GTEST_VER}.zip"
+DESCRIPTION="An advanced IRC Bouncer"
+
+if [[ ${PV} == "9999" ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="git://github.com/znc/znc.git"
+	SRC_URI="test? ( ${GTEST_URL} )"
+	KEYWORDS=""
+else
+	SRC_URI="http://znc.in/releases/${PN}-${MY_PV}.tar.gz
+		test? ( ${GTEST_URL} )"
+	KEYWORDS="~amd64 ~arm ~x86"
+fi
+
+HOMEPAGE="http://znc.in"
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="daemon debug ipv6 perl python ssl sasl tcl test"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="
+	perl? ( >=dev-lang/perl-5.10 )
+	python? ( ${PYTHON_DEPS} )
+	sasl? ( >=dev-libs/cyrus-sasl-2 )
+	ssl? ( >=dev-libs/openssl-0.9.7d:0 )
+	tcl? ( dev-lang/tcl:0= )
+"
+DEPEND="
+	virtual/pkgconfig
+	perl? (
+		>=dev-lang/swig-2.0.12
+	)
+	python? (
+		>=dev-lang/swig-2.0.12
+	)
+	${RDEPEND}
+"
+
+S=${WORKDIR}/${PN}-${MY_PV}
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-1.6.1-systemwideconfig.patch
+	"${FILESDIR}"/${PN}-1.6.1-create-pidfile-per-default.patch
+)
+
+ZNC_DATADIR="${ZNC_DATADIR:-"/var/lib/znc"}"
+
+pkg_setup() {
+	if use python; then
+		python-single-r1_pkg_setup
+	fi
+	if use daemon; then
+		enewgroup ${PN}
+		enewuser ${PN} -1 -1 /dev/null ${PN}
+	fi
+}
+
+src_unpack() {
+	if [[ ${PV} == "9999" ]] ; then
+		git-r3_src_unpack
+	else
+		default
+	fi
+
+	if use test; then
+		cd "${S}"/test || die "Failed to chdir into '${S}/test'"
+		unpack $(basename ${GTEST_URL})
+		mv gtest-${GTEST_VER} gtest || die "Failed to rename '${S}/test/gtest-${GTEST_VER}' dir"
+	fi
+}
+
+src_prepare() {
+	if [[ ${PV} == *9999* ]]; then
+		./autogen.sh
+	fi
+
+	base_src_prepare
+}
+
+src_configure() {
+	econf \
+		--with-systemdsystemunitdir=$(systemd_get_unitdir) \
+		$(use_enable debug) \
+		$(use_enable ipv6) \
+		$(use_enable perl) \
+		$(use python && echo "--enable-python=python3") \
+		$(use_enable sasl cyrus) \
+		$(use_enable ssl openssl) \
+		$(use_enable tcl tcl) \
+		$(use_with test gtest "${S}/test/gtest")
+}
+
+src_install() {
+	emake install DESTDIR="${D%/}"
+	dodoc NOTICE README.md
+	if use daemon; then
+		newinitd "${FILESDIR}"/znc.initd-r1 znc
+		newconfd "${FILESDIR}"/znc.confd-r1 znc
+	fi
+}
+
+pkg_postinst() {
+	if use !daemon; then
+		elog
+		elog "Run 'znc --makeconf' as the user you want to run ZNC as"
+		elog "to make a configuration file"
+		elog
+	else
+		elog
+		elog "An init-script was installed in /etc/init.d"
+		elog "A config file was installed in /etc/conf.d"
+		if [[ ! -d "${EROOT}${ZNC_DATADIR}" ]]; then
+			elog
+			elog "Run 'emerge --config znc' to configure ZNC"
+			elog "as a system-wide daemon."
+			elog
+			elog "To generate a new SSL certificate, run:"
+			elog "  znc --system-wide-config-as znc --makepem -d ${ZNC_DATADIR}"
+			elog "as root"
+			elog
+			elog "If migrating from a user-based install"
+			elog "you can use your existing config files:"
+			elog "  mkdir ${ZNC_DATADIR}"
+			elog "  mv /home/\$USER/.znc/* ${ZNC_DATADIR}"
+			elog "  rm -rf /home/\$USER/.znc"
+			elog "  chown -R znc:znc ${ZNC_DATADIR}"
+			elog
+			elog "If you already have znc set up and want take advantage of the"
+			elog "init script but skip of all the above, you can also edit"
+			elog "  /etc/conf.d/znc"
+			elog "and adjust the variables to your current znc user and config"
+			elog "location."
+			elog
+			elog "Please make sure that your existing configuration contains"
+			elog "  PidFile = /run/znc/znc.pid"
+			elog "or that PidFile value matches the one in /etc/conf.d/znc"
+			if [[ -d "${EROOT}"/etc/znc ]]; then
+				elog
+				ewarn "/etc/znc exists on your system."
+				ewarn "Due to the nature of the contents of that folder,"
+				ewarn "we have changed the default configuration to use"
+				ewarn "	${ZNC_DATADIR}"
+				ewarn "please move /etc/znc to ${ZNC_DATADIR}"
+				ewarn "or adjust /etc/conf.d/znc"
+			fi
+		else
+			elog "Existing config detected in ${ZNC_DATADIR}"
+			if ! systemd_is_booted; then
+				elog
+				elog "Please make sure that your existing configuration contains"
+				elog "  PidFile = /run/znc/znc.pid"
+				elog "or that PidFile value matches the one in /etc/conf.d/znc"
+			else
+				elog "You're good to go :)"
+			fi
+		fi
+		elog
+	fi
+}
+
+pkg_config() {
+	if use daemon && ! [[ -d "${EROOT}${ZNC_DATADIR}" ]]; then
+		einfo "Press ENTER to interactively create a new configuration file for znc."
+		einfo "To abort, press Control-C"
+		read
+		mkdir -p "${EROOT}${ZNC_DATADIR}" || die
+		chown -R ${PN}:${PN} "${EROOT}${ZNC_DATADIR}" ||
+			die "Setting permissions failed"
+		"${EROOT}"/usr/bin/znc --system-wide-config-as znc -c -r -d "${EROOT}${ZNC_DATADIR}" ||
+			die "Config failed"
+		echo
+		einfo "To start znc, run '/etc/init.d/znc start'"
+		einfo "or add znc to a runlevel:"
+		einfo "  rc-update add znc default"
+	else
+		if use daemon; then
+			ewarn "${ZNC_DATADIR} already exists, aborting to avoid damaging"
+			ewarn "any existing configuration. If you are sure you want"
+			ewarn "to generate a new configuration, remove the folder"
+			ewarn "and try again."
+		else
+			ewarn "To configure znc as a system-wide daemon you have to"
+			ewarn "enable the 'daemon' use flag."
+		fi
+	fi
+}


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

* [gentoo-commits] repo/gentoo:master commit in: net-irc/znc/, net-irc/znc/files/
@ 2017-01-04  1:01 Thomas Deutschmann
  0 siblings, 0 replies; 11+ messages in thread
From: Thomas Deutschmann @ 2017-01-04  1:01 UTC (permalink / raw
  To: gentoo-commits

commit:     08352091a142a547d7aaf9a52609395634489a86
Author:     Alexey Sokolov <sokolov <AT> google <DOT> com>
AuthorDate: Wed Jan  4 00:58:29 2017 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Wed Jan  4 01:01:18 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=08352091

net-irc/znc: Update/rewrite live ebuild

Closes: https://github.com/gentoo/gentoo/pull/3236

Package-Manager: Portage-2.3.3, Repoman-2.3.1
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 net-irc/znc/files/README.gentoo-r1 |  15 +++
 net-irc/znc/files/znc.initd-r2     |  41 +++++++
 net-irc/znc/znc-9999.ebuild        | 220 ++++++++++++++++++-------------------
 3 files changed, 162 insertions(+), 114 deletions(-)

diff --git a/net-irc/znc/files/README.gentoo-r1 b/net-irc/znc/files/README.gentoo-r1
new file mode 100644
index 00000000..cbd565d
--- /dev/null
+++ b/net-irc/znc/files/README.gentoo-r1
@@ -0,0 +1,15 @@
+To run znc as a user, run 'znc --makeconf' to create a configuration file.
+
+To configure the system-wide daemon, you may run 'emerge --config znc'.
+
+If migrating from a user-based install, you can copy the existing
+configuration files:
+
+  # mkdir /var/lib/znc
+  # mv /home/$USER/.znc/* /var/lib/znc
+  # rm -rf /home/$USER/.znc
+  # chown -R znc:znc /var/lib/znc
+
+OpenRC user may also adjust the location of the files and the user running
+znc in /etc/conf.d/znc instead. Systemd user may have to overwrite
+existing unit file.

diff --git a/net-irc/znc/files/znc.initd-r2 b/net-irc/znc/files/znc.initd-r2
new file mode 100644
index 00000000..13bfcdf
--- /dev/null
+++ b/net-irc/znc/files/znc.initd-r2
@@ -0,0 +1,41 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+extra_commands="config"
+extra_started_commands="reload save"
+command="/usr/bin/znc"
+command_args="--datadir \"${ZNC_DATADIR}\" --foreground"
+command_background="yes"
+pidfile="${ZNC_PIDFILE:-/run/znc/znc.pid}"
+user=${ZNC_USER:-znc}
+group=${ZNC_GROUP:-znc}
+start_stop_daemon_args="--chdir \"${ZNC_DATADIR}\" --user ${user} --group ${group} ${ZNC_SSDARGS}"
+retry="${ZNC_TERMTIMEOUT}"
+
+required_dirs="${ZNC_DATADIR}"
+
+depend() {
+	use dns logger
+}
+
+start_pre() {
+	checkpath -d -m 0770 -o ${user}:${group} "$(dirname ${pidfile})"
+}
+
+stop_post() {
+	rm -f "${pidfile}"
+}
+
+reload() {
+	ebegin "Reloading ZNC Configuration File from Disk"
+	start-stop-daemon --signal SIGHUP --pidfile "${pidfile}"
+	eend $?
+}
+
+save() {
+	ebegin "Saving ZNC Configuration File to Disk"
+	start-stop-daemon --signal SIGUSR1 --pidfile "${pidfile}"
+	eend $?
+}

diff --git a/net-irc/znc/znc-9999.ebuild b/net-irc/znc/znc-9999.ebuild
index 81f4659..642a974 100644
--- a/net-irc/znc/znc-9999.ebuild
+++ b/net-irc/znc/znc-9999.ebuild
@@ -1,164 +1,156 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-EAPI=5
+EAPI=6
 
-PYTHON_COMPAT=( python3_4 )
-inherit autotools eutils python-single-r1 user
+PYTHON_COMPAT=( python{3_4,3_5} )
+PLOCALES="ru"
+
+inherit cmake-utils l10n python-single-r1 readme.gentoo-r1 systemd user
 
-MY_PV=${PV/_/-}
 DESCRIPTION="An advanced IRC Bouncer"
 
-inherit git-r3
-EGIT_REPO_URI=${EGIT_REPO_URI:-"git://github.com/znc/znc.git"}
-SRC_URI=""
-KEYWORDS=""
+if [[ ${PV} == *9999* ]]; then
+	inherit git-r3
+	EGIT_REPO_URI=${EGIT_REPO_URI:-"https://github.com/znc/znc.git"}
+	SRC_URI=""
+else
+	SRC_URI="http://znc.in/releases/archive/${P}.tar.gz"
+	KEYWORDS="~amd64 ~arm ~x86"
+fi
 
 HOMEPAGE="http://znc.in"
 LICENSE="Apache-2.0"
 SLOT="0"
-IUSE="daemon debug ipv6 libressl perl python ssl sasl tcl"
+IUSE="+ipv6 +icu libressl nls perl python +ssl sasl tcl test +zlib"
 
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} icu )"
 
 RDEPEND="
-	dev-libs/icu:=
-	sys-libs/zlib
-	perl? ( >=dev-lang/perl-5.10 )
+	icu? ( dev-libs/icu:= )
+	nls? ( dev-libs/boost:=[nls] )
+	perl? ( >=dev-lang/perl-5.10:= )
 	python? ( ${PYTHON_DEPS} )
 	sasl? ( >=dev-libs/cyrus-sasl-2 )
 	ssl? (
-		!libressl? ( dev-libs/openssl:0 )
-		libressl? ( dev-libs/libressl )
+		!libressl? ( dev-libs/openssl:0= )
+		libressl? ( dev-libs/libressl:0= )
 	)
 	tcl? ( dev-lang/tcl:0= )
+	zlib? ( sys-libs/zlib )
 "
-DEPEND="${RDEPEND}
+DEPEND="
+	${RDEPEND}
+	nls? ( sys-devel/gettext )
 	virtual/pkgconfig
-	perl? (
-		>=dev-lang/swig-2.0.12
-	)
-	python? (
-		>=dev-lang/swig-2.0.12
-	)
+	perl? ( >=dev-lang/swig-3.0.0 )
+	python? ( >=dev-lang/swig-3.0.0 )
+	test? ( dev-cpp/gtest )
 "
 
-S=${WORKDIR}/${PN}-${MY_PV}
-
-CONFDIR="/var/lib/znc"
-
 pkg_setup() {
 	if use python; then
 		python-single-r1_pkg_setup
 	fi
-	if use daemon; then
-		enewgroup ${PN}
-		enewuser ${PN} -1 -1 /dev/null ${PN}
-	fi
+
+	enewgroup ${PN}
+	enewuser ${PN} -1 -1 /var/lib/${PN} ${PN}
+	# The home directory was previously set to /dev/null
+	# This caused a bug with the systemd unit
+	# https://bugs.gentoo.org/521916
+	esethome ${PN} /var/lib/${PN}
 }
 
 src_prepare() {
-	AT_M4DIR="${S}/m4" \
-		eautoreconf
+	l10n_find_plocales_changes "${S}/src/po" "${PN}." '.po'
+
+	remove_locale() {
+		# Some language/module pairs can be missing
+		rm -f src/po/${PN}.${1}.po modules/po/*.${1}.po || die
+	}
+	l10n_for_each_disabled_locale_do remove_locale
+
+	# Let SWIG rebuild modperl/modpython to make user patching easier.
+	if [[ ${PV} != *9999* ]]; then
+		rm modules/modperl/generated.tar.gz || die
+		rm modules/modpython/generated.tar.gz || die
+	fi
 
-	# build system quirk, it does not define AM_INIT_AUTOMAKE, nor
-	# does it have Makefile.am in the root dir, but we need '--add-missing'
-	automake --add-missing
+	cmake-utils_src_prepare
 }
 
 src_configure() {
-	econf \
-		$(use_enable debug) \
-		$(use_enable ipv6) \
-		$(use_enable perl) \
-		$(use python && echo "--enable-python=python3") \
-		$(use_enable sasl cyrus) \
-		$(use_enable ssl openssl) \
-		$(use_enable tcl tcl)
+	local mycmakeargs=(
+		-DWANT_SYSTEMD=yes  # Causes -DSYSTEMD_DIR to be used.
+		-DSYSTEMD_DIR="$(systemd_get_systemunitdir)"
+		-DWANT_ICU="$(usex icu)"
+		-DWANT_IPV6="$(usex ipv6)"
+		-DWANT_I18N="$(usex nls)"
+		-DWANT_PERL="$(usex perl)"
+		-DWANT_PYTHON="$(usex python)"
+		-DWANT_CYRUS="$(usex sasl)"
+		-DWANT_OPENSSL="$(usex ssl)"
+		-DWANT_TCL="$(usex tcl)"
+		-DWANT_ZLIB="$(usex zlib)"
+	)
+
+	cmake-utils_src_configure
+}
+
+src_test() {
+	pushd "${BUILD_DIR}" > /dev/null || die
+	${CMAKE_MAKEFILE_GENERATOR} unittest || die "Unit test failed"
+	popd > /dev/null || die
 }
 
 src_install() {
-	emake install DESTDIR="${D}"
-	dodoc NOTICE README.md
-	if use daemon; then
-		newinitd "${FILESDIR}"/znc.initd-r1 znc
-		newconfd "${FILESDIR}"/znc.confd-r1 znc
-	fi
+	cmake-utils_src_install
+
+	dodoc NOTICE
+	newinitd "${FILESDIR}"/znc.initd-r2 znc
+	newconfd "${FILESDIR}"/znc.confd-r1 znc
+
+	DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r1") || die
+	DISABLE_AUTOFORMATTING=1
+	readme.gentoo_create_doc
 }
 
 pkg_postinst() {
-	if use !daemon; then
-		elog
-		elog "Run 'znc --makeconf' as the user you want to run ZNC as"
-		elog "to make a configuration file"
-		elog
-	else
-		elog
-		elog "An init-script was installed in /etc/init.d"
-		elog "A config file was installed in /etc/conf.d"
-		if [[ ! -d "${EROOT}${CONFDIR}" ]]; then
-			elog
-			elog "Run 'emerge --config znc' under portage"
-			elog "or 'cave config znc' under paludis to configure ZNC"
-			elog "as a system-wide daemon."
-			elog
-			elog "To generate a new SSL certificate, run:"
-			elog "  znc --system-wide-config-as znc --makepem -d ${CONFDIR}"
-			elog "as root"
-			elog
-			elog "If migrating from a user-based install"
-			elog "you can use your existing config files:"
-			elog "  mkdir ${CONFDIR}"
-			elog "  mv /home/\$USER/.znc/* ${CONFDIR}"
-			elog "  rm -rf /home/\$USER/.znc"
-			elog "  chown -R znc:znc ${CONFDIR}"
-			elog
-			elog "If you already have znc set up and want take advantage of the"
-			elog "init script but skip of all the above, you can also edit"
-			elog "  /etc/conf.d/znc"
-			elog "and adjust the variables to your current znc user and config"
-			elog "location."
-			if [[ -d "${EROOT}"/etc/znc ]]; then
-				elog
-				ewarn "/etc/znc exists on your system."
-				ewarn "Due to the nature of the contents of that folder,"
-				ewarn "we have changed the default configuration to use"
-				ewarn "	/var/lib/znc"
-				ewarn "please move /etc/znc to /var/lib/znc"
-				ewarn "or adjust /etc/conf.d/znc"
-			fi
-		else
-			elog "Existing config detected in ${CONFDIR}"
-			elog "You're good to go :)"
-		fi
-		elog
+	if [[ -z "${REPLACING_VERSIONS}" ]]; then
+		# This is a new installation
+		readme.gentoo_print_elog
+	fi
+
+	if [[ -d "${EROOT%/}"/etc/znc ]]; then
+		ewarn "${EROOT%/}/etc/znc exists on your system."
+		ewarn "Due to the nature of the contents of that folder,"
+		ewarn "we have changed the default configuration to use"
+		ewarn "	${EROOT%/}/var/lib/znc"
+		ewarn "please move ${EROOT%/}/etc/znc to ${EROOT%/}/var/lib/znc"
+		ewarn "or adjust your service configuration."
 	fi
 }
 
 pkg_config() {
-	if use daemon && ! [[ -d "${EROOT}${CONFDIR}" ]]; then
-		einfo "Press ENTER to interactively create a new configuration file for znc."
+	if [[ -e "${EROOT%/}/var/lib/znc" ]]; then
+		ewarn "${EROOT%/}/var/lib/znc already exists, aborting to avoid damaging"
+		ewarn "any existing configuration. If you are sure you want"
+		ewarn "to generate a new configuration, remove the folder"
+		ewarn "and try again."
+	else
+		einfo "Press any key to interactively create a new configuration file"
+		einfo "for znc."
 		einfo "To abort, press Control-C"
 		read
-		mkdir -p "${EROOT}${CONFDIR}" || die
-		chown -R ${PN}:${PN} "${EROOT}${CONFDIR}" ||
+		mkdir -p "${EROOT%/}/var/lib/znc" || die
+		chown -R ${PN}:${PN} "${EROOT%/}/var/lib/znc" ||
 			die "Setting permissions failed"
-		"${EROOT}"/usr/bin/znc --system-wide-config-as znc -c -r -d "${EROOT}${CONFDIR}" ||
+		start-stop-daemon --start --user ${PN}:${PN} --env ZNC_NO_LAUNCH_AFTER_MAKECONF=1 \
+			"${EROOT%/}"/usr/bin/znc -- --makeconf --datadir "${EROOT%/}/var/lib/znc" ||
 			die "Config failed"
-		echo
-		einfo "To start znc, run '/etc/init.d/znc start'"
-		einfo "or add znc to a runlevel:"
-		einfo "  rc-update add znc default"
-	else
-		if use daemon; then
-			ewarn "${CONFDIR} already exists, aborting to avoid damaging"
-			ewarn "any existing configuration. If you are sure you want"
-			ewarn "to generate a new configuration, remove the folder"
-			ewarn "and try again."
-		else
-			ewarn "To configure znc as a system-wide daemon you have to"
-			ewarn "enable the 'daemon' use flag."
-		fi
+		einfo
+		einfo "Now you can start znc service using the init system of your choice."
+		einfo "Don't forget to enable znc service if you want to use znc on boot."
 	fi
 }


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

* [gentoo-commits] repo/gentoo:master commit in: net-irc/znc/, net-irc/znc/files/
@ 2018-05-15 18:03 Michał Górny
  0 siblings, 0 replies; 11+ messages in thread
From: Michał Górny @ 2018-05-15 18:03 UTC (permalink / raw
  To: gentoo-commits

commit:     67309f579907137a6594dbc24fc03f5adf075f85
Author:     Louis Sautier <sautier.louis <AT> gmail <DOT> com>
AuthorDate: Sat May 12 00:36:45 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue May 15 17:46:20 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=67309f57

net-irc/znc: bump to 1.7.0, remove custom patches

Take all the changes from the live ebuild like the new init script and
the new cmake-based build system.

Package-Manager: Portage-2.3.31, Repoman-2.3.9

 net-irc/znc/Manifest               |   2 +
 net-irc/znc/files/README.gentoo-r1 |   4 +-
 net-irc/znc/znc-1.7.0.ebuild       | 152 +++++++++++++++++++++++++++++++++++++
 3 files changed, 156 insertions(+), 2 deletions(-)

diff --git a/net-irc/znc/Manifest b/net-irc/znc/Manifest
index 55c3b0b329c..6949365add4 100644
--- a/net-irc/znc/Manifest
+++ b/net-irc/znc/Manifest
@@ -1,3 +1,5 @@
 DIST googletest-release-1.7.0.tar.gz 468653 BLAKE2B 8dfca8b79dcd7b64ce84bad11ee68c549f4fe3dff7638ed1d845af4a7f754ad5df782d2cbebdb9fecfda2499dae6585e07cda7a8c8c454f0b70723d5c9578aa4 SHA512 c623d5720c4ed574e95158529872815ecff478c03bdcee8b79c9b042a603533f93fe55f939bcfe2cd745ce340fd626ad6d9a95981596f1a4d05053d874cd1dfc
+DIST gtest-1.8.0.tar.gz 1281617 BLAKE2B ac052b4d0eb0d8ded03a8c7dff05177818627b8a51f2dbc2c162b2ee2a5d1323539e7d0d02236d9ebb799995e018f0171c2fdaeb4de3bb339548265e50de79e6 SHA512 1dbece324473e53a83a60601b02c92c089f5d314761351974e097b2cf4d24af4296f9eb8653b6b03b1e363d9c5f793897acae1f0c7ac40149216035c4d395d9d
 DIST znc-1.6.5.tar.gz 1470681 BLAKE2B 9de0b211280489423bc2894d0e76d7276aa42428d07d64516372a9ca6d1616db1f27c0142b54160c61cbee89d65ceadf941d001319254dbff9eb5b016988482e SHA512 d78603ac86d1fb92cdf591b1eb6d32fa19b0e39414bd69e1300c537051612ae590c43d3b8e4dd598cdff605bf3aa1d3d5d806edd428d15d50f733e1670f3e626
 DIST znc-1.6.6.tar.gz 1471612 BLAKE2B 8bd977a95417c4259e9f38759d838f55a146f376dc8bb6230ab6e1b698fb7c9e060cbc237efd4e836961314abab56cc02e7c6bc74e40bad17abaf06e47fbb516 SHA512 cc5bc7328bfe36525ab215b4b53c7cd20aa02b41e7bb28507ff9d9632560f4c30396804e4b828bca0ece19f42813e3fce59d1bae639ea5fc149059f6979e63e7
+DIST znc-1.7.0.tar.gz 1853666 BLAKE2B 3e519d4005a10a9a5329f22ab6abbd19dfa2c7cecb949c138bc72909eae8883576fc0352e3ac46b852b8c58f038150419720aa48791a1339b004206f3afc20e9 SHA512 718dec65dfa2374c568b2694e4faef1f8cf313ae96d171e2263656e077e0fae5f8037c69a23ae33f4ea314ac6e15480c7dccef73ad3ac9324eb79caca622d54b

diff --git a/net-irc/znc/files/README.gentoo-r1 b/net-irc/znc/files/README.gentoo-r1
index cbd565d3d96..ca41e4dac26 100644
--- a/net-irc/znc/files/README.gentoo-r1
+++ b/net-irc/znc/files/README.gentoo-r1
@@ -10,6 +10,6 @@ configuration files:
   # rm -rf /home/$USER/.znc
   # chown -R znc:znc /var/lib/znc
 
-OpenRC user may also adjust the location of the files and the user running
-znc in /etc/conf.d/znc instead. Systemd user may have to overwrite
+OpenRC users may also adjust the location of the files and the user running
+znc in /etc/conf.d/znc instead. Systemd users may have to overwrite the
 existing unit file.

diff --git a/net-irc/znc/znc-1.7.0.ebuild b/net-irc/znc/znc-1.7.0.ebuild
new file mode 100644
index 00000000000..b27016716af
--- /dev/null
+++ b/net-irc/znc/znc-1.7.0.ebuild
@@ -0,0 +1,152 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python3_{4,5,6} )
+
+inherit cmake-utils python-single-r1 readme.gentoo-r1 systemd user
+
+GTEST_VER="1.8.0"
+GTEST_URL="https://github.com/google/googletest/archive/release-${GTEST_VER}.tar.gz -> gtest-${GTEST_VER}.tar.gz"
+DESCRIPTION="An advanced IRC Bouncer"
+
+if [[ ${PV} == *9999* ]]; then
+	inherit git-r3
+	EGIT_REPO_URI=${EGIT_REPO_URI:-"https://github.com/znc/znc.git"}
+	SRC_URI=""
+else
+	SRC_URI="
+		https://znc.in/releases/archive/${P}.tar.gz
+		test? ( ${GTEST_URL} )
+	"
+	KEYWORDS="~amd64 ~arm ~x86"
+fi
+
+HOMEPAGE="https://znc.in"
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="+ipv6 +icu libressl nls perl python +ssl sasl tcl test +zlib"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} icu )"
+
+RDEPEND="
+	icu? ( dev-libs/icu:= )
+	nls? ( dev-libs/boost:=[nls] )
+	perl? ( >=dev-lang/perl-5.10:= )
+	python? ( ${PYTHON_DEPS} )
+	sasl? ( >=dev-libs/cyrus-sasl-2 )
+	ssl? (
+		!libressl? ( dev-libs/openssl:0= )
+		libressl? ( dev-libs/libressl:0= )
+	)
+	tcl? ( dev-lang/tcl:0= )
+	zlib? ( sys-libs/zlib:0= )
+"
+DEPEND="
+	${RDEPEND}
+	virtual/pkgconfig
+	nls? ( sys-devel/gettext )
+	perl? ( >=dev-lang/swig-3.0.0 )
+	python? ( >=dev-lang/swig-3.0.0 )
+"
+
+pkg_setup() {
+	if use python; then
+		python-single-r1_pkg_setup
+	fi
+
+	enewgroup ${PN}
+	enewuser ${PN} -1 -1 /var/lib/${PN} ${PN}
+	# The home directory was previously set to /dev/null
+	# This caused a bug with the systemd unit
+	# https://bugs.gentoo.org/521916
+	esethome ${PN} /var/lib/${PN}
+}
+
+src_prepare() {
+	# Let SWIG rebuild modperl/modpython to make user patching easier.
+	if [[ ${PV} != *9999* ]]; then
+		rm modules/modperl/generated.tar.gz || die
+		rm modules/modpython/generated.tar.gz || die
+	fi
+
+	cmake-utils_src_prepare
+}
+
+src_configure() {
+	local mycmakeargs=(
+		-DWANT_SYSTEMD=yes  # Causes -DSYSTEMD_DIR to be used.
+		-DSYSTEMD_DIR="$(systemd_get_systemunitdir)"
+		-DWANT_ICU="$(usex icu)"
+		-DWANT_IPV6="$(usex ipv6)"
+		-DWANT_I18N="$(usex nls)"
+		-DWANT_PERL="$(usex perl)"
+		-DWANT_PYTHON="$(usex python)"
+		-DWANT_CYRUS="$(usex sasl)"
+		-DWANT_OPENSSL="$(usex ssl)"
+		-DWANT_TCL="$(usex tcl)"
+		-DWANT_ZLIB="$(usex zlib)"
+	)
+
+	if [[ ${PV} != *9999* ]] && use test; then
+		export GTEST_ROOT="${WORKDIR}/googletest-release-${GTEST_VER}/googletest"
+		export GMOCK_ROOT="${WORKDIR}/googletest-release-${GTEST_VER}/googlemock"
+	fi
+
+	cmake-utils_src_configure
+}
+
+src_test() {
+	cmake-utils_src_make unittest
+}
+
+src_install() {
+	cmake-utils_src_install
+
+	dodoc NOTICE
+	newinitd "${FILESDIR}"/znc.initd-r2 znc
+	newconfd "${FILESDIR}"/znc.confd-r1 znc
+
+	DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r1") || die
+	DISABLE_AUTOFORMATTING=1
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	if [[ -z "${REPLACING_VERSIONS}" ]]; then
+		# This is a new installation
+		readme.gentoo_print_elog
+	fi
+
+	if [[ -d "${EROOT%/}"/etc/znc ]]; then
+		ewarn "${EROOT%/}/etc/znc exists on your system."
+		ewarn "Due to the nature of the contents of that folder,"
+		ewarn "we have changed the default configuration to use"
+		ewarn "	${EROOT%/}/var/lib/znc"
+		ewarn "please move ${EROOT%/}/etc/znc to ${EROOT%/}/var/lib/znc"
+		ewarn "or adjust your service configuration."
+	fi
+}
+
+pkg_config() {
+	if [[ -e "${EROOT%/}/var/lib/znc" ]]; then
+		ewarn "${EROOT%/}/var/lib/znc already exists, aborting to avoid damaging"
+		ewarn "any existing configuration. If you are sure you want"
+		ewarn "to generate a new configuration, remove the folder"
+		ewarn "and try again."
+	else
+		einfo "Press enter to interactively create a new configuration file for znc."
+		einfo "To abort, press Control-C"
+		read
+		mkdir -p "${EROOT%/}/var/lib/znc" || die
+		chown -R ${PN}:${PN} "${EROOT%/}/var/lib/znc" ||
+			die "Setting permissions failed"
+		start-stop-daemon --start --user ${PN}:${PN} --env ZNC_NO_LAUNCH_AFTER_MAKECONF=1 \
+			"${EROOT%/}"/usr/bin/znc -- --makeconf --datadir "${EROOT%/}/var/lib/znc" ||
+			die "Config failed"
+		einfo
+		einfo "You can now start the znc service using the init system of your choice."
+		einfo "Don't forget to enable it if you want to use znc at boot."
+	fi
+}


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

* [gentoo-commits] repo/gentoo:master commit in: net-irc/znc/, net-irc/znc/files/
@ 2018-07-04 21:34 Louis Sautier
  0 siblings, 0 replies; 11+ messages in thread
From: Louis Sautier @ 2018-07-04 21:34 UTC (permalink / raw
  To: gentoo-commits

commit:     15112014e7605d13624297d7601504b5d187a6de
Author:     Alexey Sokolov <sokolov <AT> google <DOT> com>
AuthorDate: Tue Jun 19 01:13:38 2018 +0000
Commit:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
CommitDate: Wed Jul  4 21:33:36 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=15112014

net-irc/znc: enable integration testing

Closes: https://github.com/gentoo/gentoo/pull/8901

 net-irc/znc/Manifest                               |  2 +-
 net-irc/znc/files/znc-1.7.0-inttest-dir.patch      | 55 ++++++++++++++++++++++
 .../files/znc-1.7.0-inttest-fix-make-warning.patch | 26 ++++++++++
 net-irc/znc/znc-1.7.0.ebuild                       | 38 +++++++++++++--
 net-irc/znc/znc-9999.ebuild                        | 37 +++++++++++++--
 5 files changed, 149 insertions(+), 9 deletions(-)

diff --git a/net-irc/znc/Manifest b/net-irc/znc/Manifest
index 6949365add4..c68a275dfe4 100644
--- a/net-irc/znc/Manifest
+++ b/net-irc/znc/Manifest
@@ -1,5 +1,5 @@
 DIST googletest-release-1.7.0.tar.gz 468653 BLAKE2B 8dfca8b79dcd7b64ce84bad11ee68c549f4fe3dff7638ed1d845af4a7f754ad5df782d2cbebdb9fecfda2499dae6585e07cda7a8c8c454f0b70723d5c9578aa4 SHA512 c623d5720c4ed574e95158529872815ecff478c03bdcee8b79c9b042a603533f93fe55f939bcfe2cd745ce340fd626ad6d9a95981596f1a4d05053d874cd1dfc
-DIST gtest-1.8.0.tar.gz 1281617 BLAKE2B ac052b4d0eb0d8ded03a8c7dff05177818627b8a51f2dbc2c162b2ee2a5d1323539e7d0d02236d9ebb799995e018f0171c2fdaeb4de3bb339548265e50de79e6 SHA512 1dbece324473e53a83a60601b02c92c089f5d314761351974e097b2cf4d24af4296f9eb8653b6b03b1e363d9c5f793897acae1f0c7ac40149216035c4d395d9d
+DIST gtest-ba96d0b1161f540656efdaed035b3c062b60e006.tar.gz 987370 BLAKE2B fcedfe559c4c93166962900117dc492da3cbb99165c30766c39131c20e3b41f057a31a8cb631beaca829c1e9966e90cbc37469ba56a5fc15a2bea86cbe401a63 SHA512 ce78098f973b45f4a177db387c42a56d5ea34407a2af278760b850c326e8450760a58991d62a5408f5df79f89fefd10fee71745b7e8669b2a6f74fa63a259600
 DIST znc-1.6.5.tar.gz 1470681 BLAKE2B 9de0b211280489423bc2894d0e76d7276aa42428d07d64516372a9ca6d1616db1f27c0142b54160c61cbee89d65ceadf941d001319254dbff9eb5b016988482e SHA512 d78603ac86d1fb92cdf591b1eb6d32fa19b0e39414bd69e1300c537051612ae590c43d3b8e4dd598cdff605bf3aa1d3d5d806edd428d15d50f733e1670f3e626
 DIST znc-1.6.6.tar.gz 1471612 BLAKE2B 8bd977a95417c4259e9f38759d838f55a146f376dc8bb6230ab6e1b698fb7c9e060cbc237efd4e836961314abab56cc02e7c6bc74e40bad17abaf06e47fbb516 SHA512 cc5bc7328bfe36525ab215b4b53c7cd20aa02b41e7bb28507ff9d9632560f4c30396804e4b828bca0ece19f42813e3fce59d1bae639ea5fc149059f6979e63e7
 DIST znc-1.7.0.tar.gz 1853666 BLAKE2B 3e519d4005a10a9a5329f22ab6abbd19dfa2c7cecb949c138bc72909eae8883576fc0352e3ac46b852b8c58f038150419720aa48791a1339b004206f3afc20e9 SHA512 718dec65dfa2374c568b2694e4faef1f8cf313ae96d171e2263656e077e0fae5f8037c69a23ae33f4ea314ac6e15480c7dccef73ad3ac9324eb79caca622d54b

diff --git a/net-irc/znc/files/znc-1.7.0-inttest-dir.patch b/net-irc/znc/files/znc-1.7.0-inttest-dir.patch
new file mode 100644
index 00000000000..250eccc53fb
--- /dev/null
+++ b/net-irc/znc/files/znc-1.7.0-inttest-dir.patch
@@ -0,0 +1,55 @@
+diff --git a/include/znc/znc.h b/include/znc/znc.h
+index ecb2b41a..a791a648 100644
+--- a/include/znc/znc.h
++++ b/include/znc/znc.h
+@@ -251,6 +251,7 @@ class CZNC : private CCoreTranslationMixin {
+     void DisableConfigTimer();
+ 
+     static void DumpConfig(const CConfig* Config);
++    static CString UnusualRoot();
+ 
+   private:
+     static CString FormatBindError();
+diff --git a/src/Modules.cpp b/src/Modules.cpp
+index 5aec7805..6f9c34ae 100644
+--- a/src/Modules.cpp
++++ b/src/Modules.cpp
+@@ -1899,9 +1899,10 @@ CModules::ModDirList CModules::GetModDirs() {
+     sDir = CZNC::Get().GetModPath() + "/";
+     ret.push(std::make_pair(sDir, sDir));
+ 
++    CString sUnusualRoot = CZNC::UnusualRoot();
+     // <moduledir> and <datadir> (<prefix>/lib/znc)
+-    ret.push(std::make_pair(_MODDIR_ + CString("/"),
+-                            _DATADIR_ + CString("/modules/")));
++    ret.push(std::make_pair(sUnusualRoot + _MODDIR_ + CString("/"),
++                            sUnusualRoot + _DATADIR_ + CString("/modules/")));
+ 
+     return ret;
+ }
+diff --git a/src/WebModules.cpp b/src/WebModules.cpp
+index 19ece50a..8ea4d9fa 100644
+--- a/src/WebModules.cpp
++++ b/src/WebModules.cpp
+@@ -563,7 +563,7 @@ CString CWebSock::GetSkinPath(const CString& sSkinName) {
+         sRet = CZNC::Get().GetCurPath() + "/webskins/" + sSkinName;
+ 
+         if (!CFile::IsDir(sRet)) {
+-            sRet = CString(_SKINDIR_) + "/" + sSkinName;
++            sRet = CZNC::UnusualRoot() + CString(_SKINDIR_) + "/" + sSkinName;
+         }
+     }
+ 
+diff --git a/src/znc.cpp b/src/znc.cpp
+index 4e7216ee..dd901497 100644
+--- a/src/znc.cpp
++++ b/src/znc.cpp
+@@ -2130,3 +2130,8 @@ void CZNC::DisableConfigTimer() {
+         m_pConfigTimer = nullptr;
+     }
+ }
++
++CString CZNC::UnusualRoot() {
++    char* szUnusualRoot = getenv("ZNC_UNUSUAL_ROOT");
++    return szUnusualRoot ? szUnusualRoot : "";
++}

diff --git a/net-irc/znc/files/znc-1.7.0-inttest-fix-make-warning.patch b/net-irc/znc/files/znc-1.7.0-inttest-fix-make-warning.patch
new file mode 100644
index 00000000000..0be20e4c08d
--- /dev/null
+++ b/net-irc/znc/files/znc-1.7.0-inttest-fix-make-warning.patch
@@ -0,0 +1,26 @@
+From abee9f9bfc8c9ca9d4616238fdd812c4200b17d5 Mon Sep 17 00:00:00 2001
+From: Alexey Sokolov <alexey+znc@asokolov.org>
+Date: Thu, 28 Jun 2018 23:57:29 +0100
+Subject: [PATCH] Fix a warning in integration test / gmake / znc-buildmod
+ interaction.
+
+It was requested on https://github.com/gentoo/gentoo/pull/8901
+---
+ test/CMakeLists.txt | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
+index b19c22fab..296cb0de7 100644
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -85,5 +85,10 @@ externalproject_add(inttest_bin
+ 	"-DZNC_BIN_DIR:path=${CMAKE_INSTALL_FULL_BINDIR}"
+ 	"-DQt5_HINTS:path=${brew_qt5}")
+ add_custom_target(inttest COMMAND
++	# Prevent a warning from test of znc-buildmod, when inner make
++	# discovers that there is an outer make and tries to use it:
++	# gmake[4]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
++	# This option doesn't affect ninja, which doesn't show that warning anyway.
++	${CMAKE_COMMAND} -E env MAKEFLAGS=
+ 	"${CMAKE_CURRENT_BINARY_DIR}/integration/inttest")
+ add_dependencies(inttest inttest_bin)

diff --git a/net-irc/znc/znc-1.7.0.ebuild b/net-irc/znc/znc-1.7.0.ebuild
index b27016716af..7cd8c886597 100644
--- a/net-irc/znc/znc-1.7.0.ebuild
+++ b/net-irc/znc/znc-1.7.0.ebuild
@@ -7,8 +7,8 @@ PYTHON_COMPAT=( python3_{4,5,6} )
 
 inherit cmake-utils python-single-r1 readme.gentoo-r1 systemd user
 
-GTEST_VER="1.8.0"
-GTEST_URL="https://github.com/google/googletest/archive/release-${GTEST_VER}.tar.gz -> gtest-${GTEST_VER}.tar.gz"
+GTEST_VER="ba96d0b1161f540656efdaed035b3c062b60e006" # 1.8.0 is too old, but newer version not released yet
+GTEST_URL="https://github.com/google/googletest/archive/${GTEST_VER}.tar.gz -> gtest-${GTEST_VER}.tar.gz"
 DESCRIPTION="An advanced IRC Bouncer"
 
 if [[ ${PV} == *9999* ]]; then
@@ -49,8 +49,14 @@ DEPEND="
 	nls? ( sys-devel/gettext )
 	perl? ( >=dev-lang/swig-3.0.0 )
 	python? ( >=dev-lang/swig-3.0.0 )
+	test? ( dev-qt/qtnetwork:5 )
 "
 
+PATCHES=(
+	"${FILESDIR}"/${PN}-1.7.0-inttest-fix-make-warning.patch
+	"${FILESDIR}"/${PN}-1.7.0-inttest-dir.patch
+)
+
 pkg_setup() {
 	if use python; then
 		python-single-r1_pkg_setup
@@ -71,6 +77,9 @@ src_prepare() {
 		rm modules/modpython/generated.tar.gz || die
 	fi
 
+	sed -i -e "s|DZNC_BIN_DIR:path=|DZNC_BIN_DIR:path=${T}/inttest|" \
+		test/CMakeLists.txt || die
+
 	cmake-utils_src_prepare
 }
 
@@ -90,8 +99,8 @@ src_configure() {
 	)
 
 	if [[ ${PV} != *9999* ]] && use test; then
-		export GTEST_ROOT="${WORKDIR}/googletest-release-${GTEST_VER}/googletest"
-		export GMOCK_ROOT="${WORKDIR}/googletest-release-${GTEST_VER}/googlemock"
+		export GTEST_ROOT="${WORKDIR}/googletest-${GTEST_VER}/googletest"
+		export GMOCK_ROOT="${WORKDIR}/googletest-${GTEST_VER}/googlemock"
 	fi
 
 	cmake-utils_src_configure
@@ -99,6 +108,27 @@ src_configure() {
 
 src_test() {
 	cmake-utils_src_make unittest
+	if has network-sandbox ${FEATURES}; then
+		cmake-utils_src_make install DESTDIR="${T}/inttest"
+		local filter='-'
+		if ! use perl; then
+			filter="${filter}:ZNCTest.Modperl*"
+		fi
+		if ! use python; then
+			filter="${filter}:ZNCTest.Modpython*"
+		fi
+		# CMAKE_PREFIX_PATH and CXXFLAGS are needed for znc-buildmod
+		# invocations from inside the test
+		GTEST_FILTER="${filter}" ZNC_UNUSUAL_ROOT="${T}/inttest" \
+			CMAKE_PREFIX_PATH="${T}/inttest/usr/share/znc/cmake" \
+			CXXFLAGS="${CXXFLAGS} -isystem ${T}/inttest/usr/include" \
+			cmake-utils_src_make inttest
+	else
+		# TODO: don't require sandbox after
+		# https://github.com/znc/znc/pull/1363 is implemented
+		ewarn "FEATURES=-network-sandbox; skipping integration tests which"
+		ewarn "temporary open local ports."
+	fi
 }
 
 src_install() {

diff --git a/net-irc/znc/znc-9999.ebuild b/net-irc/znc/znc-9999.ebuild
index b27016716af..ec9c6196f37 100644
--- a/net-irc/znc/znc-9999.ebuild
+++ b/net-irc/znc/znc-9999.ebuild
@@ -7,8 +7,8 @@ PYTHON_COMPAT=( python3_{4,5,6} )
 
 inherit cmake-utils python-single-r1 readme.gentoo-r1 systemd user
 
-GTEST_VER="1.8.0"
-GTEST_URL="https://github.com/google/googletest/archive/release-${GTEST_VER}.tar.gz -> gtest-${GTEST_VER}.tar.gz"
+GTEST_VER="ba96d0b1161f540656efdaed035b3c062b60e006" # 1.8.0 is too old, but newer version not released yet
+GTEST_URL="https://github.com/google/googletest/archive/${GTEST_VER}.tar.gz -> gtest-${GTEST_VER}.tar.gz"
 DESCRIPTION="An advanced IRC Bouncer"
 
 if [[ ${PV} == *9999* ]]; then
@@ -49,8 +49,13 @@ DEPEND="
 	nls? ( sys-devel/gettext )
 	perl? ( >=dev-lang/swig-3.0.0 )
 	python? ( >=dev-lang/swig-3.0.0 )
+	test? ( dev-qt/qtnetwork:5 )
 "
 
+PATCHES=(
+	"${FILESDIR}"/${PN}-1.7.0-inttest-dir.patch
+)
+
 pkg_setup() {
 	if use python; then
 		python-single-r1_pkg_setup
@@ -71,6 +76,9 @@ src_prepare() {
 		rm modules/modpython/generated.tar.gz || die
 	fi
 
+	sed -i -e "s|DZNC_BIN_DIR:path=|DZNC_BIN_DIR:path=${T}/inttest|" \
+		test/CMakeLists.txt || die
+
 	cmake-utils_src_prepare
 }
 
@@ -90,8 +98,8 @@ src_configure() {
 	)
 
 	if [[ ${PV} != *9999* ]] && use test; then
-		export GTEST_ROOT="${WORKDIR}/googletest-release-${GTEST_VER}/googletest"
-		export GMOCK_ROOT="${WORKDIR}/googletest-release-${GTEST_VER}/googlemock"
+		export GTEST_ROOT="${WORKDIR}/googletest-${GTEST_VER}/googletest"
+		export GMOCK_ROOT="${WORKDIR}/googletest-${GTEST_VER}/googlemock"
 	fi
 
 	cmake-utils_src_configure
@@ -99,6 +107,27 @@ src_configure() {
 
 src_test() {
 	cmake-utils_src_make unittest
+	if has network-sandbox ${FEATURES}; then
+		cmake-utils_src_make install DESTDIR="${T}/inttest"
+		local filter='-'
+		if ! use perl; then
+			filter="${filter}:ZNCTest.Modperl*"
+		fi
+		if ! use python; then
+			filter="${filter}:ZNCTest.Modpython*"
+		fi
+		# CMAKE_PREFIX_PATH and CXXFLAGS are needed for znc-buildmod
+		# invocations from inside the test
+		GTEST_FILTER="${filter}" ZNC_UNUSUAL_ROOT="${T}/inttest" \
+			CMAKE_PREFIX_PATH="${T}/inttest/usr/share/znc/cmake" \
+			CXXFLAGS="${CXXFLAGS} -isystem ${T}/inttest/usr/include" \
+			cmake-utils_src_make inttest
+	else
+		# TODO: don't require sandbox after
+		# https://github.com/znc/znc/pull/1363 is implemented
+		ewarn "FEATURES=-network-sandbox; skipping integration tests which"
+		ewarn "temporary open local ports."
+	fi
 }
 
 src_install() {


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

* [gentoo-commits] repo/gentoo:master commit in: net-irc/znc/, net-irc/znc/files/
@ 2018-07-15 22:40 Louis Sautier
  0 siblings, 0 replies; 11+ messages in thread
From: Louis Sautier @ 2018-07-15 22:40 UTC (permalink / raw
  To: gentoo-commits

commit:     25ec114c14413ef58d51274f8f1ac800b19c650c
Author:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 15 22:11:56 2018 +0000
Commit:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
CommitDate: Sun Jul 15 22:40:41 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=25ec114c

net-irc/znc: bump to 1.7.1_rc1, fixes multiple vulnerabilities

Bug: https://bugs.gentoo.org/661228
Package-Manager: Portage-2.3.42, Repoman-2.3.9

 net-irc/znc/Manifest                          |   1 +
 net-irc/znc/files/znc-1.7.1-inttest-dir.patch |  64 +++++++++
 net-irc/znc/znc-1.7.1_rc1.ebuild              | 182 ++++++++++++++++++++++++++
 3 files changed, 247 insertions(+)

diff --git a/net-irc/znc/Manifest b/net-irc/znc/Manifest
index c68a275dfe4..08205bafd48 100644
--- a/net-irc/znc/Manifest
+++ b/net-irc/znc/Manifest
@@ -3,3 +3,4 @@ DIST gtest-ba96d0b1161f540656efdaed035b3c062b60e006.tar.gz 987370 BLAKE2B fcedfe
 DIST znc-1.6.5.tar.gz 1470681 BLAKE2B 9de0b211280489423bc2894d0e76d7276aa42428d07d64516372a9ca6d1616db1f27c0142b54160c61cbee89d65ceadf941d001319254dbff9eb5b016988482e SHA512 d78603ac86d1fb92cdf591b1eb6d32fa19b0e39414bd69e1300c537051612ae590c43d3b8e4dd598cdff605bf3aa1d3d5d806edd428d15d50f733e1670f3e626
 DIST znc-1.6.6.tar.gz 1471612 BLAKE2B 8bd977a95417c4259e9f38759d838f55a146f376dc8bb6230ab6e1b698fb7c9e060cbc237efd4e836961314abab56cc02e7c6bc74e40bad17abaf06e47fbb516 SHA512 cc5bc7328bfe36525ab215b4b53c7cd20aa02b41e7bb28507ff9d9632560f4c30396804e4b828bca0ece19f42813e3fce59d1bae639ea5fc149059f6979e63e7
 DIST znc-1.7.0.tar.gz 1853666 BLAKE2B 3e519d4005a10a9a5329f22ab6abbd19dfa2c7cecb949c138bc72909eae8883576fc0352e3ac46b852b8c58f038150419720aa48791a1339b004206f3afc20e9 SHA512 718dec65dfa2374c568b2694e4faef1f8cf313ae96d171e2263656e077e0fae5f8037c69a23ae33f4ea314ac6e15480c7dccef73ad3ac9324eb79caca622d54b
+DIST znc-1.7.1-rc1.tar.gz 2041320 BLAKE2B 62669b598d7423cb55fad458fe6172be36904e8599dcde757936883093f24deb6a5ed6a093e3e92854810f02e96372f44139f9807e70e0cf007de90a1373c6a8 SHA512 b4e223c86c75bc97620c52333d90d6458a02777dce9c629f8a095f8134a06992a60978b2fe8bbce29ed1155932f9f37e0a324a498ee16527b0235e4306c34973

diff --git a/net-irc/znc/files/znc-1.7.1-inttest-dir.patch b/net-irc/znc/files/znc-1.7.1-inttest-dir.patch
new file mode 100644
index 00000000000..9aff2a9b64b
--- /dev/null
+++ b/net-irc/znc/files/znc-1.7.1-inttest-dir.patch
@@ -0,0 +1,64 @@
+commit 95f1c7e9081866ea1e716743ea039a74565f80c6
+Author: Louis Sautier <sautier.louis@gmail.com>
+Date:   Sun Jul 15 15:36:21 2018 +0200
+
+    Allow integration tests to be run inside a different root
+    
+    Based on DarthGandalf's patch submitted in
+    https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=15112014e7605d13624297d7601504b5d187a6de
+
+diff --git a/include/znc/znc.h b/include/znc/znc.h
+index ecb2b41a..a791a648 100644
+--- a/include/znc/znc.h
++++ b/include/znc/znc.h
+@@ -251,6 +251,7 @@ class CZNC : private CCoreTranslationMixin {
+     void DisableConfigTimer();
+ 
+     static void DumpConfig(const CConfig* Config);
++    static CString UnusualRoot();
+ 
+   private:
+     static CString FormatBindError();
+diff --git a/src/Modules.cpp b/src/Modules.cpp
+index 5aec7805..6f9c34ae 100644
+--- a/src/Modules.cpp
++++ b/src/Modules.cpp
+@@ -1899,9 +1899,10 @@ CModules::ModDirList CModules::GetModDirs() {
+     sDir = CZNC::Get().GetModPath() + "/";
+     ret.push(std::make_pair(sDir, sDir));
+ 
++    CString sUnusualRoot = CZNC::UnusualRoot();
+     // <moduledir> and <datadir> (<prefix>/lib/znc)
+-    ret.push(std::make_pair(_MODDIR_ + CString("/"),
+-                            _DATADIR_ + CString("/modules/")));
++    ret.push(std::make_pair(sUnusualRoot + _MODDIR_ + CString("/"),
++                            sUnusualRoot + _DATADIR_ + CString("/modules/")));
+ 
+     return ret;
+ }
+diff --git a/src/WebModules.cpp b/src/WebModules.cpp
+index a5841987..f1b8a421 100644
+--- a/src/WebModules.cpp
++++ b/src/WebModules.cpp
+@@ -565,7 +565,7 @@ CString CWebSock::GetSkinPath(const CString& sSkinName) {
+         sRet = CZNC::Get().GetCurPath() + "/webskins/" + sSkin;
+ 
+         if (!CFile::IsDir(sRet)) {
+-            sRet = CString(_SKINDIR_) + "/" + sSkin;
++            sRet = CZNC::UnusualRoot() + CString(_SKINDIR_) + "/" + sSkin;
+         }
+     }
+ 
+diff --git a/src/znc.cpp b/src/znc.cpp
+index 4e7216ee..dd901497 100644
+--- a/src/znc.cpp
++++ b/src/znc.cpp
+@@ -2130,3 +2130,8 @@ void CZNC::DisableConfigTimer() {
+         m_pConfigTimer = nullptr;
+     }
+ }
++
++CString CZNC::UnusualRoot() {
++    char* szUnusualRoot = getenv("ZNC_UNUSUAL_ROOT");
++    return szUnusualRoot ? szUnusualRoot : "";
++}

diff --git a/net-irc/znc/znc-1.7.1_rc1.ebuild b/net-irc/znc/znc-1.7.1_rc1.ebuild
new file mode 100644
index 00000000000..e59849a6e29
--- /dev/null
+++ b/net-irc/znc/znc-1.7.1_rc1.ebuild
@@ -0,0 +1,182 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python3_{4,5,6} )
+
+inherit cmake-utils python-single-r1 readme.gentoo-r1 systemd user
+
+GTEST_VER="ba96d0b1161f540656efdaed035b3c062b60e006" # 1.8.0 is too old, but newer version not released yet
+GTEST_URL="https://github.com/google/googletest/archive/${GTEST_VER}.tar.gz -> gtest-${GTEST_VER}.tar.gz"
+DESCRIPTION="An advanced IRC Bouncer"
+
+if [[ ${PV} == *9999* ]]; then
+	inherit git-r3
+	EGIT_REPO_URI=${EGIT_REPO_URI:-"https://github.com/znc/znc.git"}
+	SRC_URI=""
+else
+	MY_PV=${PV/_/-}
+	MY_P=${PN}-${MY_PV}
+	SRC_URI="
+		https://znc.in/releases/archive/${MY_P}.tar.gz
+		test? ( ${GTEST_URL} )
+	"
+	KEYWORDS="~amd64 ~arm ~x86"
+	S=${WORKDIR}/${MY_P}
+fi
+
+HOMEPAGE="https://znc.in"
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="+ipv6 +icu libressl nls perl python +ssl sasl tcl test +zlib"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} icu )"
+
+RDEPEND="
+	icu? ( dev-libs/icu:= )
+	nls? ( dev-libs/boost:=[nls] )
+	perl? ( >=dev-lang/perl-5.10:= )
+	python? ( ${PYTHON_DEPS} )
+	sasl? ( >=dev-libs/cyrus-sasl-2 )
+	ssl? (
+		!libressl? ( dev-libs/openssl:0= )
+		libressl? ( dev-libs/libressl:0= )
+	)
+	tcl? ( dev-lang/tcl:0= )
+	zlib? ( sys-libs/zlib:0= )
+"
+DEPEND="
+	${RDEPEND}
+	virtual/pkgconfig
+	nls? ( sys-devel/gettext )
+	perl? ( >=dev-lang/swig-3.0.0 )
+	python? ( >=dev-lang/swig-3.0.0 )
+	test? ( dev-qt/qtnetwork:5 )
+"
+
+PATCHES=( "${FILESDIR}"/${PN}-1.7.1-inttest-dir.patch )
+
+pkg_setup() {
+	if use python; then
+		python-single-r1_pkg_setup
+	fi
+
+	enewgroup ${PN}
+	enewuser ${PN} -1 -1 /var/lib/${PN} ${PN}
+	# The home directory was previously set to /dev/null
+	# This caused a bug with the systemd unit
+	# https://bugs.gentoo.org/521916
+	esethome ${PN} /var/lib/${PN}
+}
+
+src_prepare() {
+	# Let SWIG rebuild modperl/modpython to make user patching easier.
+	if [[ ${PV} != *9999* ]]; then
+		rm modules/modperl/generated.tar.gz || die
+		rm modules/modpython/generated.tar.gz || die
+	fi
+
+	sed -i -e "s|DZNC_BIN_DIR:path=|DZNC_BIN_DIR:path=${T}/inttest|" \
+		test/CMakeLists.txt || die
+
+	cmake-utils_src_prepare
+}
+
+src_configure() {
+	local mycmakeargs=(
+		-DWANT_SYSTEMD=yes  # Causes -DSYSTEMD_DIR to be used.
+		-DSYSTEMD_DIR="$(systemd_get_systemunitdir)"
+		-DWANT_ICU="$(usex icu)"
+		-DWANT_IPV6="$(usex ipv6)"
+		-DWANT_I18N="$(usex nls)"
+		-DWANT_PERL="$(usex perl)"
+		-DWANT_PYTHON="$(usex python)"
+		-DWANT_CYRUS="$(usex sasl)"
+		-DWANT_OPENSSL="$(usex ssl)"
+		-DWANT_TCL="$(usex tcl)"
+		-DWANT_ZLIB="$(usex zlib)"
+	)
+
+	if [[ ${PV} != *9999* ]] && use test; then
+		export GTEST_ROOT="${WORKDIR}/googletest-${GTEST_VER}/googletest"
+		export GMOCK_ROOT="${WORKDIR}/googletest-${GTEST_VER}/googlemock"
+	fi
+
+	cmake-utils_src_configure
+}
+
+src_test() {
+	cmake-utils_src_make unittest
+	if has network-sandbox ${FEATURES}; then
+		cmake-utils_src_make install DESTDIR="${T}/inttest"
+		local filter='-'
+		if ! use perl; then
+			filter="${filter}:ZNCTest.Modperl*"
+		fi
+		if ! use python; then
+			filter="${filter}:ZNCTest.Modpython*"
+		fi
+		# CMAKE_PREFIX_PATH and CXXFLAGS are needed for znc-buildmod
+		# invocations from inside the test
+		GTEST_FILTER="${filter}" ZNC_UNUSUAL_ROOT="${T}/inttest" \
+			CMAKE_PREFIX_PATH="${T}/inttest/usr/share/znc/cmake" \
+			CXXFLAGS="${CXXFLAGS} -isystem ${T}/inttest/usr/include" \
+			cmake-utils_src_make inttest
+	else
+		# TODO: don't require sandbox after
+		# https://github.com/znc/znc/pull/1363 is implemented
+		ewarn "FEATURES=-network-sandbox; skipping integration tests which"
+		ewarn "temporary open local ports."
+	fi
+}
+
+src_install() {
+	cmake-utils_src_install
+
+	dodoc NOTICE
+	newinitd "${FILESDIR}"/znc.initd-r2 znc
+	newconfd "${FILESDIR}"/znc.confd-r1 znc
+
+	DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r1") || die
+	DISABLE_AUTOFORMATTING=1
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	if [[ -z "${REPLACING_VERSIONS}" ]]; then
+		# This is a new installation
+		readme.gentoo_print_elog
+	fi
+
+	if [[ -d "${EROOT%/}"/etc/znc ]]; then
+		ewarn "${EROOT%/}/etc/znc exists on your system."
+		ewarn "Due to the nature of the contents of that folder,"
+		ewarn "we have changed the default configuration to use"
+		ewarn "	${EROOT%/}/var/lib/znc"
+		ewarn "please move ${EROOT%/}/etc/znc to ${EROOT%/}/var/lib/znc"
+		ewarn "or adjust your service configuration."
+	fi
+}
+
+pkg_config() {
+	if [[ -e "${EROOT%/}/var/lib/znc" ]]; then
+		ewarn "${EROOT%/}/var/lib/znc already exists, aborting to avoid damaging"
+		ewarn "any existing configuration. If you are sure you want"
+		ewarn "to generate a new configuration, remove the folder"
+		ewarn "and try again."
+	else
+		einfo "Press enter to interactively create a new configuration file for znc."
+		einfo "To abort, press Control-C"
+		read
+		mkdir -p "${EROOT%/}/var/lib/znc" || die
+		chown -R ${PN}:${PN} "${EROOT%/}/var/lib/znc" ||
+			die "Setting permissions failed"
+		start-stop-daemon --start --user ${PN}:${PN} --env ZNC_NO_LAUNCH_AFTER_MAKECONF=1 \
+			"${EROOT%/}"/usr/bin/znc -- --makeconf --datadir "${EROOT%/}/var/lib/znc" ||
+			die "Config failed"
+		einfo
+		einfo "You can now start the znc service using the init system of your choice."
+		einfo "Don't forget to enable it if you want to use znc at boot."
+	fi
+}


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

* [gentoo-commits] repo/gentoo:master commit in: net-irc/znc/, net-irc/znc/files/
@ 2018-07-15 22:41 Louis Sautier
  0 siblings, 0 replies; 11+ messages in thread
From: Louis Sautier @ 2018-07-15 22:41 UTC (permalink / raw
  To: gentoo-commits

commit:     444ca74f9ed8b53b80e335df98065aac879151ec
Author:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 15 22:41:33 2018 +0000
Commit:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
CommitDate: Sun Jul 15 22:41:33 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=444ca74f

net-irc/znc: remove old

Package-Manager: Portage-2.3.42, Repoman-2.3.9

 net-irc/znc/Manifest                               |   1 -
 net-irc/znc/files/znc-1.7.0-inttest-dir.patch      |  55 -------
 .../files/znc-1.7.0-inttest-fix-make-warning.patch |  26 ---
 net-irc/znc/znc-1.7.0.ebuild                       | 182 ---------------------
 4 files changed, 264 deletions(-)

diff --git a/net-irc/znc/Manifest b/net-irc/znc/Manifest
index 741c0f30e99..eedc2aef66e 100644
--- a/net-irc/znc/Manifest
+++ b/net-irc/znc/Manifest
@@ -1,5 +1,4 @@
 DIST googletest-release-1.7.0.tar.gz 468653 BLAKE2B 8dfca8b79dcd7b64ce84bad11ee68c549f4fe3dff7638ed1d845af4a7f754ad5df782d2cbebdb9fecfda2499dae6585e07cda7a8c8c454f0b70723d5c9578aa4 SHA512 c623d5720c4ed574e95158529872815ecff478c03bdcee8b79c9b042a603533f93fe55f939bcfe2cd745ce340fd626ad6d9a95981596f1a4d05053d874cd1dfc
 DIST gtest-ba96d0b1161f540656efdaed035b3c062b60e006.tar.gz 987370 BLAKE2B fcedfe559c4c93166962900117dc492da3cbb99165c30766c39131c20e3b41f057a31a8cb631beaca829c1e9966e90cbc37469ba56a5fc15a2bea86cbe401a63 SHA512 ce78098f973b45f4a177db387c42a56d5ea34407a2af278760b850c326e8450760a58991d62a5408f5df79f89fefd10fee71745b7e8669b2a6f74fa63a259600
 DIST znc-1.6.6.tar.gz 1471612 BLAKE2B 8bd977a95417c4259e9f38759d838f55a146f376dc8bb6230ab6e1b698fb7c9e060cbc237efd4e836961314abab56cc02e7c6bc74e40bad17abaf06e47fbb516 SHA512 cc5bc7328bfe36525ab215b4b53c7cd20aa02b41e7bb28507ff9d9632560f4c30396804e4b828bca0ece19f42813e3fce59d1bae639ea5fc149059f6979e63e7
-DIST znc-1.7.0.tar.gz 1853666 BLAKE2B 3e519d4005a10a9a5329f22ab6abbd19dfa2c7cecb949c138bc72909eae8883576fc0352e3ac46b852b8c58f038150419720aa48791a1339b004206f3afc20e9 SHA512 718dec65dfa2374c568b2694e4faef1f8cf313ae96d171e2263656e077e0fae5f8037c69a23ae33f4ea314ac6e15480c7dccef73ad3ac9324eb79caca622d54b
 DIST znc-1.7.1-rc1.tar.gz 2041320 BLAKE2B 62669b598d7423cb55fad458fe6172be36904e8599dcde757936883093f24deb6a5ed6a093e3e92854810f02e96372f44139f9807e70e0cf007de90a1373c6a8 SHA512 b4e223c86c75bc97620c52333d90d6458a02777dce9c629f8a095f8134a06992a60978b2fe8bbce29ed1155932f9f37e0a324a498ee16527b0235e4306c34973

diff --git a/net-irc/znc/files/znc-1.7.0-inttest-dir.patch b/net-irc/znc/files/znc-1.7.0-inttest-dir.patch
deleted file mode 100644
index 250eccc53fb..00000000000
--- a/net-irc/znc/files/znc-1.7.0-inttest-dir.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-diff --git a/include/znc/znc.h b/include/znc/znc.h
-index ecb2b41a..a791a648 100644
---- a/include/znc/znc.h
-+++ b/include/znc/znc.h
-@@ -251,6 +251,7 @@ class CZNC : private CCoreTranslationMixin {
-     void DisableConfigTimer();
- 
-     static void DumpConfig(const CConfig* Config);
-+    static CString UnusualRoot();
- 
-   private:
-     static CString FormatBindError();
-diff --git a/src/Modules.cpp b/src/Modules.cpp
-index 5aec7805..6f9c34ae 100644
---- a/src/Modules.cpp
-+++ b/src/Modules.cpp
-@@ -1899,9 +1899,10 @@ CModules::ModDirList CModules::GetModDirs() {
-     sDir = CZNC::Get().GetModPath() + "/";
-     ret.push(std::make_pair(sDir, sDir));
- 
-+    CString sUnusualRoot = CZNC::UnusualRoot();
-     // <moduledir> and <datadir> (<prefix>/lib/znc)
--    ret.push(std::make_pair(_MODDIR_ + CString("/"),
--                            _DATADIR_ + CString("/modules/")));
-+    ret.push(std::make_pair(sUnusualRoot + _MODDIR_ + CString("/"),
-+                            sUnusualRoot + _DATADIR_ + CString("/modules/")));
- 
-     return ret;
- }
-diff --git a/src/WebModules.cpp b/src/WebModules.cpp
-index 19ece50a..8ea4d9fa 100644
---- a/src/WebModules.cpp
-+++ b/src/WebModules.cpp
-@@ -563,7 +563,7 @@ CString CWebSock::GetSkinPath(const CString& sSkinName) {
-         sRet = CZNC::Get().GetCurPath() + "/webskins/" + sSkinName;
- 
-         if (!CFile::IsDir(sRet)) {
--            sRet = CString(_SKINDIR_) + "/" + sSkinName;
-+            sRet = CZNC::UnusualRoot() + CString(_SKINDIR_) + "/" + sSkinName;
-         }
-     }
- 
-diff --git a/src/znc.cpp b/src/znc.cpp
-index 4e7216ee..dd901497 100644
---- a/src/znc.cpp
-+++ b/src/znc.cpp
-@@ -2130,3 +2130,8 @@ void CZNC::DisableConfigTimer() {
-         m_pConfigTimer = nullptr;
-     }
- }
-+
-+CString CZNC::UnusualRoot() {
-+    char* szUnusualRoot = getenv("ZNC_UNUSUAL_ROOT");
-+    return szUnusualRoot ? szUnusualRoot : "";
-+}

diff --git a/net-irc/znc/files/znc-1.7.0-inttest-fix-make-warning.patch b/net-irc/znc/files/znc-1.7.0-inttest-fix-make-warning.patch
deleted file mode 100644
index 0be20e4c08d..00000000000
--- a/net-irc/znc/files/znc-1.7.0-inttest-fix-make-warning.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From abee9f9bfc8c9ca9d4616238fdd812c4200b17d5 Mon Sep 17 00:00:00 2001
-From: Alexey Sokolov <alexey+znc@asokolov.org>
-Date: Thu, 28 Jun 2018 23:57:29 +0100
-Subject: [PATCH] Fix a warning in integration test / gmake / znc-buildmod
- interaction.
-
-It was requested on https://github.com/gentoo/gentoo/pull/8901
----
- test/CMakeLists.txt | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
-index b19c22fab..296cb0de7 100644
---- a/test/CMakeLists.txt
-+++ b/test/CMakeLists.txt
-@@ -85,5 +85,10 @@ externalproject_add(inttest_bin
- 	"-DZNC_BIN_DIR:path=${CMAKE_INSTALL_FULL_BINDIR}"
- 	"-DQt5_HINTS:path=${brew_qt5}")
- add_custom_target(inttest COMMAND
-+	# Prevent a warning from test of znc-buildmod, when inner make
-+	# discovers that there is an outer make and tries to use it:
-+	# gmake[4]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
-+	# This option doesn't affect ninja, which doesn't show that warning anyway.
-+	${CMAKE_COMMAND} -E env MAKEFLAGS=
- 	"${CMAKE_CURRENT_BINARY_DIR}/integration/inttest")
- add_dependencies(inttest inttest_bin)

diff --git a/net-irc/znc/znc-1.7.0.ebuild b/net-irc/znc/znc-1.7.0.ebuild
deleted file mode 100644
index 7cd8c886597..00000000000
--- a/net-irc/znc/znc-1.7.0.ebuild
+++ /dev/null
@@ -1,182 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-PYTHON_COMPAT=( python3_{4,5,6} )
-
-inherit cmake-utils python-single-r1 readme.gentoo-r1 systemd user
-
-GTEST_VER="ba96d0b1161f540656efdaed035b3c062b60e006" # 1.8.0 is too old, but newer version not released yet
-GTEST_URL="https://github.com/google/googletest/archive/${GTEST_VER}.tar.gz -> gtest-${GTEST_VER}.tar.gz"
-DESCRIPTION="An advanced IRC Bouncer"
-
-if [[ ${PV} == *9999* ]]; then
-	inherit git-r3
-	EGIT_REPO_URI=${EGIT_REPO_URI:-"https://github.com/znc/znc.git"}
-	SRC_URI=""
-else
-	SRC_URI="
-		https://znc.in/releases/archive/${P}.tar.gz
-		test? ( ${GTEST_URL} )
-	"
-	KEYWORDS="~amd64 ~arm ~x86"
-fi
-
-HOMEPAGE="https://znc.in"
-LICENSE="Apache-2.0"
-SLOT="0"
-IUSE="+ipv6 +icu libressl nls perl python +ssl sasl tcl test +zlib"
-
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} icu )"
-
-RDEPEND="
-	icu? ( dev-libs/icu:= )
-	nls? ( dev-libs/boost:=[nls] )
-	perl? ( >=dev-lang/perl-5.10:= )
-	python? ( ${PYTHON_DEPS} )
-	sasl? ( >=dev-libs/cyrus-sasl-2 )
-	ssl? (
-		!libressl? ( dev-libs/openssl:0= )
-		libressl? ( dev-libs/libressl:0= )
-	)
-	tcl? ( dev-lang/tcl:0= )
-	zlib? ( sys-libs/zlib:0= )
-"
-DEPEND="
-	${RDEPEND}
-	virtual/pkgconfig
-	nls? ( sys-devel/gettext )
-	perl? ( >=dev-lang/swig-3.0.0 )
-	python? ( >=dev-lang/swig-3.0.0 )
-	test? ( dev-qt/qtnetwork:5 )
-"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-1.7.0-inttest-fix-make-warning.patch
-	"${FILESDIR}"/${PN}-1.7.0-inttest-dir.patch
-)
-
-pkg_setup() {
-	if use python; then
-		python-single-r1_pkg_setup
-	fi
-
-	enewgroup ${PN}
-	enewuser ${PN} -1 -1 /var/lib/${PN} ${PN}
-	# The home directory was previously set to /dev/null
-	# This caused a bug with the systemd unit
-	# https://bugs.gentoo.org/521916
-	esethome ${PN} /var/lib/${PN}
-}
-
-src_prepare() {
-	# Let SWIG rebuild modperl/modpython to make user patching easier.
-	if [[ ${PV} != *9999* ]]; then
-		rm modules/modperl/generated.tar.gz || die
-		rm modules/modpython/generated.tar.gz || die
-	fi
-
-	sed -i -e "s|DZNC_BIN_DIR:path=|DZNC_BIN_DIR:path=${T}/inttest|" \
-		test/CMakeLists.txt || die
-
-	cmake-utils_src_prepare
-}
-
-src_configure() {
-	local mycmakeargs=(
-		-DWANT_SYSTEMD=yes  # Causes -DSYSTEMD_DIR to be used.
-		-DSYSTEMD_DIR="$(systemd_get_systemunitdir)"
-		-DWANT_ICU="$(usex icu)"
-		-DWANT_IPV6="$(usex ipv6)"
-		-DWANT_I18N="$(usex nls)"
-		-DWANT_PERL="$(usex perl)"
-		-DWANT_PYTHON="$(usex python)"
-		-DWANT_CYRUS="$(usex sasl)"
-		-DWANT_OPENSSL="$(usex ssl)"
-		-DWANT_TCL="$(usex tcl)"
-		-DWANT_ZLIB="$(usex zlib)"
-	)
-
-	if [[ ${PV} != *9999* ]] && use test; then
-		export GTEST_ROOT="${WORKDIR}/googletest-${GTEST_VER}/googletest"
-		export GMOCK_ROOT="${WORKDIR}/googletest-${GTEST_VER}/googlemock"
-	fi
-
-	cmake-utils_src_configure
-}
-
-src_test() {
-	cmake-utils_src_make unittest
-	if has network-sandbox ${FEATURES}; then
-		cmake-utils_src_make install DESTDIR="${T}/inttest"
-		local filter='-'
-		if ! use perl; then
-			filter="${filter}:ZNCTest.Modperl*"
-		fi
-		if ! use python; then
-			filter="${filter}:ZNCTest.Modpython*"
-		fi
-		# CMAKE_PREFIX_PATH and CXXFLAGS are needed for znc-buildmod
-		# invocations from inside the test
-		GTEST_FILTER="${filter}" ZNC_UNUSUAL_ROOT="${T}/inttest" \
-			CMAKE_PREFIX_PATH="${T}/inttest/usr/share/znc/cmake" \
-			CXXFLAGS="${CXXFLAGS} -isystem ${T}/inttest/usr/include" \
-			cmake-utils_src_make inttest
-	else
-		# TODO: don't require sandbox after
-		# https://github.com/znc/znc/pull/1363 is implemented
-		ewarn "FEATURES=-network-sandbox; skipping integration tests which"
-		ewarn "temporary open local ports."
-	fi
-}
-
-src_install() {
-	cmake-utils_src_install
-
-	dodoc NOTICE
-	newinitd "${FILESDIR}"/znc.initd-r2 znc
-	newconfd "${FILESDIR}"/znc.confd-r1 znc
-
-	DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r1") || die
-	DISABLE_AUTOFORMATTING=1
-	readme.gentoo_create_doc
-}
-
-pkg_postinst() {
-	if [[ -z "${REPLACING_VERSIONS}" ]]; then
-		# This is a new installation
-		readme.gentoo_print_elog
-	fi
-
-	if [[ -d "${EROOT%/}"/etc/znc ]]; then
-		ewarn "${EROOT%/}/etc/znc exists on your system."
-		ewarn "Due to the nature of the contents of that folder,"
-		ewarn "we have changed the default configuration to use"
-		ewarn "	${EROOT%/}/var/lib/znc"
-		ewarn "please move ${EROOT%/}/etc/znc to ${EROOT%/}/var/lib/znc"
-		ewarn "or adjust your service configuration."
-	fi
-}
-
-pkg_config() {
-	if [[ -e "${EROOT%/}/var/lib/znc" ]]; then
-		ewarn "${EROOT%/}/var/lib/znc already exists, aborting to avoid damaging"
-		ewarn "any existing configuration. If you are sure you want"
-		ewarn "to generate a new configuration, remove the folder"
-		ewarn "and try again."
-	else
-		einfo "Press enter to interactively create a new configuration file for znc."
-		einfo "To abort, press Control-C"
-		read
-		mkdir -p "${EROOT%/}/var/lib/znc" || die
-		chown -R ${PN}:${PN} "${EROOT%/}/var/lib/znc" ||
-			die "Setting permissions failed"
-		start-stop-daemon --start --user ${PN}:${PN} --env ZNC_NO_LAUNCH_AFTER_MAKECONF=1 \
-			"${EROOT%/}"/usr/bin/znc -- --makeconf --datadir "${EROOT%/}/var/lib/znc" ||
-			die "Config failed"
-		einfo
-		einfo "You can now start the znc service using the init system of your choice."
-		einfo "Don't forget to enable it if you want to use znc at boot."
-	fi
-}


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

* [gentoo-commits] repo/gentoo:master commit in: net-irc/znc/, net-irc/znc/files/
@ 2018-07-16  7:07 Louis Sautier
  0 siblings, 0 replies; 11+ messages in thread
From: Louis Sautier @ 2018-07-16  7:07 UTC (permalink / raw
  To: gentoo-commits

commit:     e3b663adafd6756f5fd136e71e078fe31083eac8
Author:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 16 07:02:08 2018 +0000
Commit:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
CommitDate: Mon Jul 16 07:03:45 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e3b663ad

net-irc/znc: remove the last vulnerable version

Bug: https://bugs.gentoo.org/661228
Package-Manager: Portage-2.3.42, Repoman-2.3.9

 net-irc/znc/Manifest                               |   2 -
 net-irc/znc/files/README.gentoo                    |  22 ---
 .../znc-1.6.1-create-pidfile-per-default.patch     |  23 ---
 net-irc/znc/files/znc-1.6.1-systemwideconfig.patch | 215 ---------------------
 net-irc/znc/files/znc.initd-r1                     |  39 ----
 net-irc/znc/metadata.xml                           |   1 -
 net-irc/znc/znc-1.6.6.ebuild                       | 129 -------------
 7 files changed, 431 deletions(-)

diff --git a/net-irc/znc/Manifest b/net-irc/znc/Manifest
index eedc2aef66e..62133c7bbce 100644
--- a/net-irc/znc/Manifest
+++ b/net-irc/znc/Manifest
@@ -1,4 +1,2 @@
-DIST googletest-release-1.7.0.tar.gz 468653 BLAKE2B 8dfca8b79dcd7b64ce84bad11ee68c549f4fe3dff7638ed1d845af4a7f754ad5df782d2cbebdb9fecfda2499dae6585e07cda7a8c8c454f0b70723d5c9578aa4 SHA512 c623d5720c4ed574e95158529872815ecff478c03bdcee8b79c9b042a603533f93fe55f939bcfe2cd745ce340fd626ad6d9a95981596f1a4d05053d874cd1dfc
 DIST gtest-ba96d0b1161f540656efdaed035b3c062b60e006.tar.gz 987370 BLAKE2B fcedfe559c4c93166962900117dc492da3cbb99165c30766c39131c20e3b41f057a31a8cb631beaca829c1e9966e90cbc37469ba56a5fc15a2bea86cbe401a63 SHA512 ce78098f973b45f4a177db387c42a56d5ea34407a2af278760b850c326e8450760a58991d62a5408f5df79f89fefd10fee71745b7e8669b2a6f74fa63a259600
-DIST znc-1.6.6.tar.gz 1471612 BLAKE2B 8bd977a95417c4259e9f38759d838f55a146f376dc8bb6230ab6e1b698fb7c9e060cbc237efd4e836961314abab56cc02e7c6bc74e40bad17abaf06e47fbb516 SHA512 cc5bc7328bfe36525ab215b4b53c7cd20aa02b41e7bb28507ff9d9632560f4c30396804e4b828bca0ece19f42813e3fce59d1bae639ea5fc149059f6979e63e7
 DIST znc-1.7.1-rc1.tar.gz 2041320 BLAKE2B 62669b598d7423cb55fad458fe6172be36904e8599dcde757936883093f24deb6a5ed6a093e3e92854810f02e96372f44139f9807e70e0cf007de90a1373c6a8 SHA512 b4e223c86c75bc97620c52333d90d6458a02777dce9c629f8a095f8134a06992a60978b2fe8bbce29ed1155932f9f37e0a324a498ee16527b0235e4306c34973

diff --git a/net-irc/znc/files/README.gentoo b/net-irc/znc/files/README.gentoo
deleted file mode 100644
index 5b222a24f58..00000000000
--- a/net-irc/znc/files/README.gentoo
+++ /dev/null
@@ -1,22 +0,0 @@
-To run znc as a user, run 'znc --makeconf' to create a configuration file.
-
-If znc was compiled with the 'daemon' use flag, you may run
-    emerge --config znc
-to configure it.
-
-To generate a new SSL certificate, run:
-    znc --system-wide-config-as znc --makepem -d /var/lib/znc
-as root.
-
-If migrating from a user-based install, you can copy the existing
-configuration files:
-     mkdir /var/lib/znc
-     mv /home/$USER/.znc/* /var/lib/znc
-     rm -rf /home/$USER/.znc
-     chown -R znc:znc /var/lib/znc
-You may also adjust the location of the files and the user running znc
-in /etc/conf.d/znc instead.
-
-To run as a daemon, please make sure that your configuration contains
-    PidFile = /run/znc/znc.pid
-or that the PidFile value matches the one in /etc/conf.d/znc.

diff --git a/net-irc/znc/files/znc-1.6.1-create-pidfile-per-default.patch b/net-irc/znc/files/znc-1.6.1-create-pidfile-per-default.patch
deleted file mode 100644
index 8419e9344bf..00000000000
--- a/net-irc/znc/files/znc-1.6.1-create-pidfile-per-default.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Add PidFile option to new configurations per default
-
-Our runscript requires that ZNC creates a pidfile. This patch will add
-the PidFile directive to ZNC's default configuration.
----
- src/znc.cpp | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/znc.cpp b/src/znc.cpp
-index b33e860..4a02568 100644
---- a/src/znc.cpp
-+++ b/src/znc.cpp
-@@ -575,6 +575,7 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) {
- 	VCString vsLines;
- 
- 	vsLines.push_back(MakeConfigHeader());
-+	vsLines.push_back("PidFile = /run/znc/znc.pid");
- 	vsLines.push_back("Version = " + CString(VERSION_STR));
- 
- 	m_sConfigFile = ExpandConfigPath(sConfigFile);
--- 
-2.5.0
-

diff --git a/net-irc/znc/files/znc-1.6.1-systemwideconfig.patch b/net-irc/znc/files/znc-1.6.1-systemwideconfig.patch
deleted file mode 100644
index d28fa30c219..00000000000
--- a/net-irc/znc/files/znc-1.6.1-systemwideconfig.patch
+++ /dev/null
@@ -1,215 +0,0 @@
-Add system-wide daemon support.
-
-This patch adds system-wide daemon support to ZNC so that you can run
-one ZNC instance system-wide using the new "--system-wide-config-as"
-option.
-
-Patch is based on @mrueg version from 2012.
-
-X-Gentoo-Bug: 438430
-X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=438430
----
- include/znc/znc.h |  3 ++
- src/main.cpp      | 83 ++++++++++++++++++++++++++++++++++++++++---------------
- src/znc.cpp       |  7 ++++-
- 3 files changed, 70 insertions(+), 23 deletions(-)
-
-diff --git a/include/znc/znc.h b/include/znc/znc.h
-index cf2326e..16394f9 100644
---- a/include/znc/znc.h
-+++ b/include/znc/znc.h
-@@ -187,6 +187,8 @@ public:
- 
- 	static void DumpConfig(const CConfig* Config);
- 
-+	void SetSystemWideConfig(bool systemWideConfig);
-+
- private:
- 	CFile* InitPidFile();
- 	bool DoRehash(CString& sError);
-@@ -231,6 +233,7 @@ protected:
- 	unsigned int           m_uiConnectPaused;
- 	TCacheMap<CString>     m_sConnectThrottle;
- 	bool                   m_bProtectWebSessions;
-+	bool                   m_bSystemWideConfig;
- 	bool                   m_bHideVersion;
- };
- 
-diff --git a/src/main.cpp b/src/main.cpp
-index 09b2c9c..bd5cca6 100644
---- a/src/main.cpp
-+++ b/src/main.cpp
-@@ -16,6 +16,9 @@
- 
- #include <znc/znc.h>
- #include <signal.h>
-+#include <sys/types.h>
-+#include <pwd.h>
-+#include <grp.h>
- 
- #if defined(HAVE_LIBSSL) && defined(HAVE_PTHREAD)
- #include <znc/Threads.h>
-@@ -99,34 +102,36 @@ static inline int getopt_long(int argc, char * const argv[], const char *optstri
- #endif
- 
- static const struct option g_LongOpts[] = {
--	{ "help",        no_argument,       0, 'h' },
--	{ "version",     no_argument,       0, 'v' },
--	{ "debug",       no_argument,       0, 'D' },
--	{ "foreground",  no_argument,       0, 'f' },
--	{ "no-color",    no_argument,       0, 'n' },
--	{ "allow-root",  no_argument,       0, 'r' },
--	{ "makeconf",    no_argument,       0, 'c' },
--	{ "makepass",    no_argument,       0, 's' },
--	{ "makepem",     no_argument,       0, 'p' },
--	{ "datadir",     required_argument, 0, 'd' },
-+	{ "help",                  no_argument,       0, 'h' },
-+	{ "version",               no_argument,       0, 'v' },
-+	{ "debug",                 no_argument,       0, 'D' },
-+	{ "foreground",            no_argument,       0, 'f' },
-+	{ "no-color",              no_argument,       0, 'n' },
-+	{ "allow-root",            no_argument,       0, 'r' },
-+	{ "makeconf",              no_argument,       0, 'c' },
-+	{ "makepass",              no_argument,       0, 's' },
-+	{ "makepem",               no_argument,       0, 'p' },
-+	{ "datadir",               required_argument, 0, 'd' },
-+	{ "system-wide-config-as", required_argument, 0, 'S' },
- 	{ 0, 0, 0, 0 }
- };
- 
- static void GenerateHelp(const char *appname) {
- 	CUtils::PrintMessage("USAGE: " + CString(appname) + " [options]");
- 	CUtils::PrintMessage("Options are:");
--	CUtils::PrintMessage("\t-h, --help         List available command line options (this page)");
--	CUtils::PrintMessage("\t-v, --version      Output version information and exit");
--	CUtils::PrintMessage("\t-f, --foreground   Don't fork into the background");
--	CUtils::PrintMessage("\t-D, --debug        Output debugging information (Implies -f)");
--	CUtils::PrintMessage("\t-n, --no-color     Don't use escape sequences in the output");
--	CUtils::PrintMessage("\t-r, --allow-root   Don't complain if ZNC is run as root");
--	CUtils::PrintMessage("\t-c, --makeconf     Interactively create a new config");
--	CUtils::PrintMessage("\t-s, --makepass     Generates a password for use in config");
-+	CUtils::PrintMessage("\t-h, --help                    List available command line options (this page)");
-+	CUtils::PrintMessage("\t-v, --version                 Output version information and exit");
-+	CUtils::PrintMessage("\t-f, --foreground              Don't fork into the background");
-+	CUtils::PrintMessage("\t-D, --debug                   Output debugging information (Implies -f)");
-+	CUtils::PrintMessage("\t-n, --no-color                Don't use escape sequences in the output");
-+	CUtils::PrintMessage("\t-r, --allow-root              Don't complain if ZNC is run as root");
-+	CUtils::PrintMessage("\t-c, --makeconf                Interactively create a new config");
-+	CUtils::PrintMessage("\t-s, --makepass                Generates a password for use in config");
- #ifdef HAVE_LIBSSL
--	CUtils::PrintMessage("\t-p, --makepem      Generates a pemfile for use with SSL");
-+	CUtils::PrintMessage("\t-p, --makepem                 Generates a pemfile for use with SSL");
- #endif /* HAVE_LIBSSL */
--	CUtils::PrintMessage("\t-d, --datadir      Set a different ZNC repository (default is ~/.znc)");
-+	CUtils::PrintMessage("\t-d, --datadir                 Set a different ZNC repository (default is ~/.znc)");
-+	CUtils::PrintMessage("\t-S, --system-wide-config-as   Create a system-wide ZNC daemon configuration");
- }
- 
- static void die(int sig) {
-@@ -192,6 +197,8 @@ int main(int argc, char** argv) {
- 	bool bMakeConf = false;
- 	bool bMakePass = false;
- 	bool bAllowRoot = false;
-+	bool bSystemWideConfig = false;
-+	CString sSystemWideConfigUser = "znc";
- 	bool bForeground = false;
- #ifdef ALWAYS_RUN_IN_FOREGROUND
- 	bForeground = true;
-@@ -201,7 +208,7 @@ int main(int argc, char** argv) {
- #endif
- 	CZNC::CreateInstance();
- 
--	while ((iArg = getopt_long(argc, argv, "hvnrcspd:Df", g_LongOpts, &iOptIndex)) != -1) {
-+	while ((iArg = getopt_long(argc, argv, "hvnrcspd:DfS:", g_LongOpts, &iOptIndex)) != -1) {
- 		switch (iArg) {
- 		case 'h':
- 			GenerateHelp(argv[0]);
-@@ -219,6 +226,10 @@ int main(int argc, char** argv) {
- 		case 'c':
- 			bMakeConf = true;
- 			break;
-+		case 'S':
-+			bSystemWideConfig = true;
-+			sSystemWideConfigUser = optarg;
-+			break;
- 		case 's':
- 			bMakePass = true;
- 			break;
-@@ -254,8 +265,36 @@ int main(int argc, char** argv) {
- 		return 1;
- 	}
- 
-+	if (bSystemWideConfig && getuid() == 0) {
-+		struct passwd *pwd;
-+
-+		pwd = getpwnam(sSystemWideConfigUser.c_str());
-+		if (pwd == NULL) {
-+			CUtils::PrintError("Daemon user not found.");
-+			return 1;
-+		}
-+
-+		if ((long) pwd->pw_uid == 0) {
-+			CUtils::PrintError("Please define a daemon user other than root.");
-+			return 1;
-+		}
-+		if (setgroups(0, NULL) != 0) {
-+			CUtils::PrintError("setgroups: Unable to clear supplementary group IDs");
-+			return 1;
-+		}
-+		if (setgid((long) pwd->pw_gid) != 0) {
-+			CUtils::PrintError("setgid: Unable to drop group privileges");
-+			return 1;
-+		}
-+		if (setuid((long) pwd->pw_uid) != 0) {
-+			CUtils::PrintError("setuid: Unable to drop user privileges");
-+			return 1;
-+		}
-+	}
-+
- 	CZNC* pZNC = &CZNC::Get();
- 	pZNC->InitDirs(((argc) ? argv[0] : ""), sDataDir);
-+	pZNC->SetSystemWideConfig(bSystemWideConfig);
- 
- #ifdef HAVE_LIBSSL
- 	if (bMakePem) {
-@@ -304,7 +343,7 @@ int main(int argc, char** argv) {
- 		CUtils::PrintStatus(true, "");
- 	}
- 
--	if (isRoot()) {
-+	if (isRoot() && !bSystemWideConfig) {
- 		CUtils::PrintError("You are running ZNC as root! Don't do that! There are not many valid");
- 		CUtils::PrintError("reasons for this and it can, in theory, cause great damage!");
- 		if (!bAllowRoot) {
-diff --git a/src/znc.cpp b/src/znc.cpp
-index 78cda1a..b33e860 100644
---- a/src/znc.cpp
-+++ b/src/znc.cpp
-@@ -55,6 +55,7 @@ CZNC::CZNC() {
- 	m_sConnectThrottle.SetTTL(30000);
- 	m_pLockFile = NULL;
- 	m_bProtectWebSessions = true;
-+	m_bSystemWideConfig = false;
- 	m_bHideVersion = false;
- 	m_uDisabledSSLProtocols = Csock::EDP_SSL;
- 	m_sSSLProtocols = "";
-@@ -861,7 +862,7 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) {
- 	CUtils::PrintMessage("");
- 
- 	File.UnLock();
--	return bFileOpen && CUtils::GetBoolInput("Launch ZNC now?", true);
-+	return bFileOpen && !m_bSystemWideConfig && CUtils::GetBoolInput("Launch ZNC now?", true);
- }
- 
- void CZNC::BackupConfigOnce(const CString& sSuffix) {
-@@ -1973,3 +1974,7 @@ void CZNC::LeakConnectQueueTimer(CConnectQueueTimer *pTimer) {
- bool CZNC::WaitForChildLock() {
- 	return m_pLockFile && m_pLockFile->ExLock();
- }
-+
-+void CZNC::SetSystemWideConfig(bool systemWideConfig) {
-+	m_bSystemWideConfig = systemWideConfig;
-+}
--- 
-2.5.0
-

diff --git a/net-irc/znc/files/znc.initd-r1 b/net-irc/znc/files/znc.initd-r1
deleted file mode 100644
index dedb44b1362..00000000000
--- a/net-irc/znc/files/znc.initd-r1
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-extra_commands="config"
-extra_started_commands="reload save"
-command="/usr/bin/znc"
-command_args="--datadir \"${ZNC_DATADIR}\""
-pidfile="${ZNC_PIDFILE:-/run/znc/znc.pid}"
-user=${ZNC_USER:-znc}
-group=${ZNC_GROUP:-znc}
-start_stop_daemon_args="--chdir \"${ZNC_DATADIR}\" --user ${user} --group ${group} ${ZNC_SSDARGS}"
-retry="${ZNC_TERMTIMEOUT}"
-
-required_dirs="${ZNC_DATADIR}"
-
-depend() {
-	use dns logger
-}
-
-start_pre() {
-	checkpath -d -m 0770 -o ${user}:${group} "$(dirname ${pidfile})"
-}
-
-stop_post() {
-	rm -f "${pidfile}"
-}
-
-reload() {
-	ebegin "Reloading ZNC Configuration File from Disk"
-	start-stop-daemon --signal SIGHUP --pidfile "${pidfile}"
-	eend $?
-}
-
-save() {
-	ebegin "Saving ZNC Configuration File to Disk"
-	start-stop-daemon --signal SIGUSR1 --pidfile "${pidfile}"
-	eend $?
-}

diff --git a/net-irc/znc/metadata.xml b/net-irc/znc/metadata.xml
index 16293e77692..b58dd845044 100644
--- a/net-irc/znc/metadata.xml
+++ b/net-irc/znc/metadata.xml
@@ -6,7 +6,6 @@
 		<name>Louis Sautier</name>
 	</maintainer>
 	<use>
-		<flag name="daemon">Allow znc to run as a system-wide service. Installs an init script and creates a znc user:group.</flag>
 		<flag name="zlib">Enable mod_deflate-like gzip support for znc's web interface using <pkg>sys-libs/zlib</pkg>.</flag>
 	</use>
 	<upstream>

diff --git a/net-irc/znc/znc-1.6.6.ebuild b/net-irc/znc/znc-1.6.6.ebuild
deleted file mode 100644
index 76b253fef23..00000000000
--- a/net-irc/znc/znc-1.6.6.ebuild
+++ /dev/null
@@ -1,129 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-PYTHON_COMPAT=( python3_{4,5,6} )
-inherit eutils python-single-r1 readme.gentoo-r1 systemd user
-
-MY_PV=${PV/_/-}
-GTEST_VER="1.7.0"
-GTEST_URL="https://github.com/google/googletest/archive/release-${GTEST_VER}.tar.gz -> googletest-release-${GTEST_VER}.tar.gz"
-
-DESCRIPTION="An advanced IRC Bouncer"
-HOMEPAGE="https://znc.in"
-SRC_URI="
-	http://znc.in/releases/archive/${PN}-${MY_PV}.tar.gz
-	test? ( ${GTEST_URL} )
-"
-
-LICENSE="Apache-2.0"
-SLOT="0"
-KEYWORDS="amd64 arm x86"
-IUSE="daemon debug +ipv6 +icu libressl perl python +ssl sasl tcl test +zlib"
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-RDEPEND="
-	icu? ( dev-libs/icu:= )
-	perl? ( >=dev-lang/perl-5.10:= )
-	python? ( ${PYTHON_DEPS} )
-	sasl? ( >=dev-libs/cyrus-sasl-2 )
-	ssl? (
-		!libressl? ( dev-libs/openssl:0= )
-		libressl? ( dev-libs/libressl:0= )
-	)
-	tcl? ( dev-lang/tcl:0= )
-	zlib? ( sys-libs/zlib )
-"
-DEPEND="
-	${RDEPEND}
-	virtual/pkgconfig
-"
-
-S=${WORKDIR}/${PN}-${MY_PV}
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-1.6.1-systemwideconfig.patch
-	"${FILESDIR}"/${PN}-1.6.1-create-pidfile-per-default.patch
-)
-
-pkg_setup() {
-	if use python; then
-		python-single-r1_pkg_setup
-	fi
-	if use daemon; then
-		enewgroup ${PN}
-		enewuser ${PN} -1 -1 /var/lib/${PN} ${PN}
-		# The home directory was previously set to /dev/null
-		# This caused a bug with the systemd unit
-		# https://bugs.gentoo.org/521916
-		esethome ${PN} /var/lib/${PN}
-	fi
-}
-
-src_configure() {
-	econf \
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
-		$(use_enable debug) \
-		$(use_enable icu charset) \
-		$(use_enable ipv6) \
-		$(use_enable perl) \
-		$(use_enable python) \
-		$(use_enable sasl cyrus) \
-		$(use_enable ssl openssl) \
-		$(use_enable tcl) \
-		$(use_enable zlib) \
-		$(use_with test gtest "${WORKDIR}/googletest-release-${GTEST_VER}")
-}
-
-src_install() {
-	default
-	dodoc NOTICE
-	if use daemon; then
-		newinitd "${FILESDIR}"/znc.initd-r1 znc
-		newconfd "${FILESDIR}"/znc.confd-r1 znc
-	fi
-	DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo") || die
-	DISABLE_AUTOFORMATTING=1
-	readme.gentoo_create_doc
-}
-
-pkg_postinst() {
-	readme.gentoo_print_elog
-	if [[ -d "${EROOT%/}"/etc/znc ]]; then
-		ewarn "/etc/znc exists on your system."
-		ewarn "Due to the nature of the contents of that folder,"
-		ewarn "we have changed the default configuration to use"
-		ewarn "	/var/lib/znc"
-		ewarn "please move /etc/znc to /var/lib/znc"
-		ewarn "or adjust /etc/conf.d/znc"
-	fi
-}
-
-pkg_config() {
-	if use daemon; then
-		if [[ -e "${EROOT%/}/var/lib/znc" ]]; then
-			ewarn "${EROOT%/}/var/lib/znc already exists, aborting to avoid damaging"
-			ewarn "any existing configuration. If you are sure you want"
-			ewarn "to generate a new configuration, remove the folder"
-			ewarn "and try again."
-		else
-			einfo "Press any key to interactively create a new configuration file"
-			einfo "for znc."
-			einfo "To abort, press Control-C"
-			read
-			mkdir -p "${EROOT%/}/var/lib/znc" || die
-			chown -R ${PN}:${PN} "${EROOT%/}/var/lib/znc" ||
-				die "Setting permissions failed"
-			"${EROOT%/}"/usr/bin/znc --system-wide-config-as ${PN} -c -r -d "${EROOT%/}/var/lib/znc" ||
-				die "Config failed"
-			echo
-			einfo "To start znc, run '/etc/init.d/znc start'"
-			einfo "or add znc to a runlevel:"
-			einfo "  rc-update add znc default"
-		fi
-	else
-		ewarn "To configure znc as a system-wide daemon you have to"
-		ewarn "enable the 'daemon' use flag."
-	fi
-}


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

* [gentoo-commits] repo/gentoo:master commit in: net-irc/znc/, net-irc/znc/files/
@ 2021-08-24 19:26 Louis Sautier
  0 siblings, 0 replies; 11+ messages in thread
From: Louis Sautier @ 2021-08-24 19:26 UTC (permalink / raw
  To: gentoo-commits

commit:     f302ee221545dd442429c19dd3a21545df86be63
Author:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 22 22:36:36 2021 +0000
Commit:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
CommitDate: Tue Aug 24 19:23:39 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f302ee22

net-irc/znc: fix data location on systemd, #743856, enable py3.10

Also:
* Backport a patch to replace freenode with libera.
* Adjust README.
* Remove an 8-year-old ewarn.
* Respect PYTHON_SINGLE_TARGET when building modpython.
* Fix pkg_postinst to work on systemd.
* Remove/fix some checks in pkg_postinst that became broken/unnecessary
  with the swith to acct-user.
* Improve README.gentoo slightly.

Closes: https://bugs.gentoo.org/743856
Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org>

 net-irc/znc/files/README.gentoo-r1                 |   6 +-
 net-irc/znc/files/znc-1.8.2-add-libera.patch       |  55 ++++++
 net-irc/znc/files/znc-1.8.2-fix-python-3.10.patch  |  31 ++++
 .../znc/files/znc-1.8.2-fix-systemd-datadir.patch  |  23 +++
 net-irc/znc/znc-1.8.2-r1.ebuild                    | 194 +++++++++++++++++++++
 5 files changed, 306 insertions(+), 3 deletions(-)

diff --git a/net-irc/znc/files/README.gentoo-r1 b/net-irc/znc/files/README.gentoo-r1
index ca41e4dac26..1812383beb2 100644
--- a/net-irc/znc/files/README.gentoo-r1
+++ b/net-irc/znc/files/README.gentoo-r1
@@ -5,11 +5,11 @@ To configure the system-wide daemon, you may run 'emerge --config znc'.
 If migrating from a user-based install, you can copy the existing
 configuration files:
 
-  # mkdir /var/lib/znc
   # mv /home/$USER/.znc/* /var/lib/znc
   # rm -rf /home/$USER/.znc
   # chown -R znc:znc /var/lib/znc
 
 OpenRC users may also adjust the location of the files and the user running
-znc in /etc/conf.d/znc instead. Systemd users may have to overwrite the
-existing unit file.
+znc in /etc/conf.d/znc instead.
+The same thing can be achieved for systemd by overriding the existing
+unit file (systemctl edit znc.service).

diff --git a/net-irc/znc/files/znc-1.8.2-add-libera.patch b/net-irc/znc/files/znc-1.8.2-add-libera.patch
new file mode 100644
index 00000000000..e7015754d8c
--- /dev/null
+++ b/net-irc/znc/files/znc-1.8.2-add-libera.patch
@@ -0,0 +1,55 @@
+From 15e2351d40763acee5d246df7c725c3bd259c304 Mon Sep 17 00:00:00 2001
+From: Alexey Sokolov <alexey+znc@asokolov.org>
+Date: Wed, 26 May 2021 10:10:20 +0100
+Subject: [PATCH] Switch --makeconf wizard from freenode to libera
+
+---
+ src/znc.cpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/znc.cpp b/src/znc.cpp
+index c5ad17dc69..365367545a 100644
+--- a/src/znc.cpp
++++ b/src/znc.cpp
+@@ -778,7 +778,7 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) {
+         CUtils::PrintMessage("");
+ 
+         do {
+-            CUtils::GetInput("Name", sNetwork, "freenode");
++            CUtils::GetInput("Name", sNetwork, "libera");
+         } while (!CIRCNetwork::IsValidNetwork(sNetwork));
+ 
+         vsLines.push_back("\t<Network " + sNetwork + ">");
+@@ -795,8 +795,8 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) {
+         bool bSSL = false;
+         unsigned int uServerPort = 0;
+ 
+-        if (sNetwork.Equals("freenode")) {
+-            sHost = "chat.freenode.net";
++        if (sNetwork.Equals("libera")) {
++            sHost = "irc.libera.chat";
+ #ifdef HAVE_LIBSSL
+             bSSL = true;
+ #endif
+From 688645413c258f1fe42a39e42e5b5d1dead03d71 Mon Sep 17 00:00:00 2001
+From: Alexey Sokolov <alexey+znc@asokolov.org>
+Date: Fri, 18 Jun 2021 21:20:53 +0100
+Subject: [PATCH] Fix integration test after switch to libera
+
+---
+ test/integration/framework/znctest.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test/integration/framework/znctest.cpp b/test/integration/framework/znctest.cpp
+index 195b6083a9..40dae85fc2 100644
+--- a/test/integration/framework/znctest.cpp
++++ b/test/integration/framework/znctest.cpp
+@@ -39,7 +39,7 @@ void WriteConfig(QString path) {
+     p.ReadUntil("Real name");               p.Write();
+     p.ReadUntil("Bind host");               p.Write();
+     p.ReadUntil("Set up a network?");       p.Write();
+-    p.ReadUntil("Name [freenode]");         p.Write("test");
++    p.ReadUntil("Name [libera]");           p.Write("test");
+     p.ReadUntil("Server host (host only)"); p.Write("127.0.0.1");
+     p.ReadUntil("Server uses SSL?");        p.Write();
+     p.ReadUntil("6667");                    p.Write();

diff --git a/net-irc/znc/files/znc-1.8.2-fix-python-3.10.patch b/net-irc/znc/files/znc-1.8.2-fix-python-3.10.patch
new file mode 100644
index 00000000000..fe40d190d1b
--- /dev/null
+++ b/net-irc/znc/files/znc-1.8.2-fix-python-3.10.patch
@@ -0,0 +1,31 @@
+From e8ff16123582eb9d5c321f5c7e652335abfba368 Mon Sep 17 00:00:00 2001
+From: Alexey Sokolov <alexey+znc@asokolov.org>
+Date: Sat, 23 May 2020 13:28:13 +0100
+Subject: [PATCH] Fix PY_SSIZE_T_CLEAN python warning
+
+---
+ .travis.yml           | 2 +-
+ modules/modpython.cpp | 3 ++-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/modules/modpython.cpp b/modules/modpython.cpp
+index dfe53b5b6b..7bc76fc5c1 100644
+--- a/modules/modpython.cpp
++++ b/modules/modpython.cpp
+@@ -14,6 +14,7 @@
+  * limitations under the License.
+  */
+ 
++#define PY_SSIZE_T_CLEAN
+ #include <Python.h>
+ 
+ #include <znc/Chan.h>
+@@ -455,7 +456,7 @@ CBSOCK(ConnectionRefused);
+ void CPySocket::ReadData(const char* data, size_t len) {
+     PyObject* pyRes =
+         PyObject_CallMethod(m_pyObj, const_cast<char*>("OnReadData"),
+-                            const_cast<char*>("y#"), data, (int)len);
++                            const_cast<char*>("y#"), data, (Py_ssize_t)len);
+     CHECKCLEARSOCK("OnReadData");
+ }
+ 

diff --git a/net-irc/znc/files/znc-1.8.2-fix-systemd-datadir.patch b/net-irc/znc/files/znc-1.8.2-fix-systemd-datadir.patch
new file mode 100644
index 00000000000..06dd6991b4a
--- /dev/null
+++ b/net-irc/znc/files/znc-1.8.2-fix-systemd-datadir.patch
@@ -0,0 +1,23 @@
+From d4bfd143b4b12f6e6695878cc1b5168cc31c362c Mon Sep 17 00:00:00 2001
+From: Alexey Sokolov <alexey+znc@asokolov.org>
+Date: Tue, 22 Sep 2020 10:20:47 +0100
+Subject: [PATCH] Fix path in systemd service (which shouldn't be here at all)
+
+https://bugs.gentoo.org/743856
+---
+ znc.service.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/znc.service.in b/znc.service.in
+index a6c9e68df..7accad906 100644
+--- a/znc.service.in
++++ b/znc.service.in
+@@ -3,7 +3,7 @@ Description=ZNC, an advanced IRC bouncer
+ After=network.target
+ 
+ [Service]
+-ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/znc -f
++ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/znc -f --datadir=/var/lib/znc
+ User=znc
+ 
+ [Install]

diff --git a/net-irc/znc/znc-1.8.2-r1.ebuild b/net-irc/znc/znc-1.8.2-r1.ebuild
new file mode 100644
index 00000000000..396026d8980
--- /dev/null
+++ b/net-irc/znc/znc-1.8.2-r1.ebuild
@@ -0,0 +1,194 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8..10} )
+
+inherit cmake python-single-r1 readme.gentoo-r1 systemd
+
+GTEST_VER="1.8.1"
+GTEST_URL="https://github.com/google/googletest/archive/${GTEST_VER}.tar.gz -> gtest-${GTEST_VER}.tar.gz"
+DESCRIPTION="An advanced IRC Bouncer"
+
+if [[ ${PV} == *9999* ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/znc/znc.git"
+else
+	MY_PV=${PV/_/-}
+	MY_P=${PN}-${MY_PV}
+	SRC_URI="
+		https://znc.in/releases/archive/${MY_P}.tar.gz
+		test? ( ${GTEST_URL} )
+	"
+	KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+	S=${WORKDIR}/${MY_P}
+fi
+
+HOMEPAGE="https://znc.in"
+LICENSE="Apache-2.0"
+# "If you upgrade your ZNC version, you must recompile all your modules."
+# - https://wiki.znc.in/Compiling_modules
+SLOT="0/${PV}"
+IUSE="+ipv6 +icu nls perl python +ssl sasl tcl test +zlib"
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} icu )"
+
+# perl is a build-time dependency of modpython
+BDEPEND="
+	virtual/pkgconfig
+	nls? ( sys-devel/gettext )
+	perl? (
+		>=dev-lang/swig-3.0.0
+		>=dev-lang/perl-5.10
+	)
+	python? (
+		>=dev-lang/swig-3.0.0
+		>=dev-lang/perl-5.10
+	)
+	test? (
+		${PYTHON_DEPS}
+		dev-qt/qtnetwork:5
+	)
+"
+DEPEND="
+	icu? ( dev-libs/icu:= )
+	nls? ( dev-libs/boost:=[nls] )
+	perl? ( >=dev-lang/perl-5.10:= )
+	python? ( ${PYTHON_DEPS} )
+	sasl? ( >=dev-libs/cyrus-sasl-2 )
+	ssl? ( dev-libs/openssl:0= )
+	tcl? ( dev-lang/tcl:0= )
+	zlib? ( sys-libs/zlib:0= )
+"
+RDEPEND="
+	${DEPEND}
+	acct-user/znc
+	acct-group/znc
+"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-1.7.1-inttest-dir.patch
+	# All these are backports
+	"${FILESDIR}"/${P}-fix-systemd-datadir.patch
+	"${FILESDIR}"/${P}-add-libera.patch
+	"${FILESDIR}"/${P}-fix-python-3.10.patch
+)
+
+pkg_setup() {
+	if use python; then
+		python-single-r1_pkg_setup
+	fi
+}
+
+src_prepare() {
+	# Let SWIG rebuild modperl/modpython to make user patching easier.
+	if [[ ${PV} != *9999* ]]; then
+		rm modules/modperl/generated.tar.gz || die
+		rm modules/modpython/generated.tar.gz || die
+	fi
+
+	sed -i -e "s|DZNC_BIN_DIR:path=|DZNC_BIN_DIR:path=${T}/inttest|" \
+		test/CMakeLists.txt || die
+
+	sed -i "s|--datadir=|&${EPREFIX}|" znc.service.in || die
+
+	cmake_src_prepare
+}
+
+src_configure() {
+	local mycmakeargs=(
+		-DWANT_SYSTEMD=yes  # Causes -DSYSTEMD_DIR to be used.
+		-DSYSTEMD_DIR="$(systemd_get_systemunitdir)"
+		-DWANT_ICU="$(usex icu)"
+		-DWANT_IPV6="$(usex ipv6)"
+		-DWANT_I18N="$(usex nls)"
+		-DWANT_PERL="$(usex perl)"
+		-DWANT_PYTHON="$(usex python)"
+		-DWANT_PYTHON_VERSION="${EPYTHON#python}"
+		-DWANT_CYRUS="$(usex sasl)"
+		-DWANT_OPENSSL="$(usex ssl)"
+		-DWANT_TCL="$(usex tcl)"
+		-DWANT_ZLIB="$(usex zlib)"
+	)
+
+	if [[ ${PV} != *9999* ]] && use test; then
+		export GTEST_ROOT="${WORKDIR}/googletest-release-${GTEST_VER}/googletest"
+		export GMOCK_ROOT="${WORKDIR}/googletest-release-${GTEST_VER}/googlemock"
+	fi
+
+	cmake_src_configure
+}
+
+src_test() {
+	cmake_build unittest
+	DESTDIR="${T}/inttest" cmake_build install
+	local filter='-'
+	if ! use perl; then
+		filter="${filter}:ZNCTest.Modperl*"
+	fi
+	if ! use python; then
+		filter="${filter}:ZNCTest.Modpython*"
+	fi
+	# CMAKE_PREFIX_PATH and CXXFLAGS are needed for znc-buildmod
+	# invocations from inside the test
+	GTEST_FILTER="${filter}" ZNC_UNUSUAL_ROOT="${T}/inttest" \
+		CMAKE_PREFIX_PATH="${T}/inttest/usr/share/znc/cmake" \
+		CXXFLAGS="${CXXFLAGS} -isystem ${T}/inttest/usr/include" \
+		cmake_build inttest
+}
+
+src_install() {
+	cmake_src_install
+
+	dodoc NOTICE
+	newinitd "${FILESDIR}"/znc.initd-r2 znc
+	newconfd "${FILESDIR}"/znc.confd-r1 znc
+
+	local DOC_CONTENTS
+	# "local" has its own return value which is not what we want to catch
+	DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r1") || die
+	local DISABLE_AUTOFORMATTING=1
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	if [[ -d "${EROOT}/var/lib/znc/.znc/" ]]; then
+		eerror "${EROOT}/var/lib/znc/.znc/ exists, please move your data to ${EROOT}/var/lib/znc/"
+		eerror ""
+		eerror "The systemd unit has changed and now expects data to be located"
+		eerror "at the root of ${EROOT}/var/lib/znc instead of its '.znc' subfolder."
+		eerror "The recommended procedure to move the data is the following:"
+		eerror "1. stop the service: systemctl stop znc.service"
+		eerror "2. move the data: cp -a '${EROOT}/var/lib/znc/.znc/.' '${EROOT}/var/lib/znc/'"
+		eerror "3. fix the config file: sed -i 's|${EROOT}/var/lib/znc/.znc|${EROOT}/var/lib/znc|g' '${EROOT}/var/lib/znc/configs/znc.conf'"
+		eerror "4. restart znc: systemctl start znc.service"
+		eerror "5. once everything works, remove the old data directory: rm -r '${EROOT}/var/lib/znc/.znc/'"
+		eerror "See https://bugs.gentoo.org/743856 for details."
+	fi
+
+	if [[ -z "${REPLACING_VERSIONS}" ]]; then
+		# This is a new installation
+		readme.gentoo_print_elog
+	fi
+}
+
+pkg_config() {
+	if [[ -d "${EROOT}/var/lib/znc/configs" ]]; then
+		ewarn "${EROOT}/var/lib/znc/configs/ already exists,"
+		ewarn "aborting to avoid damaging any existing configuration."
+		ewarn "If you are sure you want to generate a new configuration,"
+		ewarn "remove the folder and try again."
+	else
+		einfo "Press enter to interactively create a new configuration file for znc."
+		einfo "To abort, press Control-C"
+		read
+		su ${PN} -p -s /bin/sh -c 'ZNC_NO_LAUNCH_AFTER_MAKECONF=1 \
+			"${EROOT}"/usr/bin/znc --makeconf \
+			--datadir "${EROOT}/var/lib/znc"' || die "Config failed"
+		einfo
+		einfo "You can now start the znc service using the init system of your choice."
+		einfo "Don't forget to enable it if you want to use znc at boot."
+	fi
+}


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

* [gentoo-commits] repo/gentoo:master commit in: net-irc/znc/, net-irc/znc/files/
@ 2022-08-07 16:01 Louis Sautier
  0 siblings, 0 replies; 11+ messages in thread
From: Louis Sautier @ 2022-08-07 16:01 UTC (permalink / raw
  To: gentoo-commits

commit:     7dd0463d8d7d3a9b80c6a702e8ad561de31db674
Author:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
AuthorDate: Sun Aug  7 15:51:33 2022 +0000
Commit:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
CommitDate: Sun Aug  7 16:00:12 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7dd0463d

net-irc/znc: fix build with -Werror=odr, add py3.11, EAPI 8

Closes: https://bugs.gentoo.org/861470
Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org>

 .../znc/files/znc-1.8.2-fix-odr-violation.patch    |  56 ++++++
 net-irc/znc/znc-1.8.2-r2.ebuild                    | 195 +++++++++++++++++++++
 2 files changed, 251 insertions(+)

diff --git a/net-irc/znc/files/znc-1.8.2-fix-odr-violation.patch b/net-irc/znc/files/znc-1.8.2-fix-odr-violation.patch
new file mode 100644
index 000000000000..967d6e35c2ea
--- /dev/null
+++ b/net-irc/znc/files/znc-1.8.2-fix-odr-violation.patch
@@ -0,0 +1,56 @@
+From 3e45b2f35f194100ec3293c7f3e36f95f48b0cb8 Mon Sep 17 00:00:00 2001
+From: Uli Schlachter <psychon@znc.in>
+Date: Fri, 5 Aug 2022 16:12:40 +0200
+Subject: [PATCH] Fix an ODR violation
+
+Building with CFLAGS="-flto -Werror=odr -Werror=lto-type-mismatch
+-Werror=strict-aliasing" CXXFLAGS="-flto -Werror=odr
+-Werror=lto-type-mismatch -Werror=strict-aliasing" LDFLAGS=-flto fails
+due to a violation of the one definition rule. There are two different
+definitions of TOption that are both linked into the znc binary.
+
+Fix this by putting them into anonymous namespaces.
+
+Fixes: https://github.com/znc/znc/issues/1834
+Signed-off-by: Uli Schlachter <psychon@znc.in>
+---
+ src/IRCNetwork.cpp | 2 ++
+ src/User.cpp       | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/src/IRCNetwork.cpp b/src/IRCNetwork.cpp
+index 46a2481a49..99f9242907 100644
+--- a/src/IRCNetwork.cpp
++++ b/src/IRCNetwork.cpp
+@@ -363,11 +363,13 @@ CString CIRCNetwork::GetNetworkPath() const {
+     return sNetworkPath;
+ }
+ 
++namespace {
+ template <class T>
+ struct TOption {
+     const char* name;
+     void (CIRCNetwork::*pSetter)(T);
+ };
++}
+ 
+ bool CIRCNetwork::ParseConfig(CConfig* pConfig, CString& sError,
+                               bool bUpgrade) {
+diff --git a/src/User.cpp b/src/User.cpp
+index 2ab5fac66f..16624adbbe 100644
+--- a/src/User.cpp
++++ b/src/User.cpp
+@@ -135,11 +135,13 @@ CUser::~CUser() {
+     CZNC::Get().AddBytesWritten(m_uBytesWritten);
+ }
+ 
++namespace {
+ template <class T>
+ struct TOption {
+     const char* name;
+     void (CUser::*pSetter)(T);
+ };
++}
+ 
+ bool CUser::ParseConfig(CConfig* pConfig, CString& sError) {
+     TOption<const CString&> StringOptions[] = {

diff --git a/net-irc/znc/znc-1.8.2-r2.ebuild b/net-irc/znc/znc-1.8.2-r2.ebuild
new file mode 100644
index 000000000000..fab250986d5e
--- /dev/null
+++ b/net-irc/znc/znc-1.8.2-r2.ebuild
@@ -0,0 +1,195 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..11} )
+
+inherit cmake python-single-r1 readme.gentoo-r1 systemd
+
+GTEST_VER="1.8.1"
+GTEST_URL="https://github.com/google/googletest/archive/${GTEST_VER}.tar.gz -> gtest-${GTEST_VER}.tar.gz"
+DESCRIPTION="An advanced IRC Bouncer"
+
+if [[ ${PV} == *9999* ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/znc/znc.git"
+else
+	MY_PV=${PV/_/-}
+	MY_P=${PN}-${MY_PV}
+	SRC_URI="
+		https://znc.in/releases/archive/${MY_P}.tar.gz
+		test? ( ${GTEST_URL} )
+	"
+	KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86"
+	S=${WORKDIR}/${MY_P}
+fi
+
+HOMEPAGE="https://znc.in"
+LICENSE="Apache-2.0"
+# "If you upgrade your ZNC version, you must recompile all your modules."
+# - https://wiki.znc.in/Compiling_modules
+SLOT="0/${PV}"
+IUSE="+ipv6 +icu nls perl python +ssl sasl tcl test +zlib"
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} icu )"
+
+# perl is a build-time dependency of modpython
+BDEPEND="
+	virtual/pkgconfig
+	nls? ( sys-devel/gettext )
+	perl? (
+		>=dev-lang/swig-3.0.0
+		>=dev-lang/perl-5.10
+	)
+	python? (
+		>=dev-lang/swig-3.0.0
+		>=dev-lang/perl-5.10
+	)
+	test? (
+		${PYTHON_DEPS}
+		dev-qt/qtnetwork:5
+	)
+"
+DEPEND="
+	icu? ( dev-libs/icu:= )
+	nls? ( dev-libs/boost:=[nls] )
+	perl? ( >=dev-lang/perl-5.10:= )
+	python? ( ${PYTHON_DEPS} )
+	sasl? ( >=dev-libs/cyrus-sasl-2 )
+	ssl? ( dev-libs/openssl:0= )
+	tcl? ( dev-lang/tcl:0= )
+	zlib? ( sys-libs/zlib:0= )
+"
+RDEPEND="
+	${DEPEND}
+	acct-user/znc
+	acct-group/znc
+"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-1.7.1-inttest-dir.patch
+	# All these are backports
+	"${FILESDIR}"/${P}-fix-systemd-datadir.patch
+	"${FILESDIR}"/${P}-add-libera.patch
+	"${FILESDIR}"/${P}-fix-python-3.10.patch
+	"${FILESDIR}"/${P}-fix-odr-violation.patch
+)
+
+pkg_setup() {
+	if use python; then
+		python-single-r1_pkg_setup
+	fi
+}
+
+src_prepare() {
+	# Let SWIG rebuild modperl/modpython to make user patching easier.
+	if [[ ${PV} != *9999* ]]; then
+		rm modules/modperl/generated.tar.gz || die
+		rm modules/modpython/generated.tar.gz || die
+	fi
+
+	sed -i -e "s|DZNC_BIN_DIR:path=|DZNC_BIN_DIR:path=${T}/inttest|" \
+		test/CMakeLists.txt || die
+
+	sed -i "s|--datadir=|&${EPREFIX}|" znc.service.in || die
+
+	cmake_src_prepare
+}
+
+src_configure() {
+	local mycmakeargs=(
+		-DWANT_SYSTEMD=yes  # Causes -DSYSTEMD_DIR to be used.
+		-DSYSTEMD_DIR="$(systemd_get_systemunitdir)"
+		-DWANT_ICU="$(usex icu)"
+		-DWANT_IPV6="$(usex ipv6)"
+		-DWANT_I18N="$(usex nls)"
+		-DWANT_PERL="$(usex perl)"
+		-DWANT_PYTHON="$(usex python)"
+		-DWANT_PYTHON_VERSION="${EPYTHON#python}"
+		-DWANT_CYRUS="$(usex sasl)"
+		-DWANT_OPENSSL="$(usex ssl)"
+		-DWANT_TCL="$(usex tcl)"
+		-DWANT_ZLIB="$(usex zlib)"
+	)
+
+	if [[ ${PV} != *9999* ]] && use test; then
+		export GTEST_ROOT="${WORKDIR}/googletest-release-${GTEST_VER}/googletest"
+		export GMOCK_ROOT="${WORKDIR}/googletest-release-${GTEST_VER}/googlemock"
+	fi
+
+	cmake_src_configure
+}
+
+src_test() {
+	cmake_build unittest
+	DESTDIR="${T}/inttest" cmake_build install
+	local filter='-'
+	if ! use perl; then
+		filter="${filter}:ZNCTest.Modperl*"
+	fi
+	if ! use python; then
+		filter="${filter}:ZNCTest.Modpython*"
+	fi
+	# CMAKE_PREFIX_PATH and CXXFLAGS are needed for znc-buildmod
+	# invocations from inside the test
+	GTEST_FILTER="${filter}" ZNC_UNUSUAL_ROOT="${T}/inttest" \
+		CMAKE_PREFIX_PATH="${T}/inttest/usr/share/znc/cmake" \
+		CXXFLAGS="${CXXFLAGS} -isystem ${T}/inttest/usr/include" \
+		cmake_build inttest
+}
+
+src_install() {
+	cmake_src_install
+
+	dodoc NOTICE
+	newinitd "${FILESDIR}"/znc.initd-r2 znc
+	newconfd "${FILESDIR}"/znc.confd-r1 znc
+
+	local DOC_CONTENTS
+	# "local" has its own return value which is not what we want to catch
+	DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r1") || die
+	local DISABLE_AUTOFORMATTING=1
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	if [[ -d "${EROOT}/var/lib/znc/.znc/" ]]; then
+		eerror "${EROOT}/var/lib/znc/.znc/ exists, please move your data to ${EROOT}/var/lib/znc/"
+		eerror ""
+		eerror "The systemd unit has changed and now expects data to be located"
+		eerror "at the root of ${EROOT}/var/lib/znc instead of its '.znc' subfolder."
+		eerror "The recommended procedure to move the data is the following:"
+		eerror "1. stop the service: systemctl stop znc.service"
+		eerror "2. move the data: cp -a '${EROOT}/var/lib/znc/.znc/.' '${EROOT}/var/lib/znc/'"
+		eerror "3. fix the config file: sed -i 's|${EROOT}/var/lib/znc/.znc|${EROOT}/var/lib/znc|g' '${EROOT}/var/lib/znc/configs/znc.conf'"
+		eerror "4. restart znc: systemctl start znc.service"
+		eerror "5. once everything works, remove the old data directory: rm -r '${EROOT}/var/lib/znc/.znc/'"
+		eerror "See https://bugs.gentoo.org/743856 for details."
+	fi
+
+	if [[ -z "${REPLACING_VERSIONS}" ]]; then
+		# This is a new installation
+		readme.gentoo_print_elog
+	fi
+}
+
+pkg_config() {
+	if [[ -d "${EROOT}/var/lib/znc/configs" ]]; then
+		ewarn "${EROOT}/var/lib/znc/configs/ already exists,"
+		ewarn "aborting to avoid damaging any existing configuration."
+		ewarn "If you are sure you want to generate a new configuration,"
+		ewarn "remove the folder and try again."
+	else
+		einfo "Press enter to interactively create a new configuration file for znc."
+		einfo "To abort, press Control-C"
+		read
+		su ${PN} -p -s /bin/sh -c 'ZNC_NO_LAUNCH_AFTER_MAKECONF=1 \
+			"${EROOT}"/usr/bin/znc --makeconf \
+			--datadir "${EROOT}/var/lib/znc"' || die "Config failed"
+		einfo
+		einfo "You can now start the znc service using the init system of your choice."
+		einfo "Don't forget to enable it if you want to use znc at boot."
+	fi
+}


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

* [gentoo-commits] repo/gentoo:master commit in: net-irc/znc/, net-irc/znc/files/
@ 2022-11-05 18:43 Louis Sautier
  0 siblings, 0 replies; 11+ messages in thread
From: Louis Sautier @ 2022-11-05 18:43 UTC (permalink / raw
  To: gentoo-commits

commit:     9a5aad2bf2e54dab53a598fa151baaa8dd1b1f0c
Author:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
AuthorDate: Sat Nov  5 17:15:58 2022 +0000
Commit:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
CommitDate: Sat Nov  5 18:35:20 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9a5aad2b

net-irc/znc: fix build with SWIG 4.1.0 and USE=perl/python

Also always enable IPv6 as it doesn't require additional dependencies
(pkgcheck warned of "UseFlagWithoutDeps").

Closes: https://bugs.gentoo.org/878587
Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org>

 net-irc/znc/files/znc-1.8.2-fix-swig.patch | 43 ++++++++++++++++++++++++++++++
 net-irc/znc/znc-1.8.2-r2.ebuild            |  9 ++++---
 2 files changed, 48 insertions(+), 4 deletions(-)

diff --git a/net-irc/znc/files/znc-1.8.2-fix-swig.patch b/net-irc/znc/files/znc-1.8.2-fix-swig.patch
new file mode 100644
index 000000000000..d07d136c5940
--- /dev/null
+++ b/net-irc/znc/files/znc-1.8.2-fix-swig.patch
@@ -0,0 +1,43 @@
+From fecdd9895894b3afe903021b0843a422eb4d3308 Mon Sep 17 00:00:00 2001
+From: Alexey Sokolov <alexey+znc@asokolov.org>
+Date: Sat, 5 Nov 2022 12:54:40 +0000
+Subject: [PATCH] Add support SWIG 4.1.0, drop support for < 4.0.1
+
+https://bugs.gentoo.org/878587
+---
+ CMakeLists.txt                   | 2 +-
+ modules/modperl/CMakeLists.txt   | 1 -
+ modules/modpython/CMakeLists.txt | 1 -
+ 3 files changed, 1 insertion(+), 3 deletions(-)
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -173,7 +173,7 @@ if(WANT_PYTHON AND NOT EXISTS
+ 	endif()
+ endif()
+ if(search_swig)
+-	find_package(SWIG 3.0.0)
++	find_package(SWIG 4.0.1)
+ 	if(NOT SWIG_FOUND)
+ 		message(FATAL_ERROR
+ 			"Can't find SWIG, therefore Perl and Python aren't supported. "
+--- a/modules/modperl/CMakeLists.txt
++++ b/modules/modperl/CMakeLists.txt
+@@ -53,7 +53,6 @@ if(SWIG_FOUND)
+ 		"-I${PROJECT_SOURCE_DIR}/include"
+ 		"-I${CMAKE_CURRENT_SOURCE_DIR}/.."
+ 		"-I${CMAKE_CURRENT_SOURCE_DIR}/include"
+-		-DZNC_EXPORT_LIB_EXPORT
+ 		-outdir "${CMAKE_CURRENT_BINARY_DIR}"
+ 		-o "${CMAKE_CURRENT_BINARY_DIR}/modperl_biglib.cpp"
+ 		"${CMAKE_CURRENT_SOURCE_DIR}/modperl.i"
+--- a/modules/modpython/CMakeLists.txt
++++ b/modules/modpython/CMakeLists.txt
+@@ -50,7 +50,6 @@ if(SWIG_FOUND)
+ 		"-I${PROJECT_BINARY_DIR}/include"
+ 		"-I${PROJECT_SOURCE_DIR}/include"
+ 		"-I${CMAKE_CURRENT_SOURCE_DIR}/.."
+-		-DZNC_EXPORT_LIB_EXPORT
+ 		-outdir "${CMAKE_CURRENT_BINARY_DIR}"
+ 		-o "${CMAKE_CURRENT_BINARY_DIR}/modpython_biglib.cpp"
+ 		"${CMAKE_CURRENT_SOURCE_DIR}/modpython.i"

diff --git a/net-irc/znc/znc-1.8.2-r2.ebuild b/net-irc/znc/znc-1.8.2-r2.ebuild
index b9d4a004fac3..885291374ae4 100644
--- a/net-irc/znc/znc-1.8.2-r2.ebuild
+++ b/net-irc/znc/znc-1.8.2-r2.ebuild
@@ -30,7 +30,7 @@ LICENSE="Apache-2.0"
 # "If you upgrade your ZNC version, you must recompile all your modules."
 # - https://wiki.znc.in/Compiling_modules
 SLOT="0/${PV}"
-IUSE="+ipv6 +icu nls perl python +ssl sasl tcl test +zlib"
+IUSE="+icu nls perl python +ssl sasl tcl test +zlib"
 RESTRICT="!test? ( test )"
 
 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} icu )"
@@ -40,11 +40,11 @@ BDEPEND="
 	virtual/pkgconfig
 	nls? ( sys-devel/gettext )
 	perl? (
-		>=dev-lang/swig-3.0.0
+		>=dev-lang/swig-4.0.1
 		>=dev-lang/perl-5.10
 	)
 	python? (
-		>=dev-lang/swig-3.0.0
+		>=dev-lang/swig-4.0.1
 		>=dev-lang/perl-5.10
 	)
 	test? (
@@ -75,6 +75,7 @@ PATCHES=(
 	"${FILESDIR}"/${P}-add-libera.patch
 	"${FILESDIR}"/${P}-fix-python-3.10.patch
 	"${FILESDIR}"/${P}-fix-odr-violation.patch
+	"${FILESDIR}"/${P}-fix-swig.patch
 )
 
 pkg_setup() {
@@ -103,7 +104,7 @@ src_configure() {
 		-DWANT_SYSTEMD=yes  # Causes -DSYSTEMD_DIR to be used.
 		-DSYSTEMD_DIR="$(systemd_get_systemunitdir)"
 		-DWANT_ICU="$(usex icu)"
-		-DWANT_IPV6="$(usex ipv6)"
+		-DWANT_IPV6=yes
 		-DWANT_I18N="$(usex nls)"
 		-DWANT_PERL="$(usex perl)"
 		-DWANT_PYTHON="$(usex python)"


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

* [gentoo-commits] repo/gentoo:master commit in: net-irc/znc/, net-irc/znc/files/
@ 2024-02-28  0:20 Louis Sautier
  0 siblings, 0 replies; 11+ messages in thread
From: Louis Sautier @ 2024-02-28  0:20 UTC (permalink / raw
  To: gentoo-commits

commit:     1874462c4871f306a0b80e6b665b723e0b3bd329
Author:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 27 22:54:54 2024 +0000
Commit:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
CommitDate: Wed Feb 28 00:20:23 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1874462c

net-irc/znc: add 1.9.0

* Introduces a new argon2 USE flag which causes passwords to be hashed
  with Argon2id instead of SHA-256, this requires app-crypt/argon2.
* Requires dev-cpp/cctz, see #925664 for rekeywording.
* Requires a newer GoogleTest version for testing.

Bug: https://bugs.gentoo.org/925664
Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org>

 net-irc/znc/Manifest                               |   2 +
 ....9.0-skip-modperl-modpython-tests-cleaner.patch | 248 +++++++++++++++++++++
 net-irc/znc/metadata.xml                           |   1 +
 net-irc/znc/{znc-9999.ebuild => znc-1.9.0.ebuild}  |  20 +-
 net-irc/znc/znc-9999.ebuild                        |   2 +-
 5 files changed, 264 insertions(+), 9 deletions(-)

diff --git a/net-irc/znc/Manifest b/net-irc/znc/Manifest
index 7216d3aa8148..51254b02c536 100644
--- a/net-irc/znc/Manifest
+++ b/net-irc/znc/Manifest
@@ -1,2 +1,4 @@
+DIST gtest-1.14.0.tar.gz 867764 BLAKE2B c457f55ac572b9fb1553eee3df7eeeaf1e7dd2c3d747dd5e90dd279038fa5c71bb7b7d9ba1cf7e6143898b2a1d24d100584bd2a48ded41a426870c4825eec1b2 SHA512 765c326ccc1b87a01027385e69238266e356361cd4ee3e18e3c9d137a5d11fa5d657c164d02dd1be8fe693c8e10f2b580588dbfa57d27f070e2750f50d3e662c
 DIST gtest-1.8.1.tar.gz 992298 BLAKE2B 40ef3417fe424205c0617f07207347ce671ac87605f8ac9b8a333b0b06e3fbef9f556041ee324c18f957f3258ab9fe06704f31cdd038355fb7890180eb77ced1 SHA512 e6283c667558e1fd6e49fa96e52af0e415a3c8037afe1d28b7ff1ec4c2ef8f49beb70a9327b7fc77eb4052a58c4ccad8b5260ec90e4bceeac7a46ff59c4369d7
 DIST znc-1.8.2.tar.gz 2101215 BLAKE2B 7f0e5840fe57cc6b6549115b0fcf02e6afd3be0bf52e79da0a39bcc1463d983cbeb504bad30f3d2f7582f0295c7210d3c1eec40ec87bcc3546ba2d21a67cca9e SHA512 e821647b50698c3a82fad039e69943e030bf644d8f8e82afa87c6c11da44761bceecddd510a7a956a1b487b1cca6ee46e8ac8818ea03127f0f1ff8f5d1a1a7f9
+DIST znc-1.9.0.tar.gz 2221116 BLAKE2B 00bf472f0c223684c52a8c1a1a4b699346e58718161e6c40e3423591ef49aa13b6a530eb705e6f9e9cd6ce8937b4ee4e89de62d15aca7f2b19e1e8b603351d6e SHA512 22b8bd6fd7332643860f7a99ceaa0f6d0c9dd8ba9edac14b3f3731c9301eeb58e03e3af8d09e939e453aa980ff9f24afbe79e66d1106993f81d8779c97731a17

diff --git a/net-irc/znc/files/znc-1.9.0-skip-modperl-modpython-tests-cleaner.patch b/net-irc/znc/files/znc-1.9.0-skip-modperl-modpython-tests-cleaner.patch
new file mode 100644
index 000000000000..fae99b5d6583
--- /dev/null
+++ b/net-irc/znc/files/znc-1.9.0-skip-modperl-modpython-tests-cleaner.patch
@@ -0,0 +1,248 @@
+https://github.com/znc/znc/commit/f8552fc814ebe662a9fc16d6cafa1c0314498971
+
+From f8552fc814ebe662a9fc16d6cafa1c0314498971 Mon Sep 17 00:00:00 2001
+From: Alexey Sokolov <alexey+znc@asokolov.org>
+Date: Sun, 25 Feb 2024 14:12:53 +0000
+Subject: [PATCH] Skip modperl/modpython tests cleaner
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -411,6 +411,8 @@ else()
+ endif()
+ 
+ configure_file("include/znc/zncconfig.h.cmake.in" "include/znc/zncconfig.h")
++configure_file("test/integration/znctestconfig.h.cmake.in"
++	"test/integration/znctestconfig.h")
+ add_subdirectory(include)
+ add_subdirectory(src)
+ add_subdirectory(modules)
+--- a/test/integration/CMakeLists.txt
++++ b/test/integration/CMakeLists.txt
+@@ -45,6 +45,7 @@ add_executable(inttest
+ target_link_libraries(inttest Qt5::Network Threads::Threads)
+ target_include_directories(inttest PUBLIC
+ 	"${PROJECT_SOURCE_DIR}/framework"
++	"${PROJECT_BINARY_DIR}"
+ 	"${GTEST_ROOT}" "${GTEST_ROOT}/include"
+ 	"${GMOCK_ROOT}" "${GMOCK_ROOT}/include")
+ target_compile_definitions(inttest PRIVATE
+--- a/test/integration/tests/core.cpp
++++ b/test/integration/tests/core.cpp
+@@ -14,9 +14,11 @@
+  * limitations under the License.
+  */
+ 
++#include <gtest/gtest.h>
+ #include <gmock/gmock.h>
+ 
+ #include "znctest.h"
++#include "znctestconfig.h"
+ 
+ using testing::HasSubstr;
+ using testing::ContainsRegex;
+@@ -584,10 +586,9 @@ TEST_P(AllLanguages, ServerDependentCapInModule) {
+             )");
+             break;
+         case 2:
+-            if (QProcessEnvironment::systemEnvironment().value(
+-                    "DISABLED_ZNC_PERL_PYTHON_TEST") == "1") {
+-                return;
+-            }
++#ifndef WANT_PYTHON
++            GTEST_SKIP() << "Modpython is disabled";
++#endif
+             znc->CanLeak();
+             InstallModule("testmod.py", R"(
+                 import znc
+@@ -603,10 +604,9 @@ TEST_P(AllLanguages, ServerDependentCapInModule) {
+             client.Write("znc loadmod modpython");
+             break;
+         case 3:
+-            if (QProcessEnvironment::systemEnvironment().value(
+-                    "DISABLED_ZNC_PERL_PYTHON_TEST") == "1") {
+-                return;
+-            }
++#ifndef WANT_PERL
++            GTEST_SKIP() << "Modperl is disabled";
++#endif
+             znc->CanLeak();
+             InstallModule("testmod.pm", R"(
+                 package testmod;
+--- a/test/integration/tests/scripting.cpp
++++ b/test/integration/tests/scripting.cpp
+@@ -15,15 +15,15 @@
+  */
+ 
+ #include "znctest.h"
++#include "znctestconfig.h"
+ 
+ namespace znc_inttest {
+ namespace {
+ 
+ TEST_F(ZNCTest, Modperl) {
+-    if (QProcessEnvironment::systemEnvironment().value(
+-            "DISABLED_ZNC_PERL_PYTHON_TEST") == "1") {
+-        return;
+-    }
++#ifndef WANT_PERL
++    GTEST_SKIP() << "Modperl is disabled";
++#endif
+     auto znc = Run();
+     znc->CanLeak();
+     auto ircd = ConnectIRCd();
+@@ -37,10 +37,9 @@ TEST_F(ZNCTest, Modperl) {
+ }
+ 
+ TEST_F(ZNCTest, Modpython) {
+-    if (QProcessEnvironment::systemEnvironment().value(
+-            "DISABLED_ZNC_PERL_PYTHON_TEST") == "1") {
+-        return;
+-    }
++#ifndef WANT_PYTHON
++    GTEST_SKIP() << "Modpython is disabled";
++#endif
+     auto znc = Run();
+     znc->CanLeak();
+     auto ircd = ConnectIRCd();
+@@ -65,10 +64,9 @@ TEST_F(ZNCTest, Modpython) {
+ }
+ 
+ TEST_F(ZNCTest, ModpythonSocket) {
+-    if (QProcessEnvironment::systemEnvironment().value(
+-            "DISABLED_ZNC_PERL_PYTHON_TEST") == "1") {
+-        return;
+-    }
++#ifndef WANT_PYTHON
++    GTEST_SKIP() << "Modpython is disabled";
++#endif
+     auto znc = Run();
+     znc->CanLeak();
+ 
+@@ -107,10 +105,9 @@ TEST_F(ZNCTest, ModpythonSocket) {
+ }
+ 
+ TEST_F(ZNCTest, ModperlSocket) {
+-    if (QProcessEnvironment::systemEnvironment().value(
+-            "DISABLED_ZNC_PERL_PYTHON_TEST") == "1") {
+-        return;
+-    }
++#ifndef WANT_PERL
++    GTEST_SKIP() << "Modperl is disabled";
++#endif
+     auto znc = Run();
+     znc->CanLeak();
+ 
+@@ -160,10 +157,9 @@ TEST_F(ZNCTest, ModperlSocket) {
+ }
+ 
+ TEST_F(ZNCTest, ModpythonVCString) {
+-    if (QProcessEnvironment::systemEnvironment().value(
+-            "DISABLED_ZNC_PERL_PYTHON_TEST") == "1") {
+-        return;
+-    }
++#ifndef WANT_PYTHON
++    GTEST_SKIP() << "Modpython is disabled";
++#endif
+     auto znc = Run();
+     znc->CanLeak();
+ 
+@@ -185,10 +181,9 @@ TEST_F(ZNCTest, ModpythonVCString) {
+ }
+ 
+ TEST_F(ZNCTest, ModperlVCString) {
+-    if (QProcessEnvironment::systemEnvironment().value(
+-            "DISABLED_ZNC_PERL_PYTHON_TEST") == "1") {
+-        return;
+-    }
++#ifndef WANT_PERL
++    GTEST_SKIP() << "Modperl is disabled";
++#endif
+     auto znc = Run();
+     znc->CanLeak();
+ 
+@@ -214,10 +209,9 @@ TEST_F(ZNCTest, ModperlVCString) {
+ }
+ 
+ TEST_F(ZNCTest, ModperlNV) {
+-    if (QProcessEnvironment::systemEnvironment().value(
+-            "DISABLED_ZNC_PERL_PYTHON_TEST") == "1") {
+-        return;
+-    }
++#ifndef WANT_PERL
++    GTEST_SKIP() << "Modperl is disabled";
++#endif
+     auto znc = Run();
+     znc->CanLeak();
+ 
+@@ -244,10 +238,9 @@ TEST_F(ZNCTest, ModperlNV) {
+ }
+ 
+ TEST_F(ZNCTest, ModpythonPackage) {
+-    if (QProcessEnvironment::systemEnvironment().value(
+-            "DISABLED_ZNC_PERL_PYTHON_TEST") == "1") {
+-        return;
+-    }
++#ifndef WANT_PYTHON
++    GTEST_SKIP() << "Modpython is disabled";
++#endif
+     auto znc = Run();
+     znc->CanLeak();
+ 
+@@ -285,10 +278,12 @@ TEST_F(ZNCTest, ModpythonPackage) {
+ }
+ 
+ TEST_F(ZNCTest, ModpythonModperl) {
+-    if (QProcessEnvironment::systemEnvironment().value(
+-            "DISABLED_ZNC_PERL_PYTHON_TEST") == "1") {
+-        return;
+-    }
++#ifndef WANT_PYTHON
++    GTEST_SKIP() << "Modpython is disabled";
++#endif
++#ifndef WANT_PERL
++    GTEST_SKIP() << "Modperl is disabled";
++#endif
+     auto znc = Run();
+     znc->CanLeak();
+ 
+@@ -302,11 +297,9 @@ TEST_F(ZNCTest, ModpythonModperl) {
+ }
+ 
+ TEST_F(ZNCTest, ModpythonCommand) {
+-    if (QProcessEnvironment::systemEnvironment().value(
+-            "DISABLED_ZNC_PERL_PYTHON_TEST") == "1") {
+-        return;
+-    }
+-
++#ifndef WANT_PYTHON
++    GTEST_SKIP() << "Modpython is disabled";
++#endif
+     auto znc = Run();
+     znc->CanLeak();
+ 
+--- /dev/null
++++ b/test/integration/znctestconfig.h.cmake.in
+@@ -0,0 +1,23 @@
++/*
++ * Copyright (C) 2004-2024 ZNC, see the NOTICE file for details.
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ *     http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
++
++#ifndef ZNCTESTCONFIG_H
++#define ZNCTESTCONFIG_H
++
++#cmakedefine WANT_PYTHON 1
++#cmakedefine WANT_PERL 1
++
++#endif /* ZNCTESTCONFIG_H */

diff --git a/net-irc/znc/metadata.xml b/net-irc/znc/metadata.xml
index 0f8b809bc2b3..3e24db470216 100644
--- a/net-irc/znc/metadata.xml
+++ b/net-irc/znc/metadata.xml
@@ -7,6 +7,7 @@
 	</maintainer>
 	<use>
 		<flag name="zlib">Enable mod_deflate-like gzip support for znc's web interface using <pkg>sys-libs/zlib</pkg>.</flag>
+		<flag name="argon2">Store password hashes using Argon2id instead of SHA-256</flag>
 	</use>
 	<upstream>
 		<remote-id type="github">znc/znc</remote-id>

diff --git a/net-irc/znc/znc-9999.ebuild b/net-irc/znc/znc-1.9.0.ebuild
similarity index 90%
copy from net-irc/znc/znc-9999.ebuild
copy to net-irc/znc/znc-1.9.0.ebuild
index c40af00c86f0..3210a73582c6 100644
--- a/net-irc/znc/znc-9999.ebuild
+++ b/net-irc/znc/znc-1.9.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -7,7 +7,7 @@ PYTHON_COMPAT=( python3_{10..12} )
 
 inherit cmake python-single-r1 readme.gentoo-r1 systemd
 
-GTEST_VER="1.8.1"
+GTEST_VER="1.14.0"
 GTEST_URL="https://github.com/google/googletest/archive/${GTEST_VER}.tar.gz -> gtest-${GTEST_VER}.tar.gz"
 DESCRIPTION="An advanced IRC Bouncer"
 
@@ -21,7 +21,7 @@ else
 		https://znc.in/releases/archive/${MY_P}.tar.gz
 		test? ( ${GTEST_URL} )
 	"
-	KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
+	KEYWORDS="~amd64"
 	S=${WORKDIR}/${MY_P}
 fi
 
@@ -30,7 +30,7 @@ LICENSE="Apache-2.0"
 # "If you upgrade your ZNC version, you must recompile all your modules."
 # - https://wiki.znc.in/Compiling_modules
 SLOT="0/${PV}"
-IUSE="+icu nls perl python +ssl sasl tcl test +zlib"
+IUSE="+argon2 +icu nls perl python +ssl sasl tcl test +zlib"
 RESTRICT="!test? ( test )"
 
 # tests run znc-buildmod which is a Python script
@@ -57,7 +57,8 @@ BDEPEND="
 	)
 "
 DEPEND="
-	app-crypt/argon2:=
+	dev-cpp/cctz:=
+	argon2? ( app-crypt/argon2:= )
 	icu? ( dev-libs/icu:= )
 	nls? ( dev-libs/boost:=[nls] )
 	perl? ( >=dev-lang/perl-5.10:= )
@@ -74,7 +75,9 @@ RDEPEND="
 "
 
 PATCHES=(
-	"${FILESDIR}"/${PN}-1.7.1-inttest-dir.patch
+	"${FILESDIR}/${PN}-1.7.1-inttest-dir.patch"
+	# The following patch is a backport, it can be removed during the next bump
+	"${FILESDIR}/${P}-skip-modperl-modpython-tests-cleaner.patch"
 )
 
 pkg_setup() {
@@ -103,6 +106,7 @@ src_configure() {
 		-DWANT_SYSTEMD=yes  # Causes -DSYSTEMD_DIR to be used.
 		-DSYSTEMD_DIR="$(systemd_get_systemunitdir)"
 		-DWANT_ICU="$(usex icu)"
+		-DWANT_ARGON="$(usex argon2)"
 		-DWANT_IPV6=yes
 		-DWANT_I18N="$(usex nls)"
 		-DWANT_PERL="$(usex perl)"
@@ -115,8 +119,8 @@ src_configure() {
 	)
 
 	if [[ ${PV} != *9999* ]] && use test; then
-		export GTEST_ROOT="${WORKDIR}/googletest-release-${GTEST_VER}/googletest"
-		export GMOCK_ROOT="${WORKDIR}/googletest-release-${GTEST_VER}/googlemock"
+		export GTEST_ROOT="${WORKDIR}/googletest-${GTEST_VER}/googletest"
+		export GMOCK_ROOT="${WORKDIR}/googletest-${GTEST_VER}/googlemock"
 	fi
 
 	cmake_src_configure

diff --git a/net-irc/znc/znc-9999.ebuild b/net-irc/znc/znc-9999.ebuild
index c40af00c86f0..34bfa81f2f20 100644
--- a/net-irc/znc/znc-9999.ebuild
+++ b/net-irc/znc/znc-9999.ebuild
@@ -21,7 +21,7 @@ else
 		https://znc.in/releases/archive/${MY_P}.tar.gz
 		test? ( ${GTEST_URL} )
 	"
-	KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
+	KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86"
 	S=${WORKDIR}/${MY_P}
 fi
 


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

end of thread, other threads:[~2024-02-28  0:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-28  0:20 [gentoo-commits] repo/gentoo:master commit in: net-irc/znc/, net-irc/znc/files/ Louis Sautier
  -- strict thread matches above, loose matches on Subject: below --
2022-11-05 18:43 Louis Sautier
2022-08-07 16:01 Louis Sautier
2021-08-24 19:26 Louis Sautier
2018-07-16  7:07 Louis Sautier
2018-07-15 22:41 Louis Sautier
2018-07-15 22:40 Louis Sautier
2018-07-04 21:34 Louis Sautier
2018-05-15 18:03 Michał Górny
2017-01-04  1:01 Thomas Deutschmann
2015-09-15 15:41 Julian Ospald

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