summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkos Chandras <hwoarang@gentoo.org>2011-07-17 15:09:07 +0000
committerMarkos Chandras <hwoarang@gentoo.org>2011-07-17 15:09:07 +0000
commit576ae80b0c838eb0201c403bad6e1a1653b94cec (patch)
tree6b2e183f64491a45f33b6b17a57576ffd595ada9 /www-apps
parentppc64 stable wrt #368239 (diff)
downloadgentoo-2-576ae80b0c838eb0201c403bad6e1a1653b94cec.tar.gz
gentoo-2-576ae80b0c838eb0201c403bad6e1a1653b94cec.tar.bz2
gentoo-2-576ae80b0c838eb0201c403bad6e1a1653b94cec.zip
Version bump. Introducing init script and logrotate file. Thanks to Patrick Nagel <mail@patrick-nagel.net>
(Portage version: 2.2.0_alpha43/cvs/Linux x86_64)
Diffstat (limited to 'www-apps')
-rw-r--r--www-apps/tt-rss/ChangeLog10
-rw-r--r--www-apps/tt-rss/files/postinstall-en-with-daemon.txt14
-rw-r--r--www-apps/tt-rss/files/ttrssd.confd3
-rw-r--r--www-apps/tt-rss/files/ttrssd.initd43
-rw-r--r--www-apps/tt-rss/files/ttrssd.logrotated8
-rw-r--r--www-apps/tt-rss/metadata.xml3
-rw-r--r--www-apps/tt-rss/tt-rss-1.5.5.ebuild71
7 files changed, 151 insertions, 1 deletions
diff --git a/www-apps/tt-rss/ChangeLog b/www-apps/tt-rss/ChangeLog
index f47ce7831a8f..c00e2b7930d7 100644
--- a/www-apps/tt-rss/ChangeLog
+++ b/www-apps/tt-rss/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for www-apps/tt-rss
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/www-apps/tt-rss/ChangeLog,v 1.1 2011/07/03 12:37:42 hwoarang Exp $
+# $Header: /var/cvsroot/gentoo-x86/www-apps/tt-rss/ChangeLog,v 1.2 2011/07/17 15:09:07 hwoarang Exp $
+
+*tt-rss-1.5.5 (17 Jul 2011)
+
+ 17 Jul 2011; Markos Chandras <hwoarang@gentoo.org> +tt-rss-1.5.5.ebuild,
+ +files/postinstall-en-with-daemon.txt, +files/ttrssd.confd,
+ +files/ttrssd.initd, +files/ttrssd.logrotated:
+ Version bump. Introducing init script and logrotate file. Thanks to Patrick
+ Nagel <mail@patrick-nagel.net>
*tt-rss-1.5.4 (03 Jul 2011)
diff --git a/www-apps/tt-rss/files/postinstall-en-with-daemon.txt b/www-apps/tt-rss/files/postinstall-en-with-daemon.txt
new file mode 100644
index 000000000000..ff5544c042c5
--- /dev/null
+++ b/www-apps/tt-rss/files/postinstall-en-with-daemon.txt
@@ -0,0 +1,14 @@
+Please read http://tt-rss.org/redmine/wiki/tt-rss/InstallationNotes
+
+Once you have configured TT-RSS, put the path to this instance into
+the INSTANCE_DIRS variable in /etc/conf.d/ttrssd. Make sure that
+the ttrssd user can access the path, and then start the update daemon
+with
+
+ /etc/init.d/ttrssd start
+
+to get your feeds updated. Add the daemon to your default runlevel,
+so that it gets launched after a system restart:
+
+ rc-update add ttrssd default
+
diff --git a/www-apps/tt-rss/files/ttrssd.confd b/www-apps/tt-rss/files/ttrssd.confd
new file mode 100644
index 000000000000..20e11660a1d3
--- /dev/null
+++ b/www-apps/tt-rss/files/ttrssd.confd
@@ -0,0 +1,3 @@
+# List paths to your TT-RSS instances to start their update daemons
+# Example: INSTANCE_DIRS="/some/webhost/htdocs/tt-rss /some/otherwebhost/htdocs/newsreader"
+INSTANCE_DIRS=""
diff --git a/www-apps/tt-rss/files/ttrssd.initd b/www-apps/tt-rss/files/ttrssd.initd
new file mode 100644
index 000000000000..f3496389c42d
--- /dev/null
+++ b/www-apps/tt-rss/files/ttrssd.initd
@@ -0,0 +1,43 @@
+#!/sbin/runscript
+
+LOGFILE=/var/log/ttrssd.log
+
+depend() {
+ need logger net
+}
+
+start () {
+ ebegin "Starting TT-RSS update daemon(s)"
+ [ -z "${INSTANCE_DIRS}" ] && { echo "No instance directories specified in /etc/conf.d/ttrssd."; exit 1; }
+
+ # Make sure the log file can be written to
+ touch ${LOGFILE} && chown ttrssd ${LOGFILE}
+
+ for INSTANCE_DIR in ${INSTANCE_DIRS}; do
+ [ -f "${INSTANCE_DIR}/update_daemon2.php" ] || continue
+ einfo " ${INSTANCE_DIR}"
+
+ # Since I have no idea how I could do this during the webapp-config installation,
+ # lets do it during start up...
+ for DIR in cache cache/htmlpurifier cache/magpie cache/simplepie lock icons; do
+ chgrp ttrssd "${INSTANCE_DIR}/${DIR}"
+ chmod g+w "${INSTANCE_DIR}/${DIR}"
+ done
+
+ # Finally run the PHP script
+ start-stop-daemon --start -u ttrssd:ttrssd -b \
+ -1 /var/log/ttrssd.log -2 /var/log/ttrssd.log \
+ -x /usr/bin/php "${INSTANCE_DIR}/update_daemon2.php"
+ done
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping TT-RSS update daemon(s)"
+ for INSTANCE_DIR in ${INSTANCE_DIRS}; do
+ [ -f "${INSTANCE_DIR}/update_daemon2.php" ] || continue
+ einfo " ${INSTANCE_DIR}"
+ start-stop-daemon --stop -x /usr/bin/php "${INSTANCE_DIR}/update_daemon2.php"
+ done
+ eend $?
+}
diff --git a/www-apps/tt-rss/files/ttrssd.logrotated b/www-apps/tt-rss/files/ttrssd.logrotated
new file mode 100644
index 000000000000..9616a98c3029
--- /dev/null
+++ b/www-apps/tt-rss/files/ttrssd.logrotated
@@ -0,0 +1,8 @@
+/var/log/ttrssd.log {
+ daily
+ missingok
+ notifempty
+ postrotate
+ /etc/init.d/ttrssd restart > /dev/null
+ endscript
+}
diff --git a/www-apps/tt-rss/metadata.xml b/www-apps/tt-rss/metadata.xml
index ad473023fbb8..d5926ad264f8 100644
--- a/www-apps/tt-rss/metadata.xml
+++ b/www-apps/tt-rss/metadata.xml
@@ -12,4 +12,7 @@
<name>Patrick Nagel</name>
<description>Maintainer. Assign bugs to him</description>
</maintainer>
+<use>
+ <flag name="daemon">Install additional init scripts for automated RSS updates</flag>
+</use>
</pkgmetadata>
diff --git a/www-apps/tt-rss/tt-rss-1.5.5.ebuild b/www-apps/tt-rss/tt-rss-1.5.5.ebuild
new file mode 100644
index 000000000000..178f7749652e
--- /dev/null
+++ b/www-apps/tt-rss/tt-rss-1.5.5.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-apps/tt-rss/tt-rss-1.5.5.ebuild,v 1.1 2011/07/17 15:09:07 hwoarang Exp $
+
+EAPI="2"
+
+inherit eutils webapp depend.php depend.apache
+
+DESCRIPTION="Tiny Tiny RSS - A web-based news feed (RSS/Atom) aggregator using AJAX"
+HOMEPAGE="http://tt-rss.org/"
+SRC_URI="http://tt-rss.org/download/${P}.tar.gz"
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64"
+IUSE="daemon mysql postgres"
+
+DEPEND="dev-lang/php[mysql?,postgres?]"
+RDEPEND="${DEPEND}"
+
+need_httpd_cgi
+need_php_httpd
+use daemon && need_php_cli
+
+pkg_setup() {
+ webapp_pkg_setup
+ use mysql && require_php_with_use mysql
+ use postgres && require_php_with_use postgres
+ if use daemon; then
+ require_php_with_use pcntl
+ einfo "Checking for ttrssd group ..."
+ enewgroup ttrssd || die "Failed to check/add needed group"
+ einfo "Checking for ttrssd user ..."
+ enewuser ttrssd -1 /bin/sh /dev/null ttrssd || die "Failed to check/add needed user"
+ fi
+}
+
+src_prepare() {
+ # Customize config.php so that the right 'DB_TYPE' is already set (according to the USE flag)
+ einfo "Customizing config.php..."
+ mv config.php{-dist,} || die "Could not rename config.php-dist to config.php."
+ if use mysql && ! use postgres; then
+ sed -e "/define('DB_TYPE',/{s:pgsql:mysql:}" -i config.php || die "sed failed"
+ fi
+ sed -e "/define('DB_TYPE',/{s:// \(or mysql\):// pgsql \1:}" -i config.php \
+ || die "sed failed"
+}
+
+src_install() {
+ webapp_src_preinst
+
+ insinto "/${MY_HTDOCSDIR}"
+ doins -r * || die "Could not copy the files to ${MY_HTDOCSDIR}."
+ keepdir "/${MY_HTDOCSDIR}"/icons
+
+ insinto /etc/logrotate.d/
+ newins "${FILESDIR}"/ttrssd.logrotated ttrssd || die "Installing ttrssd logrotate config failed."
+
+ for DIR in cache cache/htmlpurifier cache/magpie cache/simplepie lock icons; do
+ webapp_serverowned "${MY_HTDOCSDIR}/${DIR}"
+ done
+ webapp_configfile "${MY_HTDOCSDIR}"/config.php
+ if use daemon; then
+ webapp_postinst_txt en "${FILESDIR}"/postinstall-en-with-daemon.txt
+ newinitd "${FILESDIR}"/ttrssd.initd ttrssd
+ newconfd "${FILESDIR}"/ttrssd.confd ttrssd
+ else
+ webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
+ fi
+
+ webapp_src_install
+}