diff options
author | Tomas Chvatal <scarabeus@gentoo.org> | 2010-07-01 10:34:03 +0000 |
---|---|---|
committer | Tomas Chvatal <scarabeus@gentoo.org> | 2010-07-01 10:34:03 +0000 |
commit | de2bdbc6633941966c2b1f253a30080d80e73bb6 (patch) | |
tree | aa4a913c12fdfbcc5a89a43569db6b707888bbb1 /net-irc/quassel | |
parent | stable x86, security bug 326413 (diff) | |
download | gentoo-2-de2bdbc6633941966c2b1f253a30080d80e73bb6.tar.gz gentoo-2-de2bdbc6633941966c2b1f253a30080d80e73bb6.tar.bz2 gentoo-2-de2bdbc6633941966c2b1f253a30080d80e73bb6.zip |
Redo the live ebuild quite bit. Do not die in pkg_setup. Move confighome to system location.
(Portage version: 2.2_rc67/cvs/Linux x86_64)
Diffstat (limited to 'net-irc/quassel')
-rw-r--r-- | net-irc/quassel/ChangeLog | 7 | ||||
-rw-r--r-- | net-irc/quassel/files/quasselcore.conf | 13 | ||||
-rw-r--r-- | net-irc/quassel/files/quasselcore.init | 60 | ||||
-rw-r--r-- | net-irc/quassel/quassel-9999.ebuild | 69 |
4 files changed, 130 insertions, 19 deletions
diff --git a/net-irc/quassel/ChangeLog b/net-irc/quassel/ChangeLog index 19bb885cbcac..d3be24adc119 100644 --- a/net-irc/quassel/ChangeLog +++ b/net-irc/quassel/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for net-irc/quassel # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-irc/quassel/ChangeLog,v 1.88 2010/06/17 20:48:46 patrick Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-irc/quassel/ChangeLog,v 1.89 2010/07/01 10:34:03 scarabeus Exp $ + + 01 Jul 2010; Tomáš Chvátal <scarabeus@gentoo.org> quassel-9999.ebuild, + +files/quasselcore.conf, +files/quasselcore.init: + Redo the live ebuild quite bit. Do not die in pkg_setup. Move confighome + to system location. 17 Jun 2010; Patrick Lauer <patrick@gentoo.org> quassel-0.5.1.ebuild, quassel-0.5.2.ebuild: diff --git a/net-irc/quassel/files/quasselcore.conf b/net-irc/quassel/files/quasselcore.conf new file mode 100644 index 000000000000..e677b4026b5e --- /dev/null +++ b/net-irc/quassel/files/quasselcore.conf @@ -0,0 +1,13 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-irc/quassel/files/quasselcore.conf,v 1.4 2010/07/01 10:34:03 scarabeus Exp $ + +# Loglevel Debug|Info|Warning|Error. Default is: Info +# The logfile is located at /var/log/quassel.log. +LOGLEVEL="Info" + +# The address(es) quasselcore will listen on. Default is 0.0.0.0 +LISTEN="0.0.0.0" + +# The port quasselcore will listen at. Default is: 4242 +PORT="4242" diff --git a/net-irc/quassel/files/quasselcore.init b/net-irc/quassel/files/quasselcore.init new file mode 100644 index 000000000000..8dacba7c7356 --- /dev/null +++ b/net-irc/quassel/files/quasselcore.init @@ -0,0 +1,60 @@ +#!/sbin/runscript +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-irc/quassel/files/quasselcore.init,v 1.5 2010/07/01 10:34:03 scarabeus Exp $ + +depend() { + need net + use postgres +} + +LOGFILE="/var/log/quassel.log" +CORE="$(which quasselcore)" +PID="/var/run/quassel.pid" +CONFIGDIR="/var/lib/quassel/" +QUASSEL_USER="quassel" + +checkconfig() { + # check config folder + if [ ! -d "${CONFIGDIR}" ]; then + mkdir ${CONFIGDIR} || return 1 + fi + # permissions always changed just to avoid runtime issues + chown -r ${QUASSEL_USER}:${QUASSEL_USER} ${CONFIGDIR} || return 1 + + # check log file + if [ ! -e "${LOGFILE}" ]; then + touch ${LOGFILE} || return 1 + fi + # permissions always changed just to avoid runtime issues + chown ${QUASSEL_USER}:${QUASSEL_USER} ${LOGFILE} || return 1 +} + +start() { + checkconfig || return 1 + + ebegin "Starting Quassel Core" + + if [ -n "${RC_UNAME}" ]; then + # running on baselayout-2/openrc + start-stop-daemon --start --user ${QUASSEL_USER} --background --make-pidfile \ + --pidfile ${PID} \ + --exec ${CORE} -- --logfile=${LOGFILE} --loglevel=${LOGLEVEL:-"Info"} \ + --listen=${LISTEN:-"0.0.0.0"} --port=${PORT:-"4242"} \ + --configdir=${CONFIGDIR:-"/var/lib/quassel/"} + else + # running on baselayout-1 + start-stop-daemon --start --chuid ${QUASSEL_USER} --background --make-pidfile \ + --pidfile ${PID} --env HOME="/var/lib/quassel/" \ + --exec ${CORE} -- --logfile=${LOGFILE} --loglevel=${LOGLEVEL:-"Info"} \ + --listen=${LISTEN:-"0.0.0.0"} --port=${PORT:-"4242"} \ + --configdir=${CONFIGDIR:-"/var/lib/quassel/"} + fi + eend $? +} + +stop() { + ebegin "Stopping Quassel Core" + start-stop-daemon --stop --pidfile ${PID} --exec ${CORE} + eend $? +} diff --git a/net-irc/quassel/quassel-9999.ebuild b/net-irc/quassel/quassel-9999.ebuild index a94e94fd105d..5052711f5b1c 100644 --- a/net-irc/quassel/quassel-9999.ebuild +++ b/net-irc/quassel/quassel-9999.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-irc/quassel/quassel-9999.ebuild,v 1.35 2010/06/07 16:33:42 billie Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-irc/quassel/quassel-9999.ebuild,v 1.36 2010/07/01 10:34:03 scarabeus Exp $ EAPI="2" @@ -46,6 +46,14 @@ RDEPEND=" X? ( ${GUI_RDEPEND} ) ) ssl? ( x11-libs/qt-core:4[ssl] ) + !monolithic? ( + !server? ( + !X? ( + ${SERVER_RDEPEND} + ${GUI_RDEPEND} + ) + ) + ) " DEPEND="${RDEPEND}" @@ -53,14 +61,16 @@ DOCS="AUTHORS ChangeLog README" pkg_setup() { if ! use monolithic && ! use server && ! use X ; then - eerror "You have to build at least one of the monolithic client (USE=monolithic)," - eerror "the quasselclient (USE=X) or the quasselcore (USE=server)." - die "monolithic, server and X flag unset." + ewarn "You have to build at least one of the monolithic client (USE=monolithic)," + ewarn "the quasselclient (USE=X) or the quasselcore (USE=server)." + echo + ewarn "Enabling monolithic by default." + FORCED_MONO="yes" fi } src_configure() { - local mycmakeargs=" + local mycmakeargs=( $(cmake-utils_use_with ayatana LIBINDICATE) $(cmake-utils_use_want X QTCLIENT) $(cmake-utils_use_want server CORE) @@ -71,8 +81,10 @@ src_configure() { $(cmake-utils_use_with dbus) $(cmake-utils_use_with ssl OPENSSL) $(cmake-utils_use_with !kde OXYGEN) - -DEMBED_DATA=OFF - " + "-DEMBED_DATA=OFF" + ) + + [[ ${FORCED_MONO} == "yes" ]] && mycmakeargs+=( '-DWANT_MONO=ON' ) cmake-utils_src_configure } @@ -81,26 +93,47 @@ src_install() { cmake-utils_src_install if use server ; then - newinitd "${FILESDIR}"/quasselcore-2.init quasselcore || die "newinitd failed" - newconfd "${FILESDIR}"/quasselcore-2.conf quasselcore || die "newconfd failed" + # prepare folders in /var/ + dodir /var/lib/${PN}/ + keepdir /var/lib/${PN}/ + fowners ${PN}:${PN} /var/lib/${PN}/ + + # init scripts + newinitd "${FILESDIR}"/quasselcore.init quasselcore || die "newinitd failed" + newconfd "${FILESDIR}"/quasselcore.conf quasselcore || die "newconfd failed" + # logrotate insinto /etc/logrotate.d - newins "${FILESDIR}/quassel.logrotate" quassel + newins "${FILESDIR}/quassel.logrotate" quassel || die "newins failed" fi } +pkg_preinst() { + # create quassel user + enewuser ${PN} -1 -1 /var/lib/${PN} "${PN}" +} + pkg_postinst() { - if use server ; then - ewarn - ewarn "In order to use the quassel init script you must set the" - ewarn "QUASSEL_USER variable in ${ROOT%/}/etc/conf.d/quasselcore to your username." - ewarn "Note: This is the user who runs the quasselcore and is independent" - ewarn "from the users you set up in the quasselclient." + if use server && use ssl; then + # inform about genreating ssl certificate + elog "If you want to use ssl connection to your core, please generate ssl key, with folowing command:" + elog "# openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /var/lib/${PN}/quasselCert.pem -ou" + echo + elog "Also remember that with the above command the key is valid only for 1 year." fi - if ( use server || use monolithic ) && use ssl ; then - elog + if ( use monolithic || [[ ${FORCED_MONO} == "yes" ]] ) && use ssl ; then + echo elog "Information on how to enable SSL support for client/core connections" elog "is available at http://bugs.quassel-irc.org/wiki/quassel-irc." fi + + # temporary info mesage + if use server; then + ewarn "Please note that all configuration moved from" + ewarn "/home/\${QUASSEL_USER}/.config/quassel-irc.org/" + ewarn "to: /var/lib/${PN}/." + echo + ewarn "For migration. Stop the core, move the files to new location and then start server again." + fi } |