summaryrefslogtreecommitdiff
path: root/net-irc/znc
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-08-26 00:09:36 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-08-26 00:09:36 +0100
commitb1c81de4fadbd00897700a7321f03b390d952b2e (patch)
treee6cc812351d4f105c110cfc363ebb497e996f47a /net-irc/znc
parent7c59acba5699c9c58090a7a738669669a7307023 (diff)
gentoo resync : 26.08.2021
Diffstat (limited to 'net-irc/znc')
-rw-r--r--net-irc/znc/Manifest10
-rw-r--r--net-irc/znc/files/README.gentoo-r16
-rw-r--r--net-irc/znc/files/znc-1.8.2-add-libera.patch55
-rw-r--r--net-irc/znc/files/znc-1.8.2-fix-python-3.10.patch31
-rw-r--r--net-irc/znc/files/znc-1.8.2-fix-systemd-datadir.patch23
-rw-r--r--net-irc/znc/znc-1.8.2-r1.ebuild (renamed from net-irc/znc/znc-1.8.1.ebuild)99
-rw-r--r--net-irc/znc/znc-9999.ebuild89
7 files changed, 224 insertions, 89 deletions
diff --git a/net-irc/znc/Manifest b/net-irc/znc/Manifest
index 1f4c2622cacf..81612fac3fc8 100644
--- a/net-irc/znc/Manifest
+++ b/net-irc/znc/Manifest
@@ -1,11 +1,13 @@
-AUX README.gentoo-r1 530 BLAKE2B 5feab666142884c67c3c1a51322bb614bbdbaa453a4b6a4eb17b9fe774e4a4b188471a449f2cb5a1d07845a02a5eb15f2fad08958a839306d2029f56e8306543 SHA512 d5be4c0fc0069e6e8c6bf92f281034a603d6041f2b9a54d4fa97cae662225095d4473f54c4573141396ecccf369158f6c0986cafb9c39837edf9ab15200c8e18
+AUX README.gentoo-r1 557 BLAKE2B c947f5f343723fed637dd3c63f9cdb532d8997e9c225f2caaca510d728f5dc15b6c202b56f31411cc213c78a1ec93fbea7f9a6a74afe22a9979c7c452c47ac96 SHA512 84098676656d3c03ddde8e09f96d332e403c179cc77de5db08f1262635e78d4badc902870d4621ec4b2a13f7d92aed1f076659e10ef0e8d6b977d04d8f6b1dc6
AUX znc-1.7.1-inttest-dir.patch 2205 BLAKE2B f322f6884170c71ba537897d38c5ca2787937afdd2ac1fe0b0b4ab55ad7d453029bf4a8c748c5787fc4ed3b46e2b33c925cb962ec868f7a5c07356697a3039e2 SHA512 b74d136985546114604252be74e55e8f5e0740b678bdd224ea63cc3587d17d861c81c69b4bdea0aabc23e64097dda0097e97fbd80110c2c2a919b33d912d2dea
+AUX znc-1.8.2-add-libera.patch 2205 BLAKE2B 756ddf827d4f39ac52c031ccdc13e07eddbcc079e37248ca3fa82bab5f9b90a1cf6faffd8d9a0c81a2c6a3ef912bfb314f3e03f657fd15bdadb61b0c7887fa1a SHA512 06c1a9f6a2729ed557f89ec247d89a87bca70b8a36103dbb1e230e7816df5155950f08f39b1011a0925354c073d4c3570f7918e730d01ad2c6ed3cdbf4b6df6c
+AUX znc-1.8.2-fix-python-3.10.patch 997 BLAKE2B b2be81e71483ea64912db8511dd9cb8ff92b2a7ea3b5d23f57fccd349c0e86d147d9245c5cbd54f99640e198b312847d6a14a256627f0f69d114f214f11dc6a8 SHA512 d39548a34ccf23a814f8b9b7b50fc87f470932e717db079bd3aea4f47e093cf10daa36f003dd1de33e0e493e43de8d5e2e354d5cc881326b249003870408c3aa
+AUX znc-1.8.2-fix-systemd-datadir.patch 692 BLAKE2B d6585fc5c2087b51c8c2277eb1c8f70585cad3621fcaa0f746a918a1f5e9f5455a8ca8dcbc6e73c0200e723d2fd6e3f4080d3a1d185fc9cc2dd3b14dcd80908a SHA512 d54f36cd4da9bb2d67852e2d7f302538fd2807d95b3480b4416fbf1d7a4d010a03a06e8f20c3f8907ea8d33d1be4872a4433c3db30530327fcfb39f43ada0b23
AUX znc.confd-r1 720 BLAKE2B 4857a8bcd36ed1008a558ac7b067d6fad53b5d39c0df9130ca28d4ac3db3924a3a1200682c19c7e6f7869f22338b492f73bf6ccbc2b723d117c9eebc10a89838 SHA512 3ab102f64ea0572350c8595fd3739874da591c43a3dbc3a740c72c53bd7418fded721d478d1fb92de0c0d18131313ba6679e842a135dfe239ea3f42821d8e468
AUX znc.initd-r2 952 BLAKE2B 81346bf0a1581543683eb5c125b29474c0bc01b8aee11c036a134c5a01042059564f2982aaec65715ac0a2c87b64fcd9746464148a81daeee549f4228d6ff55f SHA512 c3d676796aaa485dcaebee0fba58a8f86560cd192e0e2ccf06f58346c1368f58aa5be1c1e5160f8105e3dc5c684d3d1f82eff6a4d7b87c07f11450b72288727f
DIST gtest-1.8.1.tar.gz 992298 BLAKE2B 40ef3417fe424205c0617f07207347ce671ac87605f8ac9b8a333b0b06e3fbef9f556041ee324c18f957f3258ab9fe06704f31cdd038355fb7890180eb77ced1 SHA512 e6283c667558e1fd6e49fa96e52af0e415a3c8037afe1d28b7ff1ec4c2ef8f49beb70a9327b7fc77eb4052a58c4ccad8b5260ec90e4bceeac7a46ff59c4369d7
-DIST znc-1.8.1.tar.gz 2161359 BLAKE2B 5b9026156a62748659ae0496f9d799e7d1e0815358fa59f7538ca9d750b8f418fe8a57362b5b5bba40cfb00c2adc5fdc3eee0b56ebde50565c97d158296b827e SHA512 87713ca05621806a399abc23f45671746578f6487561666704bb2ed1cd1863159a42ef4344eea95c9e7dc13d131b669eeabedda37e919d0bad6a05103ad80a16
DIST znc-1.8.2.tar.gz 2101215 BLAKE2B 7f0e5840fe57cc6b6549115b0fcf02e6afd3be0bf52e79da0a39bcc1463d983cbeb504bad30f3d2f7582f0295c7210d3c1eec40ec87bcc3546ba2d21a67cca9e SHA512 e821647b50698c3a82fad039e69943e030bf644d8f8e82afa87c6c11da44761bceecddd510a7a956a1b487b1cca6ee46e8ac8818ea03127f0f1ff8f5d1a1a7f9
-EBUILD znc-1.8.1.ebuild 4645 BLAKE2B 5d1be110a6532adb7880286cd21be2e8bf242a9b9959976e5235504cd57d9a70196a13344e8554b4662447e35ed83927dd9d11179e58c96505813d296d5d085d SHA512 bd5e96e5b733d17b5f7e3995c6d086836728a5ab4f5a837aa097898d3c8f2a22a257f06a8131ef25cd63066da81f13870f8c76f6bb45762f2678162ed7816828
+EBUILD znc-1.8.2-r1.ebuild 5538 BLAKE2B 9ecdaacd7a53c90d391c15bee990274bfcef834d5fec23b22c3d98e39d03a70679bfcee83b3efd4bba384e3e1bfa851f14da0c9e75c72ac1f69aab4c85a386d7 SHA512 3e79552f4d276fa0753a8257ec44ad90c52dd212e96a2228069af19141eb37eef57dc48024cb34d79825dcecfea70b723feb60982556382ca8d79945b4b625e6
EBUILD znc-1.8.2.ebuild 4767 BLAKE2B f7f5b485f231417c56935b094d23ac662b901bdf3c368715c035b258ddd61026008dcaa1015a72d7f885ac73dd1e5c955b15272eae28606667c2057f0d62545a SHA512 26223568c22bfb62ba138e7661635c0ced3067bded70cafaff473e10001344200a608aefef326cdea3b5e31fbce44fa7e1f9b6b57e752b3559f8d64f13cda0d0
-EBUILD znc-9999.ebuild 4771 BLAKE2B 739df11a6b463895fe54e4b16a953b317aafe96fa86f1917a90a6d41949c99018aefa18ea8c652115c59cb97a1d29bda824daa2c418c3b2ab2da7c1973659c47 SHA512 6fd680144b722e2a89fdc84aead46dacda33ff279a73bfaef60a48ae17c4d9d7a5e720d34f579c766b047ca60f2f05ac9fb357bfdb083a3e0d42fdff0c3864bc
+EBUILD znc-9999.ebuild 5386 BLAKE2B bad7ca62e28a01fe6ff70f0afe0c626b253730a2b57a1350e1afa2a5d73ba69616389a56363536710038646b0356b58bf2265c2809174bf520dc56e623238230 SHA512 77520dffee0823b0fe9e8f05974c5b305cd7e3a7bbc4ce5afb7b1642e3e2623db13013b7fece873bab2fc64a065bbac133f66d15c1067f864275d1d2bcac3f90
MISC metadata.xml 507 BLAKE2B c8926f6668f57c84f5715156a424b18f7cb01f0ea9ac6a499550f731a00c7de035ec270f89297bda07ac3115292deffdcd0f3a339484c9de5d8bd7170be00de6 SHA512 d69af8535c2e409e6b6e65bfd279d74bd89ce01e911e0d21b4079bd13328e47f3b959ef82531b833c702955225e01db6915f4fb3f94d048a05ce2107b61bf1a6
diff --git a/net-irc/znc/files/README.gentoo-r1 b/net-irc/znc/files/README.gentoo-r1
index ca41e4dac26b..1812383beb29 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 000000000000..e7015754d8c1
--- /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 000000000000..fe40d190d1ba
--- /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 000000000000..06dd6991b4a4
--- /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.1.ebuild b/net-irc/znc/znc-1.8.2-r1.ebuild
index 4caac33b16da..396026d8980b 100644
--- a/net-irc/znc/znc-1.8.1.ebuild
+++ b/net-irc/znc/znc-1.8.2-r1.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-PYTHON_COMPAT=( python3_{7,8,9} )
+PYTHON_COMPAT=( python3_{8..10} )
inherit cmake python-single-r1 readme.gentoo-r1 systemd
@@ -13,8 +13,7 @@ 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=""
+ EGIT_REPO_URI="https://github.com/znc/znc.git"
else
MY_PV=${PV/_/-}
MY_P=${PN}-${MY_PV}
@@ -22,33 +21,21 @@ else
https://znc.in/releases/archive/${MY_P}.tar.gz
test? ( ${GTEST_URL} )
"
- KEYWORDS="amd64 arm arm64 x86"
+ KEYWORDS="~amd64 ~arm ~arm64 ~x86"
S=${WORKDIR}/${MY_P}
fi
HOMEPAGE="https://znc.in"
LICENSE="Apache-2.0"
-SLOT="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 )"
-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
-"
+# perl is a build-time dependency of modpython
BDEPEND="
virtual/pkgconfig
nls? ( sys-devel/gettext )
@@ -65,8 +52,29 @@ BDEPEND="
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 )
+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
@@ -84,6 +92,8 @@ src_prepare() {
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
}
@@ -96,6 +106,7 @@ src_configure() {
-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)"
@@ -135,43 +146,47 @@ src_install() {
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
- DISABLE_AUTOFORMATTING=1
+ 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
-
- 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."
+ 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
- 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"
+ 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."
diff --git a/net-irc/znc/znc-9999.ebuild b/net-irc/znc/znc-9999.ebuild
index 303be8154904..d00dd9757dd2 100644
--- a/net-irc/znc/znc-9999.ebuild
+++ b/net-irc/znc/znc-9999.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-PYTHON_COMPAT=( python3_{7,8,9} )
+PYTHON_COMPAT=( python3_{8..10} )
inherit cmake python-single-r1 readme.gentoo-r1 systemd
@@ -13,8 +13,7 @@ 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=""
+ EGIT_REPO_URI="https://github.com/znc/znc.git"
else
MY_PV=${PV/_/-}
MY_P=${PN}-${MY_PV}
@@ -36,21 +35,7 @@ RESTRICT="!test? ( test )"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} icu )"
-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
-"
+# perl is a build-time dependency of modpython
BDEPEND="
virtual/pkgconfig
nls? ( sys-devel/gettext )
@@ -67,8 +52,25 @@ BDEPEND="
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 )
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.7.1-inttest-dir.patch
+)
pkg_setup() {
if use python; then
@@ -86,6 +88,8 @@ src_prepare() {
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
}
@@ -98,6 +102,7 @@ src_configure() {
-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)"
@@ -137,43 +142,47 @@ src_install() {
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
- DISABLE_AUTOFORMATTING=1
+ 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
-
- 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."
+ 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
- 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"
+ 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."