diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2015-01-05 01:04:32 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2015-01-05 01:04:32 +0300 |
commit | 403a9c3d57e61ce31b06bc04aff3784cfc9b1d65 (patch) | |
tree | c418a4a3b96506f5560b579893ef835649cf5329 /net-im | |
parent | b023ea7c7f68b3b7d676b8187cf6b3bc5bbdb2f0 (diff) |
spectrum tmp ebuild
Diffstat (limited to 'net-im')
-rw-r--r-- | net-im/spectrum/files/spectrum.cfg | 152 | ||||
-rw-r--r-- | net-im/spectrum/files/spectrum.confd | 7 | ||||
-rw-r--r-- | net-im/spectrum/files/spectrum.initd | 24 | ||||
-rwxr-xr-x | net-im/spectrum/files/spectrum2.initd | 29 | ||||
-rw-r--r-- | net-im/spectrum/files/spectrum2.patch | 44 | ||||
-rw-r--r-- | net-im/spectrum/spectrum-scm.ebuild | 84 |
6 files changed, 340 insertions, 0 deletions
diff --git a/net-im/spectrum/files/spectrum.cfg b/net-im/spectrum/files/spectrum.cfg new file mode 100644 index 0000000..ae53573 --- /dev/null +++ b/net-im/spectrum/files/spectrum.cfg @@ -0,0 +1,152 @@ +[service] +# enable this spectrum instance +enable=1 + +# one of: aim, facebook, gg, icq, irc, msn, myspace, qq, simple, xmpp, yahoo +protocol=$filename:protocol + +# component ip +server=127.0.0.1 + +# if use_proxy is 1, the http_proxy env var will be used as the proxy server +# for example export http_proxy="http://user:passwd@your.proxy.server:port/" +use_proxy=0 + +# component JID +jid=$filename:protocol.localhost + +# component secret +password=secret + +# component port +port=$filename:port + +config_interface = /var/run/spectrum/$filename:protocol.sock + +# IP:port where filetransfer proxy binds to. This has to be public IP. +#filetransfer_bind_address=192.0.2.1:12345 + +# IP:port which will be sent in filetransfer request as stream host. +#filetransfer_public_address=192.0.2.1:12345 + +# admin JIDs - Jabber IDs of transport administrators who have access to admin adhoc commands +# separated by semicolons +#admins=admin@localhost;foo@bar.cz + +# directory where downloaded files will be saved +filetransfer_cache=/var/lib/spectrum/$filename:protocol/filetransfer_cache + +# URL used to acces filestransfer_cache directory from the web. +filetransfer_web=http://localhost/files/ + +# name of transport (this will appear in service discovery) +name=My $filename:protocol Transport + +# default language +language=en + +# transport features separated by semicolons +# combination of: avatars, chatstate, filetransfer +# if commented, all features will be used +# This variable is DEPRECATED and will be removed in future versions. Use [features] instead. +#transport_features = avatars;chatstate;filetransfer + +# if vip_mode is 1, users are divided to 2 groups according to 'vip' database field +vip_mode=0 + +# if vip_mode is 1, you can set transport to be availabe only for VIP users by setting only_for_vip to 1. +only_for_vip=0 + +# if vip_mode is 1 and only_for_vip is 1, users can connect from these servers even they are not VIP. +# This feature is useful, if you want to enable transport only for users from your server, but also want +# to give access to VIP users from other servers (for example from GTalk) +# seperated by semicolons +#allowed_servers=localhost + +# transport features separated by semicolons which will be used for VIP users. +# combination of: avatars, chatstate, filetransfer +# if commented, all features will be used +# This variable is DEPRECATED and will be removed in future versions. Use [vip-features] instead. +#vip_features = avatars;chatstate;filetransfer + +# pid file +pid_file=/var/run/spectrum/$filename:protocol.pid + +# require_tls to connect legacy network +#require_tls=false + +# Eventloop used by Spectrum. Allows to change default use of poll to epoll, +# which should be faster and handles more connections better. +# WARNING: some 3rd party libpurple protocol plugins are not prepared to be +# used with different eventloop, but protocols included in libpurple by default +# works OK. +#eventloop=glib + +[registration] +# Set to 0 to disable transport registration to everyone except +# people from host from allowed_servers list. +#enable_public_registration=1 + +# You can override username registered by transport user. This is useful +# for example if you want to let users to register only their Facebook name +# and internally connect them to facebook_name@chat.facebook.com. +# $username variable is replaced by username which has been registered +# by particular user. +#username_mask = $username@chat.facebook.com + +# This option allows you to white-list newly created accounts according +# to regexp. for example allowed_usernames=*.\.gmail\.com$ will allow only +# GTalk users to register. If you use username_mask, then username_mask is +# applied before this option. +#allowed_usernames=regexp + +# Label used to described username field in registration form +#username_label = Facebook username + +# This variable overrides default instructions text in registration form. +#instructions = Type your Facebook name here: + +# Transport features, all features are enabled by default. +[features] +#filetransfer=1 +#avatars=1 +#chatstates=1 +#statistics=1 + +# Transport features for VIP users, all features are enabled by default. +[vip-features] +#filetransfer=1 +#avatars=1 +#chatstates=1 + +[logging] +# log file, needs to be unique for each spectrum instance +log_file=/var/log/spectrum/$filename:protocol.log + +# log areas +# combination of: xml, purple +log_areas=xml;purple + +[database] +# mysql or sqlite +type=sqlite + +# hostname (not needed for sqlite) +#host=localhost + +# username (not needed for sqlite) +#user=user + +# password (not needed for sqlite) +#password=password +# sqlite: set path to database file here +# mysql: set to name of database +database=/var/lib/spectrum/$filename:protocol/database/$filename:protocol.sqlite +# table prefix for multiple transport instances sharing the same database +#prefix=$filename:protocol_ + +[purple] +# avatar, vcard, roster storage +# needs to be unique for each spectrum instance +userdir=/var/lib/spectrum/$filename:protocol/userdir + diff --git a/net-im/spectrum/files/spectrum.confd b/net-im/spectrum/files/spectrum.confd new file mode 100644 index 0000000..f0c55f8 --- /dev/null +++ b/net-im/spectrum/files/spectrum.confd @@ -0,0 +1,7 @@ +# /etc/conf.d/spectrum.PROTOCOL: config file for spectrum PROTOCOL transport + +# Configfile +CONFFILE="/etc/spectrum/PROTOCOL.cfg" + +# PID +PIDFILE="/var/run/spectrum/PROTOCOL.pid" diff --git a/net-im/spectrum/files/spectrum.initd b/net-im/spectrum/files/spectrum.initd new file mode 100644 index 0000000..132efc8 --- /dev/null +++ b/net-im/spectrum/files/spectrum.initd @@ -0,0 +1,24 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +PROTOCOL=${SVCNAME#*.} + +depend() { + need net + use jabber-server +} + +start() { + ebegin "Starting ${PROTOCOL} Spectrum Transport" + start-stop-daemon --start --pidfile ${PIDFILE} \ + --user jabber --group jabber --exec /usr/bin/spectrum -- ${CONFFILE} + eend $? +} + +stop() { + ebegin "Stopping ${PROTOCOL} Spectrum Transport" + start-stop-daemon --stop --quiet --pidfile ${PIDFILE} + eend $? +} diff --git a/net-im/spectrum/files/spectrum2.initd b/net-im/spectrum/files/spectrum2.initd new file mode 100755 index 0000000..623da53 --- /dev/null +++ b/net-im/spectrum/files/spectrum2.initd @@ -0,0 +1,29 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +LOGFILE=EPREFIX/var/log/spectrum2/std.log +SPECTRUMMANAGER=EPREFIX/usr/bin/spectrum2_manager +SPECTRUMRUN=EPREFIX/var/run/spectrum2 + +depend() { + need net + use jabber-server +} + +start() { + ebegin "Starting ${PROTOCOL} Spectrum Transport" + mkdir -p "$SPECTRUMRUN" + chown jabber:jabber "${SPECTRUMRUN}" + start-stop-daemon --start --user jabber --group jabber \ + --exec "$SPECTRUMMANAGER" start &> "$LOGFILE" + eend $? +} + +stop() { + ebegin "Stopping ${PROTOCOL} Spectrum Transport" + start-stop-daemon --user jabber --group jabber \ + --exec "$SPECTRUMMANAGER" stop 1>>"$LOGFILE" 2>&1 + eend $? +} diff --git a/net-im/spectrum/files/spectrum2.patch b/net-im/spectrum/files/spectrum2.patch new file mode 100644 index 0000000..859c15f --- /dev/null +++ b/net-im/spectrum/files/spectrum2.patch @@ -0,0 +1,44 @@ +diff -Naur libtransport/cmake_modules/SwiftenConfig.cmake libtransport2/cmake_modules/SwiftenConfig.cmake +--- libtransport/cmake_modules/SwiftenConfig.cmake 2015-01-05 00:56:53.394900918 +0300 ++++ libtransport2/cmake_modules/SwiftenConfig.cmake 2015-01-05 00:49:12.000000000 +0300 +@@ -1,38 +1,7 @@ + FIND_LIBRARY(SWIFTEN_LIBRARY NAMES Swiften HINTS ../lib) + FIND_PATH(SWIFTEN_INCLUDE_DIR NAMES "Swiften/Swiften.h" PATH_SUFFIXES libSwiften Swiften HINTS ../include) + +-if( SWIFTEN_LIBRARY AND SWIFTEN_INCLUDE_DIR ) +- find_program(SWIFTEN_CONFIG_EXECUTABLE NAMES swiften-config DOC "swiften-config executable" HINTS ../bin) +- set( SWIFTEN_CFLAGS "" ) +- if (SWIFTEN_CONFIG_EXECUTABLE) +- execute_process( +- COMMAND ${SWIFTEN_CONFIG_EXECUTABLE} --libs +- OUTPUT_VARIABLE SWIFTEN_LIB) +- string(REGEX REPLACE "[\r\n]" " " SWIFTEN_LIB ${SWIFTEN_LIB}) +- string(REGEX REPLACE " +$" "" SWIFTEN_LIB ${SWIFTEN_LIB}) +- string(REGEX REPLACE " " ";" SWIFTEN_LIB ${SWIFTEN_LIB}) +- set(SWIFTEN_LIBRARY "") +- foreach(f ${SWIFTEN_LIB}) +- STRING(SUBSTRING ${f} 0 2 f_out) +- STRING(COMPARE EQUAL ${f_out} "/L" IS_PATH) +- if(${IS_PATH}) +- string(REGEX REPLACE "/LIBPATH:" "" f_replaced "${f}") +- message("Added link directory: ${f_replaced}") +- link_directories(${f_replaced}) +- else() +- list(APPEND SWIFTEN_LIBRARY ${f}) +- endif() +- endforeach(f) +- set( SWIFTEN_FOUND 1 ) +- else() +- message( STATUS "Could NOT find swiften-config" ) +- endif() ++set(SWIFTEN_LIBRARY "Swiften") + +- if (SWIFTEN_FOUND) +- set( SWIFTEN_INCLUDE_DIR ${SWIFTEN_INCLUDE_DIR} ) +- message( STATUS "Found libSwiften: ${SWIFTEN_LIBRARY}, ${SWIFTEN_INCLUDE_DIR}") +- endif() ++set( SWIFTEN_FOUND 1 ) + +-else( SWIFTEN_LIBRARY AND SWIFTEN_INCLUDE_DIR ) +- message( STATUS "Could NOT find libSwiften" ) +-endif( SWIFTEN_LIBRARY AND SWIFTEN_INCLUDE_DIR ) diff --git a/net-im/spectrum/spectrum-scm.ebuild b/net-im/spectrum/spectrum-scm.ebuild new file mode 100644 index 0000000..47ed86b --- /dev/null +++ b/net-im/spectrum/spectrum-scm.ebuild @@ -0,0 +1,84 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="4" + +inherit cmake-utils ${VCS_ECLASS} git-2 + +DESCRIPTION="Spectrum is an XMPP transport/gateway" +HOMEPAGE="http://spectrum.im" + + EGIT_REPO_URI="git://github.com/hanzz/libtransport.git" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="" + +IUSE_PLUGINS="frotz irc purple skype smstools" +IUSE="debug doc libev log mysql postgres sqlite staticport symlinks test tools ${IUSE_PLUGINS}" + +RDEPEND="net-im/jabber-base + net-im/swiften + dev-libs/popt + dev-libs/openssl + log? ( dev-libs/log4cxx ) + mysql? ( virtual/mysql ) + postgres? ( dev-libs/libpqxx ) + sqlite? ( dev-db/sqlite:3 ) + frotz? ( dev-libs/protobuf ) + irc? ( <net-im/libcommuni-3 dev-libs/protobuf ) + purple? ( >=net-im/pidgin-2.6.0 dev-libs/protobuf ) + skype? ( dev-libs/dbus-glib x11-base/xorg-server[xvfb] dev-libs/protobuf ) + libev? ( dev-libs/libev dev-libs/protobuf )" + +# TODO unlock libcommuni-3 when merged https://github.com/hanzz/libtransport/pull/50 + +DEPEND="${RDEPEND} + sys-devel/gettext + dev-util/cmake + doc? ( app-doc/doxygen ) + test? ( dev-util/cppunit ) + " + +REQUIRED_USE="|| ( sqlite mysql postgres )" + +PROTOCOL_LIST="aim facebook gg icq irc msn msn_pecan myspace qq simple sipe twitter xmpp yahoo" + +pkg_setup() { + CMAKE_IN_SOURCE_BUILD=1 + use debug && CMAKE_BUILD_TYPE=Debug + MYCMAKEARGS="-DLIB_INSTALL_DIR=$(get_libdir)" +} + +src_prepare() { + epatch "${FILESDIR}"/spectrum2.patch + use sqlite || { sed -i -e 's/find_package(sqlite3)/set(SQLITE3_FOUND FALSE)/' CMakeLists.txt || die; } + use mysql || { sed -i -e 's/find_package(mysql)/set(MYSQL_FOUND FALSE)/' CMakeLists.txt || die; } + use postgres || { sed -i -e 's/find_package(pqxx)/set(PQXX_FOUND FALSE)/' CMakeLists.txt || die; } + use test || { sed -i -e 's/find_package(cppunit)/set(CPPUNIT_FOUND FALSE)/' CMakeLists.txt || die; } + use doc || { sed -i -e 's/find_package(Doxygen)/set(DOXYGEN_FOUND FALSE)/' CMakeLists.txt || die; } + use purple || { sed -i -e '/find_package(purple)/d' CMakeLists.txt || die; } + use libev || { sed -i -e 's/find_package(event)/set(HAVE_EVENT FALSE)/' CMakeLists.txt || die; } + use irc || { sed -i -e 's/find_package(Communi)/set(IRC_FOUND, FALSE)/' CMakeLists.txt || die; } + use log || { sed -i -e 's/find_package(log4cxx)/set(LOG4CXX_FOUND, FALSE)/' CMakeLists.txt || die; } + + cmake-utils_src_prepare +} + +src_install() { + cmake-utils_src_install + + cat "${FILESDIR}"/spectrum2.initd | sed "s:EPREFIX:${EPREFIX}:" > \ + "${WORKDIR}/initd" + newinitd "${WORKDIR}/initd" spectrum + keepdir "${EPREFIX}"/var/lib/spectrum2 + keepdir "${EPREFIX}"/var/log/spectrum2 +} + +pkg_postinst() { + # Set correct rights + chown jabber:jabber -R "/etc/spectrum2" + chown jabber:jabber "${EPREFIX}"/var/lib/spectrum2 + chown jabber:jabber "${EPREFIX}"/var/log/spectrum2 +} |