From b748ceb005c7fb3b77c3fda5c16b5b171ef38c90 Mon Sep 17 00:00:00 2001 From: schnoebe Date: Mon, 7 Feb 2011 06:31:21 +0000 Subject: Imported spectrum from local development. spectrum is a XMPP transport using libpurple as a basis. It provides transports/gateways to a large number of libpurple supported IM systems, including AOL, Facebook, ICQ, IRC, Yahoo and MSN. --- chat/spectrum/DESCR | 4 + chat/spectrum/MESSAGE | 37 +++++++ chat/spectrum/Makefile | 106 +++++++++++++++++++++ chat/spectrum/PLIST | 41 ++++++++ chat/spectrum/distinfo | 9 ++ chat/spectrum/files/spectrum.sh | 35 +++++++ chat/spectrum/options.mk | 31 ++++++ chat/spectrum/patches/patch-CMakeLists.txt | 22 +++++ chat/spectrum/patches/patch-man_spectrumctl.8 | 55 +++++++++++ .../patches/patch-spectrumctl_spectrum_env.py | 17 ++++ .../patches/patch-spectrumctl_spectrumctl.py | 42 ++++++++ 11 files changed, 399 insertions(+) create mode 100644 chat/spectrum/DESCR create mode 100644 chat/spectrum/MESSAGE create mode 100644 chat/spectrum/Makefile create mode 100644 chat/spectrum/PLIST create mode 100644 chat/spectrum/distinfo create mode 100644 chat/spectrum/files/spectrum.sh create mode 100644 chat/spectrum/options.mk create mode 100644 chat/spectrum/patches/patch-CMakeLists.txt create mode 100644 chat/spectrum/patches/patch-man_spectrumctl.8 create mode 100644 chat/spectrum/patches/patch-spectrumctl_spectrum_env.py create mode 100644 chat/spectrum/patches/patch-spectrumctl_spectrumctl.py (limited to 'chat') diff --git a/chat/spectrum/DESCR b/chat/spectrum/DESCR new file mode 100644 index 00000000000..a23ff7a0be9 --- /dev/null +++ b/chat/spectrum/DESCR @@ -0,0 +1,4 @@ +spectrum is a XMPP transport using libpurple as a basis. + +It provides transports/gateways to a large number of libpurple supported +IM systems, including AOL, Facebook, ICQ, IRC, Yahoo and MSN. diff --git a/chat/spectrum/MESSAGE b/chat/spectrum/MESSAGE new file mode 100644 index 00000000000..b5c5b591423 --- /dev/null +++ b/chat/spectrum/MESSAGE @@ -0,0 +1,37 @@ +=========================================================================== +$NetBSD: MESSAGE,v 1.1.1.1 2011/02/07 06:31:21 schnoebe Exp $ + +Create the databases using the following files: + ${EGDIR}/spectrum-mysql.sql for MySQL + ${EGDIR}/spectrum-sqlite3.sql for sqlite3 + +To configure specturm, copy ${EGDIR}/spectrum.cfg +to a protocol specific name in ${PKG_SYSCONFDIR}, +and update the contents to reflect the protocol specific JID. + +Quick Start: + Update the following fields in the protocol specific + configuration file: + + [service] settings: + jid -- The JID (public name) of the service + ex: yahoo.jabber.example + msn.jabber.example + icq.jabber.example + + password -- the XEP-0114 componet secret + (the value of in router.xml + + protocol -- The protocol to be implemented + ex: yahoo, icq, msn + + [database] settings: + type -- sqlite or mysql, depending on build + choices. + host/user/database -- appropriate values for connecting to + the database. + +Then start the spectrum instances using spectrumctl, or +the ${PREFIX}/share/examples/rc.d/spectrum rc.d script. + +=========================================================================== diff --git a/chat/spectrum/Makefile b/chat/spectrum/Makefile new file mode 100644 index 00000000000..63ef8f93922 --- /dev/null +++ b/chat/spectrum/Makefile @@ -0,0 +1,106 @@ +# $NetBSD: Makefile,v 1.1.1.1 2011/02/07 06:31:21 schnoebe Exp $ + +DISTNAME= spectrum-1.4.7 +CATEGORIES= chat +MASTER_SITES= http://spectrum.im/attachments/download/37/ + +MAINTAINER= schnoebe@NetBSD.org +HOMEPAGE= http://spectrum.im/ +COMMENT= XMPP transport/gateway based on libpurple +LICENSE= gnu-gpl-v3 + +DEPENDS+= ${PYPKGPREFIX}-xmpppy>=0.4.1:../../chat/py-xmpppy +DEPENDS+= ${PYPKGPREFIX}-expat>=0nb4:../../textproc/py-expat + +PYTHON_VERSIONS_ACCEPTED= 26 25 + +PKG_DESTDIR_SUPPORT= user-destdir + +USE_TOOLS+= pkg-config msgfmt xgettext +USE_CMAKE= yes +USE_LANGUAGES= c++ c + +REPLACE_PYTHON+= spectrumctl/spectrumctl.py +PY_PATCHPLIST= yes + +BUILD_DEFS+= JABBER_USER JABBER_GROUP + +JABBER_USER?= jabberd +JABBER_GROUP?= jabberd + +FILES_SUBST+= JABBER_USER=${JABBER_USER:Q} +FILES_SUBST+= JABBER_GROUP=${JABBER_GROUP:Q} + +PKG_GROUPS+= ${JABBER_GROUP} +PKG_USERS+= ${JABBER_USER}:${JABBER_GROUP} + + +PKG_SYSCONFSUBDIR= spectrum +EGDIR= ${PREFIX}/share/examples/spectrum +# DOCDIR= ${PREFIX}/share/doc/spectrum +RCD_SCRIPTS= spectrum + +CONF_FILES+= ${EGDIR}/spectrum.cfg ${PKG_SYSCONFDIR}/spectrum.cfg + +.include "options.mk" + +SUBST_CLASSES+= cfgpath +SUBST_STAGE.cfgpath= post-patch +SUBST_FILES.cfgpath+= src/configfile.cpp +SUBST_FILES.cfgpath+= tools/migrate-db/main.cpp +SUBST_FILES.cfgpath+= spectrumctl/spectrumctl.py +SUBST_FILES.cfgpath+= man/spectrumctl.8 +SUBST_MESSAGE.cfgpath= Correcting configuration directory +SUBST_SED.cfgpath= -e 's,/etc/spectrum,${PKG_SYSCONFDIR},g' +SUBST_SED.cfgpath+= -e 's,@ETC_SPECTRUM@,${PKG_SYSCONFDIR},g' + +SUBST_CLASSES+= manpath +SUBST_STAGE.manpath= post-patch +SUBST_FILES.manpath= CMakeLists.txt +SUBST_MESSAGE.manpath= Correcting man page directory +SUBST_SED.manpath+= -e 's,@PKGMANDIR@,${PKGMANDIR},g' + +SUBST_CLASSES+= users +SUBST_STAGE.users= post-patch +SUBST_FILES.users= spectrumctl/spectrumctl.py +SUBST_FILES.users+= spectrumctl/spectrum/env.py +SUBST_FILES.users+= man/spectrumctl.8 +SUBST_MESSAGE.users= Correcting spectrum user +SUBST_SED.users= -e 's/@SPECTRUM_USER@/${JABBER_USER}/g' + +MESSAGE_SUBST+= EGDIR=${EGDIR} +MESSAGE_SUBST+= PREFIX=${PREFIX} +MESSAGE_SUBST+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR} + +FILES_SUBST+= PREFIX=${PREFIX} +FILES_SUBST+= JABBER_USER=${JABBER_USER} + +INSTALLATION_DIRS= bin ${PKG_SYSCONFDIR} +INSTALLATION_DIRS+= share/locales +INSTALLATION_DIRS+= ${EGDIR} +# INSTALLATION_DIRS+= ${DOCDIR} + +pre-install: + ${RM} -f ${WRKSRC}/spectrumctl/spectrumctl.py.orig + ${RM} -f ${WRKSRC}/spectrumctl/spectrum/env.py.orig + ${MKDIR} ${DESTDIR}${PKG_SYSCONFDIR} + +post-install: + ${INSTALL_DATA} ${WRKSRC}/ChangeLog ${DESTDIR}${EGDIR} + ${INSTALL_DATA} ${WRKSRC}/spectrum.cfg ${DESTDIR}${EGDIR} + ${INSTALL_DATA} ${WRKSRC}/schemas/mysql_schema.sql \ + ${DESTDIR}${EGDIR}/spectrum-mysql.sql + + +.include "../../chat/libpurple/buildlink3.mk" +.include "../../chat/gloox/buildlink3.mk" +.include "../../devel/cmake/buildlink3.mk" +.include "../../devel/gettext-lib/buildlink3.mk" +.include "../../devel/glib2/buildlink3.mk" +.include "../../devel/py-readline/buildlink3.mk" +.include "../../devel/poco/buildlink3.mk" +.include "../../graphics/ImageMagick/buildlink3.mk" +.include "../../lang/python/application.mk" +.include "../../lang/python/extension.mk" + +.include "../../mk/bsd.pkg.mk" diff --git a/chat/spectrum/PLIST b/chat/spectrum/PLIST new file mode 100644 index 00000000000..c8716c70bb1 --- /dev/null +++ b/chat/spectrum/PLIST @@ -0,0 +1,41 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2011/02/07 06:31:22 schnoebe Exp $ +bin/spectrum +bin/spectrumctl +${PYSITELIB}/spectrum/ExistsError.py +${PYSITELIB}/spectrum/ExistsError.pyc +${PYSITELIB}/spectrum/__init__.py +${PYSITELIB}/spectrum/__init__.pyc +${PYSITELIB}/spectrum/completer.py +${PYSITELIB}/spectrum/config_interface.py +${PYSITELIB}/spectrum/config_interface.pyc +${PYSITELIB}/spectrum/doc/__init__.py +${PYSITELIB}/spectrum/doc/__init__.pyc +${PYSITELIB}/spectrum/doc/doc.py +${PYSITELIB}/spectrum/doc/doc.pyc +${PYSITELIB}/spectrum/doc/epydoc.py +${PYSITELIB}/spectrum/doc/epydoc.pyc +${PYSITELIB}/spectrum/doc/interactive.py +${PYSITELIB}/spectrum/doc/man.py +${PYSITELIB}/spectrum/doc/man.pyc +${PYSITELIB}/spectrum/doc/redmine.py +${PYSITELIB}/spectrum/env.py +${PYSITELIB}/spectrum/env.pyc +${PYSITELIB}/spectrum/spectrum.py +${PYSITELIB}/spectrum/spectrum.pyc +${PYSITELIB}/spectrum/spectrum_group.py +${PYSITELIB}/spectrum/spectrum_group.pyc +${PYSITELIB}/spectrum/spectrumconfigparser.py +${PYSITELIB}/spectrum/spectrumconfigparser.pyc +man/man5/spectrum.cfg.5 +man/man8/spectrumctl.8 +share/examples/rc.d/spectrum +share/examples/spectrum/ChangeLog +share/examples/spectrum/spectrum-mysql.sql +share/examples/spectrum/spectrum.cfg +share/locale/cs/LC_MESSAGES/spectrum.mo +share/locale/de/LC_MESSAGES/spectrum.mo +share/locale/fr/LC_MESSAGES/spectrum.mo +share/locale/pl/LC_MESSAGES/spectrum.mo +share/locale/ru/LC_MESSAGES/spectrum.mo +@pkgdir etc/spectrum +@pkgdir share/locales diff --git a/chat/spectrum/distinfo b/chat/spectrum/distinfo new file mode 100644 index 00000000000..9cb4e411fe6 --- /dev/null +++ b/chat/spectrum/distinfo @@ -0,0 +1,9 @@ +$NetBSD: distinfo,v 1.1.1.1 2011/02/07 06:31:22 schnoebe Exp $ + +SHA1 (spectrum-1.4.7.tar.gz) = d07c198090ee1b0404d7641546d2feb56e912ea7 +RMD160 (spectrum-1.4.7.tar.gz) = 22db29cdd321a1fc7d77db7eb09c19cb49c963d6 +Size (spectrum-1.4.7.tar.gz) = 235303 bytes +SHA1 (patch-CMakeLists.txt) = ba2f011dd2881f1c9b98de47934834377590f2ab +SHA1 (patch-man_spectrumctl.8) = 31196aba714f6fca26c20513e677a62ec39fefb5 +SHA1 (patch-spectrumctl_spectrum_env.py) = 0c266de23d0af8d317fcd4efdfec64bb85714de3 +SHA1 (patch-spectrumctl_spectrumctl.py) = 56166fa6477a3dba56b30501f2112cd6d21db40f diff --git a/chat/spectrum/files/spectrum.sh b/chat/spectrum/files/spectrum.sh new file mode 100644 index 00000000000..13101a9ab54 --- /dev/null +++ b/chat/spectrum/files/spectrum.sh @@ -0,0 +1,35 @@ +#!@RCD_SCRIPTS_SHELL@ +# +# $NetBSD: spectrum.sh,v 1.1.1.1 2011/02/07 06:31:22 schnoebe Exp $ +# +# startup script for the spectrum jabber transport service +# +# PROVIDE: spectrum +# REQUIRE: DAEMON s2s +# +if [ -f /etc/rc.subr ]; then + . /etc/rc.subr +fi + +name="spectrum" +rcvar="$name" +procname="$name" +command=@PREFIX@/bin/spectrumctl + +start_cmd="$command start" +restart_cmd="$command restart" +stop_cmd="$command stop" + +ensure_piddir() +{ + mkdir -p @JABBER_PIDDIR@ @JABBER_LOGDIR@ + chown @JABBER_USER@ @JABBER_PIDDIR@ @JABBER_LOGDIR@ +} + +if [ -f /etc/rc.subr ]; then + load_rc_config $name + run_rc_command "$1" +else + @ECHO@ -n " ${name}" + ${command} $1 +fi diff --git a/chat/spectrum/options.mk b/chat/spectrum/options.mk new file mode 100644 index 00000000000..b4e5df2603d --- /dev/null +++ b/chat/spectrum/options.mk @@ -0,0 +1,31 @@ +# $NetBSD: options.mk,v 1.1.1.1 2011/02/07 06:31:22 schnoebe Exp $ + +PKG_OPTIONS_VAR= PKG_OPTIONS.spectrum +PKG_OPTIONS_REQUIRED_GROUPS= storage +PKG_OPTIONS_OPTIONAL_GROUPS= debug +PKG_OPTIONS_GROUP.storage= mysql sqlite +PKG_OPTIONS_GROUP.debug= debug cppunit + +PKG_SUGGESTED_OPTIONS= sqlite + +.include "../../mk/bsd.options.mk" + +PLIST_VARS+= sqlite mysql + +.if !empty(PKG_OPTIONS:Msqlite) +. include "../../databases/poco-data-sqlite/buildlink3.mk" +PLIST.sqlite= yes +.endif + +.if !empty(PKG_OPTIONS:Mmysql) +. include "../../databases/poco-data-mysql/buildlink3.mk" +PLIST.mysql= yes +.endif + +.if !empty(PKG_OPTIONS:Mdebug) +CMAKE_ARGS+= -DCMAKE_BUILD_TYPE=Debug +.endif + +.if !empty(PKG_OPTIONS:Mcppunit) +. include "../../devel/cppunit/buildlink3.mk" +.endif diff --git a/chat/spectrum/patches/patch-CMakeLists.txt b/chat/spectrum/patches/patch-CMakeLists.txt new file mode 100644 index 00000000000..b74faa467a1 --- /dev/null +++ b/chat/spectrum/patches/patch-CMakeLists.txt @@ -0,0 +1,22 @@ +$NetBSD: patch-CMakeLists.txt,v 1.1.1.1 2011/02/07 06:31:22 schnoebe Exp $ + +# +# change man path to be configurable to PKGSRC standards. +# + +--- CMakeLists.txt.orig 2010-07-13 17:38:39.000000000 +0000 ++++ CMakeLists.txt +@@ -395,11 +398,11 @@ INSTALL(FILES + + INSTALL(FILES + ${CMAKE_CURRENT_SOURCE_DIR}/man/spectrumctl.8 +- DESTINATION share/man/man8 ++ DESTINATION @PKGMANDIR@/man8 + ) + INSTALL(FILES + ${CMAKE_CURRENT_SOURCE_DIR}/man/spectrum.cfg.5 +- DESTINATION share/man/man5 ++ DESTINATION @PKGMANDIR@/man5 + ) + + endif (NOT WITHOUT_SPECTRUMCTL) diff --git a/chat/spectrum/patches/patch-man_spectrumctl.8 b/chat/spectrum/patches/patch-man_spectrumctl.8 new file mode 100644 index 00000000000..039e8ca3bcd --- /dev/null +++ b/chat/spectrum/patches/patch-man_spectrumctl.8 @@ -0,0 +1,55 @@ +$NetBSD: patch-man_spectrumctl.8,v 1.1.1.1 2011/02/07 06:31:22 schnoebe Exp $ + +Change out the /etc/spectrum path for easy substitution +Change out the spectrum username for easy substitution. + +--- man/spectrumctl.8.orig 2010-08-12 15:18:20.000000000 +0000 ++++ man/spectrumctl.8 +@@ -23,7 +23,7 @@ with more complex administration tasks. + explanation. + .SH ACTIONS + .sp +-By default, spectrumctl acts on all transports defined in \fI/etc/spectrum/\fR. ++By default, spectrumctl acts on all transports defined in \fI@ETC_SPECTRUM@\fR. + You can use a different directory with the \fI--config-dir\fR option. If you + just want to act on a single file, you can use the \fI--config\fR option. Unless + you use \fI--config\fR, spectrumctl will silently ignore files where the +@@ -101,7 +101,7 @@ Only act on transport configured in FILE + .RE + \fB\-d\fR \fIDIR\fR, \fB\-\-config\-dir\fR=\fIDIR\fR + .RS 4 +-Act on all transports configured in DIR (default: \fI/etc/spectrum\fR) ++Act on all transports configured in DIR (default: \fI@ETC_SPECTRUM@\fR) + .sp + .RE + \fB\-q\fR, \fB\-\-quiet\fR +@@ -146,9 +146,9 @@ Options for action "\fBstart\fR": + .RS 4 + \fB\-\-su\fR=\fISU\fR + .RS 4 +-Start spectrum as this user (default: \fIspectrum\fR). Overrides the SPECTRUM_USER environment variable. ++Start spectrum as this user (default: \fI@SPECTRUM_USER@\fR). Overrides the SPECTRUM_USER environment variable. + If neither \fI\-\-su\fR nor the environment variable \fBSPECTRUM_USER\fR is specified, the user defaults to +-\fIspectrum\fR. ++\fI@SPECTRUM_USER@\fR. + .RE + .sp + \fB\-\-no-daemon\fR +@@ -168,7 +168,7 @@ multiple administration tasks at once. Y + commands only available within the shell. + .sp + The prompt of the spectrumctl shell represents the transports that commands will +-act upon. If the shell acts upon all config-files defined in \fI/etc/spectrum\fR, ++act upon. If the shell acts upon all config-files defined in \fI@ETC_SPECTRUM@\fR, + the prompt will show \fB\fR and the JID of the current transport + otherwise. + .sp +@@ -198,7 +198,7 @@ Path where the spectrum binary is locate + The user with which spectrum is started. Overridden by the --su command line + option. + If neither --su nor SPECTRUM_USER is specified, the user defaults to +-\fIspectrum\fR. ++\fI@SPECTRUM_USER@\fR. + .RE + .SH AUTHORS + Copyright \(co 2009\-2010 by Spectrum engineers: diff --git a/chat/spectrum/patches/patch-spectrumctl_spectrum_env.py b/chat/spectrum/patches/patch-spectrumctl_spectrum_env.py new file mode 100644 index 00000000000..e40021f2e32 --- /dev/null +++ b/chat/spectrum/patches/patch-spectrumctl_spectrum_env.py @@ -0,0 +1,17 @@ +$NetBSD: patch-spectrumctl_spectrum_env.py,v 1.1.1.1 2011/02/07 06:31:22 schnoebe Exp $ + +# +# allow the spectrum user to be substituted in. +# + +--- spectrumctl/spectrum/env.py.orig 2010-07-13 17:38:39.000000000 +0000 ++++ spectrumctl/spectrum/env.py +@@ -18,7 +18,7 @@ def get_uid(): + username = os.environ['SPECTRUM_USER'] + except KeyError: + # otherwise we default to spectrum: +- username = 'spectrum' ++ username = '@SPECTRUM_USER@' + try: + return pwd.getpwnam( username ).pw_uid + except KeyError: diff --git a/chat/spectrum/patches/patch-spectrumctl_spectrumctl.py b/chat/spectrum/patches/patch-spectrumctl_spectrumctl.py new file mode 100644 index 00000000000..29bc7a46186 --- /dev/null +++ b/chat/spectrum/patches/patch-spectrumctl_spectrumctl.py @@ -0,0 +1,42 @@ +$NetBSD: patch-spectrumctl_spectrumctl.py,v 1.1.1.1 2011/02/07 06:31:22 schnoebe Exp $ + +Modify to allow the path to the spectrum directory to be substituted in. +Modify to allow the name of the spectrum user to be substituted in. + +--- spectrumctl/spectrumctl.py.orig 2010-08-12 15:18:20.000000000 +0000 ++++ spectrumctl/spectrumctl.py +@@ -3,7 +3,7 @@ + # + # spectrumctl can be used to control your spectrum-instances. Valid actions are + # start, stop, restart and reload. By default, spectrumctl acts on all instances +-# defined in /etc/spectrum/ ++# defined in @ETC_SPECTRUM@ + # + # Copyright (C) 2009, 2010 Mathias Ertl + # +@@ -29,12 +29,12 @@ from optparse import * + cmds = [ x.name for x in doc.cmds ] + description='''spectrumctl can be used to control your spectrum-instances. + Valid actions are %s and %s. By default, spectrumctl acts on all transports +-defined in /etc/spectrum/.'''%( ', '.join( cmds[:-1] ), cmds[-1] ) ++defined in @ETC_SPECTRUM@.'''%( ', '.join( cmds[:-1] ), cmds[-1] ) + + parser = OptionParser( usage='Usage: %prog [options] action', version='0.2', description=description) + parser.add_option( '-c', '--config', metavar='FILE', + help = 'Only act on transport configured in FILE (ignored for list)' ) +-parser.add_option( '-d', '--config-dir', metavar='DIR', default='/etc/spectrum', ++parser.add_option( '-d', '--config-dir', metavar='DIR', default='@ETC_SPECTRUM@', + help = 'Act on all transports configured in DIR (default: %default)' ) + parser.add_option( '-q', '--quiet', action='store_true', default=False, + help = 'Do not print any output' ) +@@ -51,8 +51,8 @@ parser.add_option_group( list_group ) + start_group = OptionGroup( parser, 'Options for action "start"' ) + start_group.add_option( '--su', # NOTE: the default is set by + # spectrum.get_uid(). We need this so we can distinguish between +- # actually setting --su=spectrum and setting nothing at all. +- help = 'Start spectrum as this user (default: spectrum)' ) ++ # actually setting --su=@SPECTRUM_USER@ and setting nothing at all. ++ help = 'Start spectrum as this user (default: @SPECTRUM_USER@)' ) + start_group.add_option( '--no-daemon', action='store_true', default=False, + help = 'Do not start spectrum in daemon mode' ) + start_group.add_option( '--debug', action='store_true', default=False, -- cgit v1.2.3