Gentoo Archives: gentoo-commits

From: Johannes Huber <johu@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] dev/johu:master commit in: net-irc/quassel/, net-irc/quassel/files/
Date: Tue, 01 Apr 2014 09:07:43
Message-Id: 1396343244.2f53357bfc4eb6e86790076fce6b5f6223d16423.johu@gentoo
1 commit: 2f53357bfc4eb6e86790076fce6b5f6223d16423
2 Author: Johannes Huber <johu <AT> gentoo <DOT> org>
3 AuthorDate: Tue Apr 1 09:07:24 2014 +0000
4 Commit: Johannes Huber <johu <AT> gentoo <DOT> org>
5 CommitDate: Tue Apr 1 09:07:24 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=dev/johu.git;a=commit;h=2f53357b
7
8 [net-irc/quassel] Import from tree for maintenance
9
10 Package-Manager: portage-2.2.10
11
12 ---
13 net-irc/quassel/files/quassel.logrotate | 9 ++
14 net-irc/quassel/files/quasselcore.conf | 22 ++++
15 net-irc/quassel/files/quasselcore.init | 63 +++++++++++
16 net-irc/quassel/metadata.xml | 49 +++++++++
17 net-irc/quassel/quassel-9999.ebuild | 178 ++++++++++++++++++++++++++++++++
18 5 files changed, 321 insertions(+)
19
20 diff --git a/net-irc/quassel/files/quassel.logrotate b/net-irc/quassel/files/quassel.logrotate
21 new file mode 100644
22 index 0000000..8e72083
23 --- /dev/null
24 +++ b/net-irc/quassel/files/quassel.logrotate
25 @@ -0,0 +1,9 @@
26 +/var/log/quassel.log {
27 + compress
28 + rotate 4
29 + weekly
30 + delaycompress
31 + copytruncate
32 + missingok
33 + notifempty
34 +}
35
36 diff --git a/net-irc/quassel/files/quasselcore.conf b/net-irc/quassel/files/quasselcore.conf
37 new file mode 100644
38 index 0000000..6e1304d
39 --- /dev/null
40 +++ b/net-irc/quassel/files/quasselcore.conf
41 @@ -0,0 +1,22 @@
42 +# Copyright 1999-2010 Gentoo Foundation
43 +# Distributed under the terms of the GNU General Public License v2
44 +# $Header: $
45 +
46 +# Loglevel Debug|Info|Warning|Error. Default is: Info
47 +# The logfile is located at /var/log/quassel.log.
48 +#LOGLEVEL="Info"
49 +
50 +# The address(es) quasselcore will listen on. Default is 0.0.0.0
51 +#LISTEN="0.0.0.0"
52 +
53 +# The port quasselcore will listen at. Default is: 4242
54 +#PORT="4242"
55 +
56 +# User we want our daemon to run under.
57 +#USER="quassel"
58 +
59 +# Directory we store all quasselcore content.
60 +#CONFIGDIR="/var/lib/quassel"
61 +
62 +# File quasselcore will log all its events into.
63 +#LOGFILE="/var/log/quassel.log"
64 \ No newline at end of file
65
66 diff --git a/net-irc/quassel/files/quasselcore.init b/net-irc/quassel/files/quasselcore.init
67 new file mode 100644
68 index 0000000..06d73cb
69 --- /dev/null
70 +++ b/net-irc/quassel/files/quasselcore.init
71 @@ -0,0 +1,63 @@
72 +#!/sbin/runscript
73 +# Copyright 1999-2011 Gentoo Foundation
74 +# Distributed under the terms of the GNU General Public License v2
75 +# $Header: $
76 +
77 +depend() {
78 + need localmount net
79 + after bootmisc postgres
80 +}
81 +
82 +CORE="$(which quasselcore)"
83 +PID="/var/run/quassel.pid"
84 +LOGFILE=${LOGFILE:-"/var/log/quassel.log"}
85 +CONFIGDIR=${CONFIGDIR:-"/var/lib/quassel"}
86 +QUASSEL_USER=${QUASSEL_USER:-"quassel"}
87 +
88 +checkconfig() {
89 + # set defaults
90 + LOGLEVEL=${LOGLEVEL:-"Info"}
91 +
92 + # check config folder
93 + if [ ! -d "${CONFIGDIR}" ]; then
94 + mkdir "${CONFIGDIR}" || return 1
95 + fi
96 + # permissions always changed just to avoid runtime issues
97 + chown -R "${QUASSEL_USER}":"${QUASSEL_USER}" "${CONFIGDIR}" || return 1
98 +
99 + # check log file
100 + if [ ! -e "${LOGFILE}" ]; then
101 + touch "${LOGFILE}" || return 1
102 + fi
103 + # permissions always changed just to avoid runtime issues
104 + chown "${QUASSEL_USER}":"${QUASSEL_USER}" "${LOGFILE}" || return 1
105 +}
106 +
107 +start() {
108 + checkconfig || return 1
109 +
110 + ebegin "Starting Quassel Core"
111 +
112 + if [ -n "${RC_UNAME}" ]; then
113 + # running on baselayout-2/openrc
114 + start-stop-daemon --start --user "${QUASSEL_USER}" --background --make-pidfile \
115 + --pidfile "${PID}" \
116 + --exec "${CORE}" -- --logfile="${LOGFILE}" --loglevel="${LOGLEVEL}" \
117 + ${LISTEN:+--listen="${LISTEN}"} ${PORT:+--port="${PORT}"} \
118 + --configdir="${CONFIGDIR}"
119 + else
120 + # running on baselayout-1
121 + start-stop-daemon --start --chuid "${QUASSEL_USER}" --background --make-pidfile \
122 + --pidfile "${PID}" --env HOME="${CONFIGDIR}" \
123 + --exec "${CORE}" -- --logfile="${LOGFILE}" --loglevel="${LOGLEVEL}" \
124 + ${LISTEN:+--listen="${LISTEN}"} ${PORT:+--port="${PORT}"} \
125 + --configdir="${CONFIGDIR}"
126 + fi
127 + eend $?
128 +}
129 +
130 +stop() {
131 + ebegin "Stopping Quassel Core"
132 + start-stop-daemon --stop --pidfile "${PID}" --exec "${CORE}"
133 + eend $?
134 +}
135
136 diff --git a/net-irc/quassel/metadata.xml b/net-irc/quassel/metadata.xml
137 new file mode 100644
138 index 0000000..2703085
139 --- /dev/null
140 +++ b/net-irc/quassel/metadata.xml
141 @@ -0,0 +1,49 @@
142 +<?xml version="1.0" encoding="UTF-8"?>
143 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
144 +<pkgmetadata>
145 + <herd>net-irc</herd>
146 + <herd>proxy-maintainers</herd>
147 + <maintainer>
148 + <email>patrick@g.o</email>
149 + </maintainer>
150 + <maintainer>
151 + <email>johu@g.o</email>
152 + <name>Johannes Huber</name>
153 + </maintainer>
154 + <maintainer>
155 + <email>sputnick@×××××××××××.org</email>
156 + <description>Upstream author, please CC on bugs</description>
157 + </maintainer>
158 + <use>
159 + <flag name="monolithic">
160 + Build Standalone client with integrated core, no external
161 + quasselcore needed. Only useful if you don't want to use quassels
162 + client/server model. The server and X flags are not needed in this
163 + case but it is possible to enable them too.
164 + </flag>
165 + <flag name="phonon">
166 + Build client with phonon backend support. This enables sound
167 + playback in client.
168 + </flag>
169 + <flag name="server">
170 + Build the server binary. If this USE flag is disabled, the
171 + 'core' server binary for quassel is not built, and cannot be
172 + used. You need this enabled on the server, but you might want to
173 + disable it on the client.
174 + </flag>
175 + <flag name="webkit">
176 + Use qt-webkit rendering engine for showing URL thumbnails and
177 + for other things that need web browser integration.
178 + </flag>
179 + <flag name="X">
180 + Build the Qt 4 GUI client for quassel. If this USE flag is
181 + disabled, the GUI is not built, and cannot be used. You might
182 + want to disable this on the server, but you need it enabled on
183 + the client.
184 + </flag>
185 + <flag name="crypt">
186 + Support core->network per-channel and per-query blowfish
187 + encryption via <pkg>app-crypt/qca:2</pkg>.
188 + </flag>
189 + </use>
190 +</pkgmetadata>
191
192 diff --git a/net-irc/quassel/quassel-9999.ebuild b/net-irc/quassel/quassel-9999.ebuild
193 new file mode 100644
194 index 0000000..b0c8647
195 --- /dev/null
196 +++ b/net-irc/quassel/quassel-9999.ebuild
197 @@ -0,0 +1,178 @@
198 +# Copyright 1999-2014 Gentoo Foundation
199 +# Distributed under the terms of the GNU General Public License v2
200 +# $Header: /var/cvsroot/gentoo-x86/net-irc/quassel/quassel-9999.ebuild,v 1.69 2014/03/27 00:44:32 mrueg Exp $
201 +
202 +EAPI=5
203 +
204 +inherit cmake-utils eutils pax-utils user versionator
205 +
206 +EGIT_REPO_URI="git://git.quassel-irc.org/quassel.git"
207 +EGIT_BRANCH="master"
208 +[[ "${PV}" == "9999" ]] && inherit git-2
209 +
210 +QT_MINIMAL="4.6.0"
211 +KDE_MINIMAL="4.4"
212 +
213 +DESCRIPTION="Qt4/KDE4 IRC client supporting a remote daemon for 24/7 connectivity."
214 +HOMEPAGE="http://quassel-irc.org/"
215 +[[ "${PV}" == "9999" ]] || SRC_URI="http://quassel-irc.org/pub/${P/_/-}.tar.bz2"
216 +
217 +LICENSE="GPL-3"
218 +KEYWORDS=""
219 +SLOT="0"
220 +IUSE="ayatana crypt dbus debug kde monolithic phonon postgres +server +ssl syslog webkit X"
221 +
222 +SERVER_RDEPEND="
223 + >=dev-qt/qtscript-${QT_MINIMAL}:4
224 + crypt? (
225 + app-crypt/qca:2
226 + app-crypt/qca-ossl
227 + )
228 + !postgres? ( >=dev-qt/qtsql-${QT_MINIMAL}:4[sqlite] dev-db/sqlite:3[threadsafe(+),-secure-delete] )
229 + postgres? ( >=dev-qt/qtsql-${QT_MINIMAL}:4[postgres] )
230 + syslog? ( virtual/logger )
231 +"
232 +
233 +GUI_RDEPEND="
234 + >=dev-qt/qtgui-${QT_MINIMAL}:4
235 + ayatana? ( dev-libs/libindicate-qt )
236 + dbus? (
237 + >=dev-qt/qtdbus-${QT_MINIMAL}:4
238 + dev-libs/libdbusmenu-qt
239 + )
240 + kde? (
241 + >=kde-base/kdelibs-${KDE_MINIMAL}
242 + >=kde-base/oxygen-icons-${KDE_MINIMAL}
243 + ayatana? ( kde-misc/plasma-widget-message-indicator )
244 + )
245 + phonon? ( || ( media-libs/phonon >=dev-qt/qtphonon-${QT_MINIMAL}:4 ) )
246 + webkit? ( >=dev-qt/qtwebkit-${QT_MINIMAL}:4 )
247 +"
248 +
249 +RDEPEND="
250 + >=dev-qt/qtcore-${QT_MINIMAL}:4[ssl?]
251 + monolithic? (
252 + ${SERVER_RDEPEND}
253 + ${GUI_RDEPEND}
254 + )
255 + !monolithic? (
256 + server? ( ${SERVER_RDEPEND} )
257 + X? ( ${GUI_RDEPEND} )
258 + )
259 + "
260 +DEPEND="${RDEPEND}
261 + kde? ( dev-util/automoc )"
262 +
263 +DOCS="AUTHORS ChangeLog README"
264 +
265 +S="${WORKDIR}/${P/_/-}"
266 +
267 +REQUIRED_USE="
268 + || ( X server monolithic )
269 + crypt? ( || ( server monolithic ) )
270 + postgres? ( || ( server monolithic ) )
271 + syslog? ( || ( server monolithic ) )
272 + kde? ( || ( X monolithic ) )
273 + phonon? ( || ( X monolithic ) )
274 + dbus? ( || ( X monolithic ) )
275 + ayatana? ( || ( X monolithic ) )
276 + webkit? ( || ( X monolithic ) )
277 +"
278 +
279 +pkg_setup() {
280 + if use server; then
281 + QUASSEL_DIR=/var/lib/${PN}
282 + QUASSEL_USER=${PN}
283 + # create quassel:quassel user
284 + enewgroup "${QUASSEL_USER}"
285 + enewuser "${QUASSEL_USER}" -1 -1 "${QUASSEL_DIR}" "${QUASSEL_USER}"
286 + fi
287 +}
288 +
289 +src_configure() {
290 + local mycmakeargs=(
291 + $(cmake-utils_use_with ayatana LIBINDICATE)
292 + $(cmake-utils_use_want X QTCLIENT)
293 + $(cmake-utils_use_want server CORE)
294 + $(cmake-utils_use_want monolithic MONO)
295 + $(cmake-utils_use_with webkit)
296 + $(cmake-utils_use_with phonon)
297 + $(cmake-utils_use_with kde)
298 + $(cmake-utils_use_with dbus)
299 + $(cmake-utils_use_with ssl OPENSSL)
300 + $(cmake-utils_use_with syslog)
301 + $(cmake-utils_use_with !kde OXYGEN)
302 + $(cmake-utils_use_with crypt)
303 + "-DEMBED_DATA=OFF"
304 + )
305 +
306 + cmake-utils_src_configure
307 +}
308 +
309 +src_install() {
310 + cmake-utils_src_install
311 +
312 + if use server ; then
313 + # needs PAX marking wrt bug#346255
314 + pax-mark m "${ED}/usr/bin/quasselcore"
315 +
316 + # prepare folders in /var/
317 + keepdir "${QUASSEL_DIR}"
318 + fowners "${QUASSEL_USER}":"${QUASSEL_USER}" "${QUASSEL_DIR}"
319 +
320 + # init scripts
321 + newinitd "${FILESDIR}"/quasselcore.init quasselcore
322 + newconfd "${FILESDIR}"/quasselcore.conf quasselcore
323 +
324 + # logrotate
325 + insinto /etc/logrotate.d
326 + newins "${FILESDIR}/quassel.logrotate" quassel
327 + fi
328 +}
329 +
330 +pkg_postinst() {
331 + if use monolithic && use ssl ; then
332 + elog "Information on how to enable SSL support for client/core connections"
333 + elog "is available at http://bugs.quassel-irc.org/wiki/quassel-irc."
334 + fi
335 +
336 + if use server; then
337 + einfo "If you want to generate SSL certificate remember to run:"
338 + einfo " emerge --config =${CATEGORY}/${PF}"
339 + fi
340 +
341 + if use server || use monolithic ; then
342 + einfo "Quassel can use net-misc/oidentd package if installed on your system."
343 + einfo "Consider installing it if you want to run quassel within identd daemon."
344 + fi
345 +
346 + # temporary info mesage
347 + if use server && [[ $(get_version_component_range 2 ${REPLACING_VERSIONS}) -lt 7 ]]; then
348 + echo
349 + ewarn "Please note that all configuration moved from"
350 + ewarn "/home/\${QUASSEL_USER}/.config/quassel-irc.org/"
351 + ewarn "to: ${QUASSEL_DIR}."
352 + echo
353 + ewarn "For migration, stop the core, move quasselcore files (pretty much"
354 + ewarn "everything apart from quasselclient.conf and settings.qss) into"
355 + ewarn "new location and then start server again."
356 + fi
357 +}
358 +
359 +pkg_config() {
360 + if use server && use ssl; then
361 + # generate the pem file only when it does not already exist
362 + if [ ! -f "${QUASSEL_DIR}/quasselCert.pem" ]; then
363 + einfo "Generating QUASSEL SSL certificate to: \"${QUASSEL_DIR}/quasselCert.pem\""
364 + openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
365 + -keyout "${QUASSEL_DIR}/quasselCert.pem" \
366 + -out "${QUASSEL_DIR}/quasselCert.pem"
367 + # permissions for the key
368 + chown ${QUASSEL_USER}:${QUASSEL_USER} "${QUASSEL_DIR}/quasselCert.pem"
369 + chmod 400 "${QUASSEL_DIR}/quasselCert.pem"
370 + else
371 + einfo "Certificate \"${QUASSEL_DIR}/quasselCert.pem\" already exists."
372 + einfo "Remove it if you want to create new one."
373 + fi
374 + fi
375 +}