From 87ef9063b6829781c0a13e03ee86e8ac25e97d6f Mon Sep 17 00:00:00 2001 From: eroen Date: Fri, 7 Mar 2014 20:07:24 +0100 Subject: isso - add init script --- www-apps/isso/files/isso.confd | 29 +++++++++++++++++++++++++++++ www-apps/isso/files/isso.initd | 33 +++++++++++++++++++++++++++++++++ www-apps/isso/isso-9999.ebuild | 13 +++++++++++-- 3 files changed, 73 insertions(+), 2 deletions(-) create mode 100755 www-apps/isso/files/isso.confd create mode 100755 www-apps/isso/files/isso.initd diff --git a/www-apps/isso/files/isso.confd b/www-apps/isso/files/isso.confd new file mode 100755 index 00000000..5b6837cc --- /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. in /etc/init.d/ and copy the +# configuration file to /etc/isso..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 00000000..9c483f99 --- /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 2812aee9..d195ed8b 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} } -- cgit v1.2.1