summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreroen2014-03-07 19:07:24 (GMT)
committereroen2014-03-07 19:11:08 (GMT)
commit87ef9063b6829781c0a13e03ee86e8ac25e97d6f (patch)
tree9e413d569097a78e3091d22192a16196408256ef
parentdd3dfc15a3aed18a46f07b4d79215086a02d126f (diff)
downloaderoen-overlay-87ef9063b6829781c0a13e03ee86e8ac25e97d6f.tar.gz
eroen-overlay-87ef9063b6829781c0a13e03ee86e8ac25e97d6f.tar.bz2
eroen-overlay-87ef9063b6829781c0a13e03ee86e8ac25e97d6f.tar.xz
isso - add init script
-rwxr-xr-xwww-apps/isso/files/isso.confd29
-rwxr-xr-xwww-apps/isso/files/isso.initd33
-rw-r--r--www-apps/isso/isso-9999.ebuild13
3 files changed, 73 insertions, 2 deletions
diff --git a/www-apps/isso/files/isso.confd b/www-apps/isso/files/isso.confd
new file mode 100755
index 0000000..5b6837c
--- /dev/null
+++ b/www-apps/isso/files/isso.confd
@@ -0,0 +1,29 @@
+#!/sbin/runscript
+# By eroen, 2014
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+
+### These are default values for /etc/init.d/isso .
+
+# If you wish to run several instances, you might prefer to create a symlink to
+# the isso init script named isso.<instancename> in /etc/init.d/ and copy the
+# configuration file to /etc/isso.<instancename>.conf .
+#ISSO_CONF="/etc/isso.conf"
+#ISSO_LOG="/var/log/isso.log"
+#ISSO_USER="isso:isso"
+
+### End of default values.
+
+
+# If your isso instance needs to be accessible or can only reach your website
+# over the network, you should ensure a network interface is up when it is
+# started.
+#rc_need=${rc_need} net.eth0
+
+# If your website is hosted on the same box the isso instance runs on, you need
+# to ensure the webserver is up before isso is started.
+#rc_need=${rc_need} lighttpd
+
+# vim: ft=gentoo-conf-d
diff --git a/www-apps/isso/files/isso.initd b/www-apps/isso/files/isso.initd
new file mode 100755
index 0000000..9c483f9
--- /dev/null
+++ b/www-apps/isso/files/isso.initd
@@ -0,0 +1,33 @@
+#!/sbin/runscript
+# By eroen, 2014
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+
+ISSO_CONF=${ISSO_CONF:-"/etc/${RC_SVCNAME}.conf"}
+ISSO_LOG=${ISSO_LOG:-"/var/log/${RC_SVCNAME}.log"}
+ISSO_USER=${ISSO_USER:-"${RC_SVCNAME%%.*}:${RC_SVCNAME%%.*}"}
+
+description="lightweight Disqus alternative"
+start_stop_daemon_args="--user ${ISSO_USER} --stderr ${ISSO_LOG}"
+command=/usr/bin/${RC_SVCNAME%%.*}
+command_args="-c ${ISSO_CONF} run"
+command_background=true
+pidfile="/var/run/${RC_SVCNAME}.pid"
+required_files="${ISSO_CONF}"
+
+depend() {
+ need localmount
+ after bootmisc
+
+ use mta
+ after net apache lighttpd nginx
+}
+
+start_pre() {
+ checkpath -f -o "${ISSO_USER}" "${ISSO_LOG}"
+ checkpath -W "${ISSO_LOG}"
+}
+
+# vim: set ft=gentoo-init-d
diff --git a/www-apps/isso/isso-9999.ebuild b/www-apps/isso/isso-9999.ebuild
index 2812aee..d195ed8 100644
--- a/www-apps/isso/isso-9999.ebuild
+++ b/www-apps/isso/isso-9999.ebuild
@@ -18,14 +18,14 @@ EAPI=5
PYTHON_COMPAT=( python2_7 )
if [[ $PV == *9999* ]]; then
- inherit distutils-r1 git-r3
+ inherit user distutils-r1 git-r3
EGIT_REPO_URI=https://github.com/posativ/isso.git
JS_REPO_URIS=( https://github.com/jrburke/almond.git
https://github.com/jrburke/r.js.git
https://github.com/requirejs/text.git )
VCS_DEPEND="dev-vcs/git[curl]"
else
- inherit distutils-r1
+ inherit user distutils-r1
SRC_URI=mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz
fi
@@ -62,6 +62,10 @@ DEPEND="${HDEPEND}\
${LIBDEPEND}"
RDEPEND="${LIBDEPEND}"
+pkg_setup() {
+ enewuser ${PN}
+}
+
src_fetch() {
if [[ ${PV} == *9999* ]]; then
git-r3_src_fetch
@@ -132,9 +136,14 @@ python_test() {
python_install_all() {
distutils-r1_python_install_all
+
if [[ ${PV} == *9999* ]]; then
insinto /etc
newins docs/isso.example.cfg isso.conf
use doc && dodoc -r "${T}"/html
fi
+ # TODO: Find an example config for non-live version
+
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
}