aboutsummaryrefslogtreecommitdiff
path: root/www/tt-rss
diff options
context:
space:
mode:
authorDerek Schrock <dereks@lifeofadishwasher.com>2023-05-13 21:20:07 +0000
committerKoichiro Iwao <meta@FreeBSD.org>2023-05-15 04:34:57 +0000
commit9b9114f7e7c81d53d9dc1f261a6ff9cf92826176 (patch)
tree0358448651576dcd8c036294d164ec9bfd609bdc /www/tt-rss
parentebfe8d52734b841544b58faae7d952911fd31533 (diff)
downloadports-9b9114f7e7c81d53d9dc1f261a6ff9cf92826176.tar.gz
ports-9b9114f7e7c81d53d9dc1f261a6ff9cf92826176.zip
www/tt-rss: Update to g20230509 and move database drivers to post config
- Update to g20230509 11946f014 - Move php database drivers a post install operation allowing the port to support both databases without having to make option changes or rebuilds. - Update ttrssd to check for the configured driver PR: 271397
Diffstat (limited to 'www/tt-rss')
-rw-r--r--www/tt-rss/Makefile28
-rw-r--r--www/tt-rss/distinfo6
-rw-r--r--www/tt-rss/files/pkg-message.in7
-rw-r--r--www/tt-rss/files/ttrss_db_check.php.in8
-rw-r--r--www/tt-rss/files/ttrssd.in25
-rw-r--r--www/tt-rss/pkg-plist1
6 files changed, 54 insertions, 21 deletions
diff --git a/www/tt-rss/Makefile b/www/tt-rss/Makefile
index 95188b47f223..ec348958373c 100644
--- a/www/tt-rss/Makefile
+++ b/www/tt-rss/Makefile
@@ -1,5 +1,5 @@
PORTNAME= tt-rss
-PORTVERSION= g20230413
+PORTVERSION= g20230509
PORTEPOCH= 2
CATEGORIES= www
@@ -15,7 +15,7 @@ USES= gettext-tools php:cli,web shebangfix
USE_GITLAB= yes
GL_SITE= https://gitlab.tt-rss.org
-GL_COMMIT= 0578bf802571781a0a7e3debbbec66437a7d28b4
+GL_COMMIT= 11946f0148d0b8a76ecc120fd9c1dc0b7fa04664
USE_PHP= ctype dom exif fileinfo filter iconv intl mbstring openssl \
pcntl pdo phar posix session simplexml tokenizer xml xmlwriter \
@@ -29,18 +29,22 @@ REINPLACE_ARGS= -i ""
NO_ARCH= yes
NO_BUILD= yes
-SUB_FILES= config.php httpd-tt-rss.conf pkg-message
-SUB_LIST= MYSQL=${MYSQL} \
- PGSQL=${PGSQL} \
+# Instead of depending on the extact database driver list php packages that tt-rss
+# depends on during install pkg-message as a post install setup.
+# mysql: php-mysqli php-pdo_mysql
+# pgsql: php-pgsql php-pdo_pgsql
+#
+# from Mk/Uses/php.mk create sub vars for mysqli/pdo_mysql pgsql/pdo_pgsql values
+SUB_FILES= config.php httpd-tt-rss.conf pkg-message ttrss_db_check.php
+SUB_LIST= MYSQL_DEPS="${mysqli_DEPENDS:T} ${pdo_mysql_DEPENDS:T}" \
+ PGSQL_DEPS="${pgsql_DEPENDS:T} ${pdo_pgsql_DEPENDS:T}" \
WWWOWN=${WWWOWN}
PLIST_SUB= WWWGRP=${WWWGRP} \
WWWOWN=${WWWOWN}
OPTIONS_DEFINE= CURL GD
-OPTIONS_DEFAULT= CURL GD MYSQL
-OPTIONS_SINGLE= DB
-OPTIONS_SINGLE_DB= MYSQL PGSQL
+OPTIONS_DEFAULT= CURL GD
CURL_DESC= Use SimplePie instead of Magpie
GD_DESC= Use OTP QR code generation
@@ -48,12 +52,6 @@ GD_DESC= Use OTP QR code generation
CURL_USE= PHP=curl
GD_USE= PHP=gd
-MYSQL_USE= PHP=mysqli,pdo_mysql
-MYSQL_VARS_OFF= MYSQL="\#"
-
-PGSQL_USE= PHP=pdo_pgsql,pgsql
-PGSQL_VARS_OFF= PGSQL="\#"
-
do-install:
${MKDIR} \
${STAGEDIR}${WWWDIR} \
@@ -68,6 +66,8 @@ do-install:
${RM} ${STAGEDIR}${WWWDIR}/config.php-dist
${INSTALL_DATA} ${WRKDIR}/config.php \
${STAGEDIR}${WWWDIR}/config.php.sample
+ ${INSTALL_DATA} ${WRKDIR}/ttrss_db_check.php \
+ ${STAGEDIR}${WWWDIR}/ttrss_db_check.php
${INSTALL_DATA} ${FILESDIR}/newsyslog.sample \
${STAGEDIR}${EXAMPLESDIR}
diff --git a/www/tt-rss/distinfo b/www/tt-rss/distinfo
index bd1e0fbc5158..dbafe558bf0f 100644
--- a/www/tt-rss/distinfo
+++ b/www/tt-rss/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1682227775
-SHA256 (tt-rss-tt-rss-0578bf802571781a0a7e3debbbec66437a7d28b4_GL0.tar.gz) = 76ec95062cfe868f6530c790e93f2dfe8ad40019b1015ce0e5b1398abc08e5df
-SIZE (tt-rss-tt-rss-0578bf802571781a0a7e3debbbec66437a7d28b4_GL0.tar.gz) = 8489761
+TIMESTAMP = 1684011742
+SHA256 (tt-rss-tt-rss-11946f0148d0b8a76ecc120fd9c1dc0b7fa04664_GL0.tar.gz) = e561b30e047ad727a91eb8e8597add2d4210b46f5404855c5cf6a8a93cde5bc7
+SIZE (tt-rss-tt-rss-11946f0148d0b8a76ecc120fd9c1dc0b7fa04664_GL0.tar.gz) = 8490369
diff --git a/www/tt-rss/files/pkg-message.in b/www/tt-rss/files/pkg-message.in
index 34bf547f3560..a0602b7e0475 100644
--- a/www/tt-rss/files/pkg-message.in
+++ b/www/tt-rss/files/pkg-message.in
@@ -3,6 +3,13 @@
message: <<EOM
Tiny Tiny RSS is now installed, but it requires some additional setup.
+Install your corresponding php database drivers:
+
+ msyql: mysqli pdo_mysql
+ pkg install %%MYSQL_DEPS%%
+ postgresql: pgsql pdo_pgsql
+ pkg install %%PGSQL_DEPS%%
+
You now need to create a database, a database user, configure the
web server, and configure tt-rss. Sample apache24 configs located
at %%DATADIR%%/httpd-tt-rss.conf.
diff --git a/www/tt-rss/files/ttrss_db_check.php.in b/www/tt-rss/files/ttrss_db_check.php.in
new file mode 100644
index 000000000000..a8b72d8b76fe
--- /dev/null
+++ b/www/tt-rss/files/ttrss_db_check.php.in
@@ -0,0 +1,8 @@
+<?php
+chdir("%%WWWDIR%%");
+
+require_once "%%WWWDIR%%/classes/config.php";
+require_once "%%WWWDIR%%/include/functions.php";
+
+print(strtolower(Config::get(Config::DB_TYPE)));
+?>
diff --git a/www/tt-rss/files/ttrssd.in b/www/tt-rss/files/ttrssd.in
index 21bfde025c73..07b7a38e1c8e 100644
--- a/www/tt-rss/files/ttrssd.in
+++ b/www/tt-rss/files/ttrssd.in
@@ -23,6 +23,7 @@ load_rc_config "${name}"
: ${ttrssd_local_db:="YES"}
initdb_php="%%WWWDIR%%/update.php"
+dbcheck_php="%%WWWDIR%%/ttrss_db_check.php"
required_files="%%WWWDIR%%/config.php"
pidfile="/var/run/${name}.pid"
ppidfile="/var/run/${name}_parent.pid"
@@ -37,10 +38,10 @@ start_precmd=${name}_prestart
start_cmd=${name}_start
stop_cmd=${name}_stop
-%%MYSQL%%CHECK_CMD="%%LOCALBASE%%/bin/mysqladmin -u mysqld ping"
-%%MYSQL%%CHECK_MSG="${name}: mysqladmin command failed; mysql not ready?"
-%%PGSQL%%CHECK_CMD="%%LOCALBASE%%/bin/pg_isready"
-%%PGSQL%%CHECK_MSG="${name}: postgresql status failed; postgresql not ready?"
+MYSQL_CHECK_CMD="%%LOCALBASE%%/bin/mysqladmin -u mysqld ping"
+MYSQL_CHECK_MSG="${name}: mysqladmin command failed; mysql not ready?"
+PGSQL_CHECK_CMD="%%LOCALBASE%%/bin/pg_isready"
+PGSQL_CHECK_MSG="${name}: postgresql status failed; postgresql not ready?"
ttrssd_start() {
if ! [ -x $phpcli ]; then
@@ -75,6 +76,22 @@ ttrssd_prestart() {
if checkyesno ttrssd_local_db; then
# Wait for the local database to be started
+ database="$("$phpcli" -f "$dbcheck_php")"
+
+ case "$database" in
+ "mysql")
+ CHECK_CMD="$MYSQL_CHECK_CMD"
+ CHECK_MSG="$MYSQL_CHECK_MSG"
+ ;;
+ "pgsql")
+ CHECK_CMD="$PGSQL_CHECK_CMD"
+ CHECK_MSG="$PGSQL_CHECK_MSG"
+ ;;
+ *)
+ err 1 "Unknown database configured: $database"
+ ;;
+ esac
+
for n in $(seq 1 10); do
if $CHECK_CMD > /dev/null 2>&1; then
return
diff --git a/www/tt-rss/pkg-plist b/www/tt-rss/pkg-plist
index 257ffb6f3f02..3405bdf3b0a5 100644
--- a/www/tt-rss/pkg-plist
+++ b/www/tt-rss/pkg-plist
@@ -2017,6 +2017,7 @@
%%WWWDIR%%/plugins/toggle_sidebar/init.php
%%WWWDIR%%/prefs.php
%%WWWDIR%%/public.php
+%%WWWDIR%%/ttrss_db_check.php
%%WWWDIR%%/schema/ttrss_schema_mysql.sql
%%WWWDIR%%/schema/ttrss_schema_pgsql.sql
%%WWWDIR%%/sql/mysql/migrations/3.sql