From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7D0681580BB for ; Tue, 24 Aug 2021 19:26:34 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C726EE08F0; Tue, 24 Aug 2021 19:26:33 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 922FAE08F0 for ; Tue, 24 Aug 2021 19:26:33 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 98D14335D88 for ; Tue, 24 Aug 2021 19:26:32 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 315668D3 for ; Tue, 24 Aug 2021 19:26:31 +0000 (UTC) From: "Louis Sautier" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Louis Sautier" Message-ID: <1629833019.e8f4256f6405c53c49c2b0f3725862505a512d85.sbraz@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-irc/znc/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-irc/znc/znc-9999.ebuild X-VCS-Directories: net-irc/znc/ X-VCS-Committer: sbraz X-VCS-Committer-Name: Louis Sautier X-VCS-Revision: e8f4256f6405c53c49c2b0f3725862505a512d85 X-VCS-Branch: master Date: Tue, 24 Aug 2021 19:26:31 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 3ea9a9c1-454a-44ef-955d-8bd1b0916744 X-Archives-Hash: 6b04eb92957e9333cbf1530d0710a6a4 commit: e8f4256f6405c53c49c2b0f3725862505a512d85 Author: Louis Sautier gentoo org> AuthorDate: Tue Aug 24 19:21:38 2021 +0000 Commit: Louis Sautier gentoo org> CommitDate: Tue Aug 24 19:23:39 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e8f4256f net-irc/znc: sync live ebuild with 1.8.2-r1 Signed-off-by: Louis Sautier gentoo.org> net-irc/znc/znc-9999.ebuild | 89 +++++++++++++++++++++++++-------------------- 1 file changed, 49 insertions(+), 40 deletions(-) diff --git a/net-irc/znc/znc-9999.ebuild b/net-irc/znc/znc-9999.ebuild index 303be815490..d00dd9757dd 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."