1 |
commit: e8f4256f6405c53c49c2b0f3725862505a512d85 |
2 |
Author: Louis Sautier <sbraz <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Aug 24 19:21:38 2021 +0000 |
4 |
Commit: Louis Sautier <sbraz <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Aug 24 19:23:39 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e8f4256f |
7 |
|
8 |
net-irc/znc: sync live ebuild with 1.8.2-r1 |
9 |
|
10 |
Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org> |
11 |
|
12 |
net-irc/znc/znc-9999.ebuild | 89 +++++++++++++++++++++++++-------------------- |
13 |
1 file changed, 49 insertions(+), 40 deletions(-) |
14 |
|
15 |
diff --git a/net-irc/znc/znc-9999.ebuild b/net-irc/znc/znc-9999.ebuild |
16 |
index 303be815490..d00dd9757dd 100644 |
17 |
--- a/net-irc/znc/znc-9999.ebuild |
18 |
+++ b/net-irc/znc/znc-9999.ebuild |
19 |
@@ -3,7 +3,7 @@ |
20 |
|
21 |
EAPI=7 |
22 |
|
23 |
-PYTHON_COMPAT=( python3_{7,8,9} ) |
24 |
+PYTHON_COMPAT=( python3_{8..10} ) |
25 |
|
26 |
inherit cmake python-single-r1 readme.gentoo-r1 systemd |
27 |
|
28 |
@@ -13,8 +13,7 @@ DESCRIPTION="An advanced IRC Bouncer" |
29 |
|
30 |
if [[ ${PV} == *9999* ]]; then |
31 |
inherit git-r3 |
32 |
- EGIT_REPO_URI=${EGIT_REPO_URI:-"https://github.com/znc/znc.git"} |
33 |
- SRC_URI="" |
34 |
+ EGIT_REPO_URI="https://github.com/znc/znc.git" |
35 |
else |
36 |
MY_PV=${PV/_/-} |
37 |
MY_P=${PN}-${MY_PV} |
38 |
@@ -36,21 +35,7 @@ RESTRICT="!test? ( test )" |
39 |
|
40 |
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} icu )" |
41 |
|
42 |
-DEPEND=" |
43 |
- icu? ( dev-libs/icu:= ) |
44 |
- nls? ( dev-libs/boost:=[nls] ) |
45 |
- perl? ( >=dev-lang/perl-5.10:= ) |
46 |
- python? ( ${PYTHON_DEPS} ) |
47 |
- sasl? ( >=dev-libs/cyrus-sasl-2 ) |
48 |
- ssl? ( dev-libs/openssl:0= ) |
49 |
- tcl? ( dev-lang/tcl:0= ) |
50 |
- zlib? ( sys-libs/zlib:0= ) |
51 |
-" |
52 |
-RDEPEND=" |
53 |
- ${DEPEND} |
54 |
- acct-user/znc |
55 |
- acct-group/znc |
56 |
-" |
57 |
+# perl is a build-time dependency of modpython |
58 |
BDEPEND=" |
59 |
virtual/pkgconfig |
60 |
nls? ( sys-devel/gettext ) |
61 |
@@ -67,8 +52,25 @@ BDEPEND=" |
62 |
dev-qt/qtnetwork:5 |
63 |
) |
64 |
" |
65 |
+DEPEND=" |
66 |
+ icu? ( dev-libs/icu:= ) |
67 |
+ nls? ( dev-libs/boost:=[nls] ) |
68 |
+ perl? ( >=dev-lang/perl-5.10:= ) |
69 |
+ python? ( ${PYTHON_DEPS} ) |
70 |
+ sasl? ( >=dev-libs/cyrus-sasl-2 ) |
71 |
+ ssl? ( dev-libs/openssl:0= ) |
72 |
+ tcl? ( dev-lang/tcl:0= ) |
73 |
+ zlib? ( sys-libs/zlib:0= ) |
74 |
+" |
75 |
+RDEPEND=" |
76 |
+ ${DEPEND} |
77 |
+ acct-user/znc |
78 |
+ acct-group/znc |
79 |
+" |
80 |
|
81 |
-PATCHES=( "${FILESDIR}"/${PN}-1.7.1-inttest-dir.patch ) |
82 |
+PATCHES=( |
83 |
+ "${FILESDIR}"/${PN}-1.7.1-inttest-dir.patch |
84 |
+) |
85 |
|
86 |
pkg_setup() { |
87 |
if use python; then |
88 |
@@ -86,6 +88,8 @@ src_prepare() { |
89 |
sed -i -e "s|DZNC_BIN_DIR:path=|DZNC_BIN_DIR:path=${T}/inttest|" \ |
90 |
test/CMakeLists.txt || die |
91 |
|
92 |
+ sed -i "s|--datadir=|&${EPREFIX}|" znc.service.in || die |
93 |
+ |
94 |
cmake_src_prepare |
95 |
} |
96 |
|
97 |
@@ -98,6 +102,7 @@ src_configure() { |
98 |
-DWANT_I18N="$(usex nls)" |
99 |
-DWANT_PERL="$(usex perl)" |
100 |
-DWANT_PYTHON="$(usex python)" |
101 |
+ -DWANT_PYTHON_VERSION="${EPYTHON#python}" |
102 |
-DWANT_CYRUS="$(usex sasl)" |
103 |
-DWANT_OPENSSL="$(usex ssl)" |
104 |
-DWANT_TCL="$(usex tcl)" |
105 |
@@ -137,43 +142,47 @@ src_install() { |
106 |
newinitd "${FILESDIR}"/znc.initd-r2 znc |
107 |
newconfd "${FILESDIR}"/znc.confd-r1 znc |
108 |
|
109 |
+ local DOC_CONTENTS |
110 |
+ # "local" has its own return value which is not what we want to catch |
111 |
DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r1") || die |
112 |
- DISABLE_AUTOFORMATTING=1 |
113 |
+ local DISABLE_AUTOFORMATTING=1 |
114 |
readme.gentoo_create_doc |
115 |
} |
116 |
|
117 |
pkg_postinst() { |
118 |
+ if [[ -d "${EROOT}/var/lib/znc/.znc/" ]]; then |
119 |
+ eerror "${EROOT}/var/lib/znc/.znc/ exists, please move your data to ${EROOT}/var/lib/znc/" |
120 |
+ eerror "" |
121 |
+ eerror "The systemd unit has changed and now expects data to be located" |
122 |
+ eerror "at the root of ${EROOT}/var/lib/znc instead of its '.znc' subfolder." |
123 |
+ eerror "The recommended procedure to move the data is the following:" |
124 |
+ eerror "1. stop the service: systemctl stop znc.service" |
125 |
+ eerror "2. move the data: cp -a '${EROOT}/var/lib/znc/.znc/.' '${EROOT}/var/lib/znc/'" |
126 |
+ 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'" |
127 |
+ eerror "4. restart znc: systemctl start znc.service" |
128 |
+ eerror "5. once everything works, remove the old data directory: rm -r '${EROOT}/var/lib/znc/.znc/'" |
129 |
+ eerror "See https://bugs.gentoo.org/743856 for details." |
130 |
+ fi |
131 |
+ |
132 |
if [[ -z "${REPLACING_VERSIONS}" ]]; then |
133 |
# This is a new installation |
134 |
readme.gentoo_print_elog |
135 |
fi |
136 |
- |
137 |
- if [[ -d "${EROOT}"/etc/znc ]]; then |
138 |
- ewarn "${EROOT}/etc/znc exists on your system." |
139 |
- ewarn "Due to the nature of the contents of that folder," |
140 |
- ewarn "we have changed the default configuration to use" |
141 |
- ewarn " ${EROOT}/var/lib/znc" |
142 |
- ewarn "please move ${EROOT}/etc/znc to ${EROOT}/var/lib/znc" |
143 |
- ewarn "or adjust your service configuration." |
144 |
- fi |
145 |
} |
146 |
|
147 |
pkg_config() { |
148 |
- if [[ -e "${EROOT}/var/lib/znc" ]]; then |
149 |
- ewarn "${EROOT}/var/lib/znc already exists, aborting to avoid damaging" |
150 |
- ewarn "any existing configuration. If you are sure you want" |
151 |
- ewarn "to generate a new configuration, remove the folder" |
152 |
- ewarn "and try again." |
153 |
+ if [[ -d "${EROOT}/var/lib/znc/configs" ]]; then |
154 |
+ ewarn "${EROOT}/var/lib/znc/configs/ already exists," |
155 |
+ ewarn "aborting to avoid damaging any existing configuration." |
156 |
+ ewarn "If you are sure you want to generate a new configuration," |
157 |
+ ewarn "remove the folder and try again." |
158 |
else |
159 |
einfo "Press enter to interactively create a new configuration file for znc." |
160 |
einfo "To abort, press Control-C" |
161 |
read |
162 |
- mkdir -p "${EROOT}/var/lib/znc" || die |
163 |
- chown -R ${PN}:${PN} "${EROOT}/var/lib/znc" || |
164 |
- die "Setting permissions failed" |
165 |
- start-stop-daemon --start --user ${PN}:${PN} --env ZNC_NO_LAUNCH_AFTER_MAKECONF=1 \ |
166 |
- "${EROOT}"/usr/bin/znc -- --makeconf --datadir "${EROOT}/var/lib/znc" || |
167 |
- die "Config failed" |
168 |
+ su ${PN} -p -s /bin/sh -c 'ZNC_NO_LAUNCH_AFTER_MAKECONF=1 \ |
169 |
+ "${EROOT}"/usr/bin/znc --makeconf \ |
170 |
+ --datadir "${EROOT}/var/lib/znc"' || die "Config failed" |
171 |
einfo |
172 |
einfo "You can now start the znc service using the init system of your choice." |
173 |
einfo "Don't forget to enable it if you want to use znc at boot." |