Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Apr 2016 19:19:36 +0000 (UTC)
From:      Thierry Thomas <thierry@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r413313 - in head: . www/tt-rss www/tt-rss/files
Message-ID:  <201604141919.u3EJJaN5005592@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: thierry
Date: Thu Apr 14 19:19:36 2016
New Revision: 413313
URL: https://svnweb.freebsd.org/changeset/ports/413313

Log:
  Replace the option DBLOCAL by a flag in /etc/rc.conf.
  
  PR:		208410
  Submitted by:	john (at) johnanddalene.net

Modified:
  head/UPDATING
  head/www/tt-rss/Makefile
  head/www/tt-rss/files/pkg-message.in
  head/www/tt-rss/files/ttrssd.in

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Thu Apr 14 19:08:31 2016	(r413312)
+++ head/UPDATING	Thu Apr 14 19:19:36 2016	(r413313)
@@ -6,6 +6,18 @@ You should get into the habit of checkin
 you update your ports collection, before attempting any port upgrades.
 
 20160414:
+  AFFECTS: Users of www/tt-rss
+  AUTHOR: thierry@FreeBSD.org
+
+  Tiny Tiny RSS can use a database running on a separate server.
+  Previously, in this case, you had to set the option DBLOCAL; this option
+  has been removed and replaced by a settable run-time flag: now you
+  should set
+  ttrssd_local_db="NO"
+  in your /etc/rc.conf .
+
+
+20160414:
   AFFECTS: Users of graphics/kipi-plugin-googledrive and graphics/kipi-plugin-picasaweb
   AUTHOR: kde@FreeBSD.org
 

Modified: head/www/tt-rss/Makefile
==============================================================================
--- head/www/tt-rss/Makefile	Thu Apr 14 19:08:31 2016	(r413312)
+++ head/www/tt-rss/Makefile	Thu Apr 14 19:19:36 2016	(r413313)
@@ -3,6 +3,7 @@
 
 PORTNAME=	tt-rss
 PORTVERSION=	16.1.2016.02.23
+PORTREVISION=	1
 CATEGORIES=	www
 MASTER_SITES=	https://tt-rss.org/gitlab/fox/tt-rss/repository/archive${EXTRACT_SUFX}?ref=${GL_TAGNAME}&num;/
 
@@ -26,13 +27,12 @@ WRKSRC=		${WRKDIR}/tt-rss.git
 
 USE_RC_SUBR=	ttrssd
 
-OPTIONS_DEFINE=	CURL GD DBLOCAL
+OPTIONS_DEFINE=	CURL GD
 OPTIONS_SINGLE=	DB
 OPTIONS_SINGLE_DB=	MYSQL PGSQL
-OPTIONS_DEFAULT=	CURL GD MYSQL DBLOCAL
+OPTIONS_DEFAULT=	CURL GD MYSQL
 CURL_DESC=	Use SimplePie instead of Magpie
 GD_DESC=	Use OTP QR code generation
-DBLOCAL_DESC=	Database is local?
 
 .include <bsd.port.options.mk>
 
@@ -58,14 +58,8 @@ USE_PHP+=	curl
 USE_PHP+=	gd
 .endif
 
-.if ${PORT_OPTIONS:MDBLOCAL}
-DBLOCAL=
-.else
-DBLOCAL=	"\#"
-.endif
-
 SUB_FILES=	httpd-tt-rss.conf pkg-message
-SUB_LIST=	DB=${DB} WWWOWN=${WWWOWN} MYSQL=${MYSQL} PGSQL=${PGSQL} DBLOCAL=${DBLOCAL}
+SUB_LIST=	DB=${DB} WWWOWN=${WWWOWN} MYSQL=${MYSQL} PGSQL=${PGSQL}
 PLIST_SUB=	WWWOWN=${WWWOWN} WWWGRP=${WWWGRP}
 PKGMESSAGE=	${WRKDIR}/pkg-message
 

Modified: head/www/tt-rss/files/pkg-message.in
==============================================================================
--- head/www/tt-rss/files/pkg-message.in	Thu Apr 14 19:08:31 2016	(r413312)
+++ head/www/tt-rss/files/pkg-message.in	Thu Apr 14 19:19:36 2016	(r413313)
@@ -21,6 +21,7 @@ Then, you should be able to check <http:
 And to update your feeds, you have to enable the daemon ttrssd in
 /etc/rc.conf and start %%PREFIX%%/etc/rc.d/ttrssd . You may also add an entry
 for /var/log/ttrssd.log in your /etc/newsyslog.conf .
+Note: set `ttrssd_local_db="NO"' if your database is on another server.
 
 Important note: after an upgrade, you have to set SINGLE_USER_MODE to true
 in your config.php; remember to modify after that if needed. And your

Modified: head/www/tt-rss/files/ttrssd.in
==============================================================================
--- head/www/tt-rss/files/ttrssd.in	Thu Apr 14 19:08:31 2016	(r413312)
+++ head/www/tt-rss/files/ttrssd.in	Thu Apr 14 19:19:36 2016	(r413313)
@@ -7,10 +7,13 @@
 # REQUIRE: LOGIN mysql postgresql
 # KEYWORD: shutdown
 
-# Add the following line to /etc/rc.conf to enable `ttrssd':
+# Add the following lines to /etc/rc.conf to enable `ttrssd':
 #
-#ttrssd_enable="YES"
+# ttrssd_enable="YES"
 #
+# ttrssd_local_db (bool):   Set to "YES" by default.
+#                           Set it to "NO" if the database is on another
+#                           server.
 
 . /etc/rc.subr
 
@@ -20,6 +23,7 @@ rcvar=ttrssd_enable
 # read settings, set default values
 load_rc_config "${name}"
 : ${ttrssd_enable="NO"}
+: ${ttrssd_local_db:="YES"}
 
 required_files="%%WWWDIR%%/config.php"
 pidfile="/var/run/${name}.pid"
@@ -30,7 +34,7 @@ phpupd="update_daemon2.php"
 ttrssd_log="/var/log/${name}.log"
 ttrssd_user="%%WWWOWN%%"
 
-%%DBLOCAL%%start_precmd=${name}_prestart
+start_precmd=${name}_prestart
 start_cmd=${name}_start
 stop_cmd=${name}_stop
 
@@ -56,7 +60,9 @@ ttrssd_stop() {
 }
 
 ttrssd_prestart() {
-local _count=0
+  if checkyesno ttrssd_local_db; then
+	# Wait for the local database to be started
+	local _count=0
 
 	while : ; do
 		$CHECK_CMD > /dev/null 2>&1 && return
@@ -67,6 +73,7 @@ local _count=0
 
 		sleep 1
 	done
+  fi
 }
 
 run_rc_command "$1"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604141919.u3EJJaN5005592>