Gentoo Archives: gentoo-commits

From: James Le Cuirot <chewi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-apps/tt-rss/, www-apps/tt-rss/files/
Date: Sat, 19 Feb 2022 16:00:59
Message-Id: 1645286437.6bbd050f9ecc0fadd9fae6eabc7206a6042d397f.chewi@gentoo
1 commit: 6bbd050f9ecc0fadd9fae6eabc7206a6042d397f
2 Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
3 AuthorDate: Sat Feb 19 15:59:25 2022 +0000
4 Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 19 16:00:37 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6bbd050f
7
8 www-apps/tt-rss: Bump to 20220218, EAPI 8, fix for dash, fix permissions
9
10 Thanks to Anna Vyalkova for the dash fix. Note that the configuration syntax has
11 changed since the last version.
12
13 Closes: https://bugs.gentoo.org/833206
14 Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
15
16 www-apps/tt-rss/Manifest | 1 +
17 www-apps/tt-rss/files/permissions-r1 | 24 +++++
18 .../tt-rss/files/postinstall-en-with-daemon-r1.txt | 3 +-
19 www-apps/tt-rss/files/postinstall-en.txt | 3 +-
20 www-apps/tt-rss/files/tt-rss-no-chmod.patch | 26 +++++
21 www-apps/tt-rss/files/ttrssd.initd-r4 | 119 +++++++++++++++++++++
22 www-apps/tt-rss/tt-rss-20200922.ebuild | 5 -
23 ...-rss-20200922.ebuild => tt-rss-20220218.ebuild} | 26 ++---
24 www-apps/tt-rss/tt-rss-99999999.ebuild | 20 ++--
25 9 files changed, 189 insertions(+), 38 deletions(-)
26
27 diff --git a/www-apps/tt-rss/Manifest b/www-apps/tt-rss/Manifest
28 index a650767d6971..5a6f1e2a2113 100644
29 --- a/www-apps/tt-rss/Manifest
30 +++ b/www-apps/tt-rss/Manifest
31 @@ -1 +1,2 @@
32 DIST tt-rss-20200922.tar.gz 3406007 BLAKE2B 7058253fbbba1c121d11eace8a3ef024b7ef83b05fd8b10b0ba0d017fa75d16b970e2c95c13091f760b21bcf092f609d81a5649de03672b0394113412f90beb0 SHA512 90387d07af76bc90bfb2e740dcfa0b2e13ed9af679a6c9258edd053511277bc36fca8edd4b3862c3f1957fa65a827b161abf3ed7fa603d4b84514fd456947a47
33 +DIST tt-rss-20220218.tar.gz 9916433 BLAKE2B 318969b6e5156842079bf68c4ea614e5e60e21d8caa46b1a78f2cef051904da30e5091838f6e10f6f610d8ee39c7922137aeb60b7cd5004cabc1d2cdf65edfa8 SHA512 38a81dd737462724bc52ca3915350c175abe548cd566a4f9a5e1d5efda9287d0666e9348e5b13dd20549360501de5b0bfb659292fb650f7a60fdab8b63cf8202
34
35 diff --git a/www-apps/tt-rss/files/permissions-r1 b/www-apps/tt-rss/files/permissions-r1
36 new file mode 100644
37 index 000000000000..e50b4406646d
38 --- /dev/null
39 +++ b/www-apps/tt-rss/files/permissions-r1
40 @@ -0,0 +1,24 @@
41 +#!/bin/bash -e
42 +
43 +cd "${MY_INSTALLDIR}"
44 +
45 +if [[ $1 = install ]]; then
46 + # We need to lock down cache/ for the operations below to be
47 + # safe. The permissions match the webapp-config defaults but these
48 + # can be changed and existing installations may also differ.
49 + chown root:root cache/
50 + chmod 00755 cache/
51 +
52 + chgrp --no-dereference ttrssd feed-icons/ lock/ cache/*/
53 + chmod g+ws feed-icons/ lock/ cache/*/
54 +
55 + # Files within lock/ are exclusively written by the update daemon.
56 + # feed-icons/ and cache/ holds files that are modified in place by both
57 + # processes and therefore ACLs are required to ensure that the files
58 + # themselves are created as group writable.
59 + if ! setfacl --modify d:g::rwX feed-icons/ cache/*/; then
60 + echo "WARNING: ACLs are not available on this filesystem. Either enable them or set TTRSSD_USER to your PHP user in /etc/conf.d/ttrssd to avoid permission issues."
61 + elif [[ -n $(find feed-icons/ cache/ -type f ! -name ".*" ! -name index.html ! \( -group ttrssd -perm -020 \) -print -quit) ]]; then
62 + echo "WARNING: Files that are not writable by the ttrssd group found within the cache or feed-icons directories. Either delete them or correct their permissions."
63 + fi
64 +fi
65
66 diff --git a/www-apps/tt-rss/files/postinstall-en-with-daemon-r1.txt b/www-apps/tt-rss/files/postinstall-en-with-daemon-r1.txt
67 index 8c72406d76d2..92d1fa315c72 100644
68 --- a/www-apps/tt-rss/files/postinstall-en-with-daemon-r1.txt
69 +++ b/www-apps/tt-rss/files/postinstall-en-with-daemon-r1.txt
70 @@ -1,4 +1,5 @@
71 -Please read https://tt-rss.org/wiki/InstallationNotes.
72 +Please read https://tt-rss.org/wiki/GlobalConfig. Note that the configuration
73 +syntax changed in 2021.
74
75 Once you have configured TT-RSS, tweak /etc/conf.d/ttrssd to your
76 needs if you have not already done so. If ACLs are unavailable on the
77
78 diff --git a/www-apps/tt-rss/files/postinstall-en.txt b/www-apps/tt-rss/files/postinstall-en.txt
79 index 67a16111f3d5..f28a19d991bf 100644
80 --- a/www-apps/tt-rss/files/postinstall-en.txt
81 +++ b/www-apps/tt-rss/files/postinstall-en.txt
82 @@ -1 +1,2 @@
83 -Please read https://tt-rss.org/wiki/InstallationNotes.
84 +Please read https://tt-rss.org/wiki/GlobalConfig. Note that the configuration
85 +syntax changed in 2021.
86
87 diff --git a/www-apps/tt-rss/files/tt-rss-no-chmod.patch b/www-apps/tt-rss/files/tt-rss-no-chmod.patch
88 new file mode 100644
89 index 000000000000..e51e66eaed22
90 --- /dev/null
91 +++ b/www-apps/tt-rss/files/tt-rss-no-chmod.patch
92 @@ -0,0 +1,26 @@
93 +These files may be written and then updated by the web interface user or the
94 +update daemon user, so they need to be group writeable. We enforce this with
95 +ACLs rather than chmod though.
96 +
97 +diff --color -Naur a/classes/pref/feeds.php b/classes/pref/feeds.php
98 +--- a/classes/pref/feeds.php 2022-02-18 13:44:03.000000000 +0000
99 ++++ b/classes/pref/feeds.php 2022-02-19 15:37:55.000723992 +0000
100 +@@ -490,7 +490,6 @@
101 +
102 + if (file_exists($new_filename)) unlink($new_filename);
103 + if (rename($tmp_file, $new_filename)) {
104 +- chmod($new_filename, 0644);
105 +
106 + $feed->set([
107 + 'favicon_avg_color' => null,
108 +diff --color -Naur a/classes/rssutils.php b/classes/rssutils.php
109 +--- a/classes/rssutils.php 2022-02-18 13:44:03.000000000 +0000
110 ++++ b/classes/rssutils.php 2022-02-19 15:37:40.393312123 +0000
111 +@@ -1728,7 +1728,6 @@
112 +
113 + fwrite($fp, $contents);
114 + fclose($fp);
115 +- chmod($icon_file, 0644);
116 + clearstatcache();
117 +
118 + return $icon_file;
119
120 diff --git a/www-apps/tt-rss/files/ttrssd.initd-r4 b/www-apps/tt-rss/files/ttrssd.initd-r4
121 new file mode 100644
122 index 000000000000..9dbfa157ce43
123 --- /dev/null
124 +++ b/www-apps/tt-rss/files/ttrssd.initd-r4
125 @@ -0,0 +1,119 @@
126 +#!/sbin/openrc-run
127 +# Copyright 1999-2022 Gentoo Foundation
128 +# Distributed under the terms of the GNU General Public License v2
129 +
130 +command="/usr/bin/php"
131 +
132 +depend() {
133 + need net
134 + after postgresql mysql
135 +}
136 +
137 +PID_DIR="/run/ttrssd"
138 +LOG_DIR=${LOG_DIR:-"/var/log/ttrssd"}
139 +TTRSSD_USER=${TTRSSD_USER:-"ttrssd"}
140 +
141 +list_instance_dirs() {
142 + if [ -z "${INSTANCE_DIRS}" ]; then
143 + cut -d" " -f4 /var/db/webapps/tt-rss/*/installs 2>/dev/null
144 + else
145 + printf "%s\n" ${INSTANCE_DIRS}
146 + fi
147 +}
148 +
149 +instance_dir_to_name() {
150 + local name
151 +
152 + name=${1#/}
153 + printf %s "${name}" | awk '{
154 + gsub("/", "--");
155 + print $0;
156 + }'
157 +}
158 +
159 +start_pre() {
160 + mkdir -p "${PID_DIR}" "${LOG_DIR}" || return 1
161 + chown "${TTRSSD_USER}":ttrssd "${LOG_DIR}" || return 1
162 +}
163 +
164 +start() {
165 + local instance_dir instance_name ret=1
166 +
167 + IFS="
168 +"
169 + for instance_dir in $(list_instance_dirs); do
170 + if [ -d "${instance_dir}" ]; then
171 + if [ ! -f "${instance_dir}"/update_daemon2.php ]; then
172 + ewarn "TT-RSS instance in ${instance_dir} has no update_daemon2.php script"
173 + elif [ ! -f "${instance_dir}"/config.php ]; then
174 + eerror "TT-RSS instance in ${instance_dir} is not configured"
175 + else
176 + instance_name=$(instance_dir_to_name "${instance_dir}")
177 + ebegin "Starting TT-RSS update daemon in ${instance_dir}"
178 + start-stop-daemon --start --user "${TTRSSD_USER}":ttrssd \
179 + --background --wait 2000 \
180 + --stdout "${LOG_DIR}/${instance_name}.log" \
181 + --stderr "${LOG_DIR}/${instance_name}.log" \
182 + --make-pidfile --pidfile "${PID_DIR}/${instance_name}.pid" \
183 + --exec /usr/bin/php -- -f "${instance_dir}"/update_daemon2.php \
184 + -- ${TTRSSD_OPTS}
185 + eend $? && ret=0
186 + fi
187 + else
188 + eerror "TT-RSS instance in ${instance_dir} is missing"
189 + fi
190 + done
191 + unset IFS
192 +
193 + # Succeed if at least one started.
194 + return ${ret}
195 +}
196 +
197 +stop() {
198 + local instance_dir instance_name
199 +
200 + IFS="
201 +"
202 + for instance_dir in $(list_instance_dirs); do
203 + instance_name=$(instance_dir_to_name "${instance_dir}")
204 +
205 + [ -f "${PID_DIR}/${instance_name}.pid" ] ||
206 + [ -f "${instance_dir}"/update_daemon2.php ] ||
207 + continue
208 +
209 + ebegin "Stopping TT-RSS update daemon in ${instance_dir}"
210 + start-stop-daemon --stop --retry 5 --pidfile "${PID_DIR}/${instance_name}.pid" \
211 + --exec /usr/bin/php -- -f "${instance_dir}"/update_daemon2.php \
212 + -- ${TTRSSD_OPTS}
213 + eend $?
214 +
215 + rm -f "${instance_dir}"/lock/*.lock
216 + done
217 + unset IFS
218 +
219 + # Always succeed.
220 + return 0
221 +}
222 +
223 +status() {
224 + local instance_dir instance_name pid
225 +
226 + IFS="
227 +"
228 + for instance_dir in $(list_instance_dirs); do
229 + instance_name=$(instance_dir_to_name "${instance_dir}")
230 +
231 + [ -f "${PID_DIR}/${instance_name}.pid" ] ||
232 + [ -f "${instance_dir}"/update_daemon2.php ] ||
233 + continue
234 +
235 + if start-stop-daemon --signal 0 --pidfile "${PID_DIR}/${instance_name}.pid"; then
236 + # At least one instance is running
237 + return 0
238 + fi
239 + done
240 + unset IFS
241 +
242 + # No instances are running
243 + return 3
244 +}
245
246 diff --git a/www-apps/tt-rss/tt-rss-20200922.ebuild b/www-apps/tt-rss/tt-rss-20200922.ebuild
247 index 86ea09cce5e4..e2117ac64f57 100644
248 --- a/www-apps/tt-rss/tt-rss-20200922.ebuild
249 +++ b/www-apps/tt-rss/tt-rss-20200922.ebuild
250 @@ -93,8 +93,3 @@ src_install() {
251
252 webapp_src_install
253 }
254 -
255 -pkg_postinst() {
256 - elog "You need to merge config.php-dist into config.php manually when upgrading."
257 - webapp_pkg_postinst
258 -}
259
260 diff --git a/www-apps/tt-rss/tt-rss-20200922.ebuild b/www-apps/tt-rss/tt-rss-20220218.ebuild
261 similarity index 78%
262 copy from www-apps/tt-rss/tt-rss-20200922.ebuild
263 copy to www-apps/tt-rss/tt-rss-20220218.ebuild
264 index 86ea09cce5e4..2081b2a81759 100644
265 --- a/www-apps/tt-rss/tt-rss-20200922.ebuild
266 +++ b/www-apps/tt-rss/tt-rss-20220218.ebuild
267 @@ -1,9 +1,9 @@
268 # Copyright 1999-2022 Gentoo Authors
269 # Distributed under the terms of the GNU General Public License v2
270
271 -EAPI=7
272 +EAPI=8
273
274 -inherit prefix webapp
275 +inherit webapp
276
277 DESCRIPTION="Tiny Tiny RSS - A web-based news feed (RSS/Atom) aggregator using AJAX"
278 HOMEPAGE="https://tt-rss.org/"
279 @@ -13,7 +13,7 @@ KEYWORDS="~amd64 ~arm ~mips ~x86"
280 IUSE="+acl daemon gd +mysqli postgres"
281 REQUIRED_USE="|| ( mysqli postgres )"
282
283 -PHP_SLOTS="7.4 7.3"
284 +PHP_SLOTS="8.0 7.4 7.3"
285 PHP_USE="gd?,mysqli?,postgres?,curl,fileinfo,intl,json(+),pdo,unicode,xml"
286
287 php_rdepend() {
288 @@ -52,14 +52,9 @@ need_httpd_cgi # From webapp.eclass
289
290 S="${WORKDIR}/${PN}"
291
292 -src_configure() {
293 - hprefixify config.php-dist
294 -
295 - sed -i -r \
296 - -e "/'DB_TYPE'/s:,.*:, '$(usex mysqli mysql pgsql)'); // mysql or pgsql:" \
297 - -e "/'CHECK_FOR_UPDATES'/s/true/false/" \
298 - config.php-dist || die
299 -}
300 +PATCHES=(
301 + "${FILESDIR}"/${PN}-no-chmod.patch
302 +)
303
304 src_install() {
305 webapp_src_preinst
306 @@ -77,10 +72,10 @@ src_install() {
307 done
308
309 if use daemon; then
310 - webapp_hook_script "${FILESDIR}"/permissions
311 + webapp_hook_script "${FILESDIR}"/permissions-r1
312 webapp_postinst_txt en "${FILESDIR}"/postinstall-en-with-daemon-r1.txt
313
314 - newinitd "${FILESDIR}"/ttrssd.initd-r3 ttrssd
315 + newinitd "${FILESDIR}"/ttrssd.initd-r4 ttrssd
316 newconfd "${FILESDIR}"/ttrssd.confd-r2 ttrssd
317
318 insinto /etc/logrotate.d
319 @@ -93,8 +88,3 @@ src_install() {
320
321 webapp_src_install
322 }
323 -
324 -pkg_postinst() {
325 - elog "You need to merge config.php-dist into config.php manually when upgrading."
326 - webapp_pkg_postinst
327 -}
328
329 diff --git a/www-apps/tt-rss/tt-rss-99999999.ebuild b/www-apps/tt-rss/tt-rss-99999999.ebuild
330 index 25e4a31621d6..e91fad7a3c67 100644
331 --- a/www-apps/tt-rss/tt-rss-99999999.ebuild
332 +++ b/www-apps/tt-rss/tt-rss-99999999.ebuild
333 @@ -1,9 +1,9 @@
334 # Copyright 1999-2022 Gentoo Authors
335 # Distributed under the terms of the GNU General Public License v2
336
337 -EAPI=7
338 +EAPI=8
339
340 -inherit git-r3 prefix webapp
341 +inherit git-r3 webapp
342
343 DESCRIPTION="Tiny Tiny RSS - A web-based news feed (RSS/Atom) aggregator using AJAX"
344 HOMEPAGE="https://tt-rss.org/"
345 @@ -50,13 +50,9 @@ DEPEND="
346
347 need_httpd_cgi # From webapp.eclass
348
349 -src_configure() {
350 - hprefixify config.php-dist
351 -
352 - sed -i -r \
353 - -e "/'DB_TYPE'/s:,.*:, '$(usex mysqli mysql pgsql)'); // mysql or pgsql:" \
354 - config.php-dist || die
355 -}
356 +PATCHES=(
357 + "${FILESDIR}"/${PN}-no-chmod.patch
358 +)
359
360 src_install() {
361 webapp_src_preinst
362 @@ -74,10 +70,10 @@ src_install() {
363 done
364
365 if use daemon; then
366 - webapp_hook_script "${FILESDIR}"/permissions
367 + webapp_hook_script "${FILESDIR}"/permissions-r1
368 webapp_postinst_txt en "${FILESDIR}"/postinstall-en-with-daemon-r1.txt
369
370 - newinitd "${FILESDIR}"/ttrssd.initd-r3 ttrssd
371 + newinitd "${FILESDIR}"/ttrssd.initd-r4 ttrssd
372 newconfd "${FILESDIR}"/ttrssd.confd-r2 ttrssd
373
374 insinto /etc/logrotate.d
375 @@ -92,8 +88,6 @@ src_install() {
376 }
377
378 pkg_postinst() {
379 - elog "You need to merge config.php-dist into config.php manually when upgrading."
380 -
381 if use vhosts && [[ -n ${REPLACING_VERSIONS} ]]; then
382 elog
383 elog "The live ebuild does not automatically upgrade your installations so"