aboutsummaryrefslogtreecommitdiffstats
path: root/net-im
diff options
context:
space:
mode:
authorgarga <garga@FreeBSD.org>2007-03-15 03:43:41 +0800
committergarga <garga@FreeBSD.org>2007-03-15 03:43:41 +0800
commitab5a3cb6d3832a6149945d4b4ab0a9dac41be138 (patch)
tree7741ea3a68fcbb87f2273dcedb224334a02e2cca /net-im
parentbf8ccfeb2a68623ebb9988df3155da7f642ec4bc (diff)
downloadfreebsd-ports-gnome-ab5a3cb6d3832a6149945d4b4ab0a9dac41be138.tar.gz
freebsd-ports-gnome-ab5a3cb6d3832a6149945d4b4ab0a9dac41be138.tar.zst
freebsd-ports-gnome-ab5a3cb6d3832a6149945d4b4ab0a9dac41be138.zip
- Add support and doc to work with jabber-1.6.0
- Add support for other and external servers (it's possibly to run just the transport) - Add support for MySQL storage (include db-setup.mysql on EXAMPLESDIR) - Bump PORTREVISION PR: ports/110194 Submitted by: Martin Matuska <martin@matuska.org>
Diffstat (limited to 'net-im')
-rw-r--r--net-im/jabber-pyicq/Makefile75
-rw-r--r--net-im/jabber-pyicq/files/README.external.in14
-rw-r--r--net-im/jabber-pyicq/files/README.jabberd14.in39
-rw-r--r--net-im/jabber-pyicq/files/README.jabberd2.in11
-rw-r--r--net-im/jabber-pyicq/files/jabber-pyicq-transport.sh.in2
-rw-r--r--net-im/jabber-pyicq/files/pkg-message.in16
-rw-r--r--net-im/jabber-pyicq/pkg-plist1
7 files changed, 132 insertions, 26 deletions
diff --git a/net-im/jabber-pyicq/Makefile b/net-im/jabber-pyicq/Makefile
index 66d877470809..6888a2adc6f3 100644
--- a/net-im/jabber-pyicq/Makefile
+++ b/net-im/jabber-pyicq/Makefile
@@ -6,7 +6,7 @@
PORTNAME= pyicq
PORTVERSION= 0.8
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= net-im
MASTER_SITES= http://www.blathersource.org/download.php/pyicq-t/
PKGNAMEPREFIX= jabber-
@@ -20,31 +20,60 @@ COMMENT= Python ICQ-Transport for Jabber
RUN_DEPENDS= ${PYTHON_SITELIBDIR}/OpenSSL/__init__.py:${PORTSDIR}/security/py-openssl \
${PYTHON_SITELIBDIR}/PIL/__init__.py:${PORTSDIR}/graphics/py-imaging
-OPTIONS= EJABBERD "Use transport with ejabberd" off \
- TWISTED1 "Use old py-twisted 1.x" off
+OPTIONS= JABBER "Use with jabberd14 (net-im/jabber)" off \
+ JABBERD "Use with jabberd 2.x (net-im/jabberd)" off \
+ EJABBERD "Use with ejabberd (net-im/ejabberd)" off \
+ TWISTED1 "Use old py-twisted 1.x" off \
+ MYSQL "Support MySQL storage" off
NO_BUILD= yes
USE_PYTHON= yes
USE_RC_SUBR= jabber-pyicq-transport.sh
LOCAL_PYTHON= ${PYTHON_CMD}
-SUB_FILES= pkg-message
+SUB_FILES= pkg-message README.jabberd14 README.jabberd2 README.external
SUB_LIST= PYTHON_CMD=${LOCAL_PYTHON}
INST_DIR= ${PREFIX}/lib/jabber/${PORTNAME}
-PORTDOCS= COPYING README NEWS
+PORTDOCS= COPYING NEWS README README.jabberd14 README.jabberd2 README.external
.include <bsd.port.pre.mk>
-.if defined(WITH_EJABBERD)
-JABBER_USER?= ejabberd
-SUB_LIST+= JABBER_REQUIRE=ejabberd
+.if (defined(WITH_JABBERD) && (defined(WITH_JABBER) || defined(WITH_EJABBERD))) || \
+ defined(WITH_JABBER) && defined(WITH_EJABBERD)
+IGNORE= options WITH_JABBER, WITH_JABBERD and WITH_EJABBERD are mutually exclusive
+.endif
+
+.if defined(WITH_JABBER)
+JABBER_REQUIRE?= jabber
+JABBER_USER?= jabber
+JABBER_PIDDIR?= /var/run/jabberd
+JABBER_SPOOLDIR?= /var/spool/jabberd
+RUN_DEPENDS+= jabberd14:${PORTSDIR}/net-im/jabber
+.elif defined(WITH_JABBERD)
+JABBER_REQUIRE?= jabberd
+JABBER_USER?= jabber
+JABBER_PIDDIR?= /var/jabberd/pid
+JABBER_SPOOLDIR?= /var/spool/jabber
+RUN_DEPENDS+= jabberd:${PORTSDIR}/net-im/jabberd
+.elif defined(WITH_EJABBERD)
+JABBER_REQUIRE?= ejabberd
+JABBER_USER?= ejabberd
+JABBER_PIDDIR?= /var/jabberd/pid
+JABBER_SPOOLDIR?= /var/spool/jabber
+RUN_DEPENDS+= ejabberd:${PORTSDIR}/net-im/ejabberd
.else
-JABBER_USER?= jabber
-SUB_LIST+= JABBER_REQUIRE=jabberd
+JABBER_REQUIRE?= DAEMON
+JABBER_USER?= nobody
+JABBER_PIDDIR?= /var/run/pyicq
+JABBER_SPOOLDIR?= /var/spool/pyicq
.endif
+SUB_LIST+= JABBER_REQUIRE="${JABBER_REQUIRE}" \
+ JABBER_PIDDIR="${JABBER_PIDDIR}" \
+ JABBER_SPOOLDIR="${JABBER_SPOOLDIR}"
+
.if defined(WITH_TWISTED1)
RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/twisted/__init__.py:${PORTSDIR}/devel/py-twisted
.else
@@ -53,11 +82,15 @@ RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/twisted/__init__.py:${PORTSDIR}/devel/py-twis
${PYTHON_SITELIBDIR}/twisted/words/__init__.py:${PORTSDIR}/net-im/py-twistedWords
.endif
+.if defined(WITH_MYSQL)
+RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/MySQLdb/__init__.py:${PORTSDIR}/databases/py-MySQLdb
+.endif
+
SUB_LIST+= JABBER_USER=${JABBER_USER}
post-patch:
- @${REINPLACE_CMD} -i "" -e '/spooldir/s|\.|/var/spool/jabber|' \
- -e '/pid/s|PyICQt.pid|/var/jabberd/pid/PyICQt.pid|' \
+ @${REINPLACE_CMD} -i "" -e '/spooldir/s|\.|${JABBER_SPOOLDIR}|' \
+ -e '/pid/s|PyICQt.pid|${JABBER_PIDDIR}/PyICQt.pid|' \
${WRKSRC}/config_example.xml
@${REINPLACE_CMD} -i "" -e 's,"config.xml","${PREFIX}/etc/jabber-pyicq.xml",' \
${WRKSRC}/src/main.py
@@ -66,7 +99,7 @@ post-patch:
@${RM} -f ${WRKSRC}/src/main.py.orig
do-install:
- ${MKDIR} ${INST_DIR}/src ${INST_DIR}/data
+ @${MKDIR} ${INST_DIR}/src ${INST_DIR}/data
${INSTALL_SCRIPT} ${WRKSRC}/PyICQt.py ${INST_DIR}
${INSTALL_DATA} ${WRKSRC}/data/defaultAIMAvatar.png ${INST_DIR}/data
${INSTALL_DATA} ${WRKSRC}/data/defaultICQAvatar.png ${INST_DIR}/data
@@ -75,12 +108,18 @@ do-install:
@${FIND} ${INST_DIR}/src/ -type f -exec ${CHMOD} 644 "{}" \;
@${MKDIR} ${EXAMPLESDIR}/etc
${INSTALL_DATA} ${WRKSRC}/config_example.xml ${EXAMPLESDIR}/etc/jabber-pyicq.xml
- [ -f ${PREFIX}/etc/jabber-pyicq.xml ] || ${CP} ${EXAMPLESDIR}/etc/jabber-pyicq.xml ${PREFIX}/etc/jabber-pyicq.xml
+ ${INSTALL_DATA} ${WRKSRC}/tools/db-setup.mysql ${EXAMPLESDIR}
+ @[ -f ${PREFIX}/etc/jabber-pyicq.xml ] || \
+ ${CP} -v ${EXAMPLESDIR}/etc/jabber-pyicq.xml ${PREFIX}/etc/jabber-pyicq.xml
.if !defined(NOPORTDOCS)
- ${MKDIR} ${DOCSDIR}
-.for portdoc in ${PORTDOCS}
- ${INSTALL_DATA} ${WRKSRC}/${portdoc} ${DOCSDIR}/
-.endfor
+ @${MKDIR} ${DOCSDIR}
+. for portdoc in ${PORTDOCS}
+ @if [ -f ${WRKDIR}/${portdoc} ]; then \
+ ${INSTALL_DATA} -v ${WRKDIR}/${portdoc} ${DOCSDIR}/; \
+ else \
+ ${INSTALL_DATA} -v ${WRKSRC}/${portdoc} ${DOCSDIR}/; \
+ fi
+. endfor
.endif
post-install:
diff --git a/net-im/jabber-pyicq/files/README.external.in b/net-im/jabber-pyicq/files/README.external.in
new file mode 100644
index 000000000000..1f14bb8c5dd0
--- /dev/null
+++ b/net-im/jabber-pyicq/files/README.external.in
@@ -0,0 +1,14 @@
+# PyICQ-t and external jabber servers on FreeBSD
+# README by Martin Matuska <martin_at_matuska_dot_org>
+
+If you did not select WITH_JABBER, WITH_JABBERD or WITH_EJABBERD, you may want
+to use another or external jabber server. To run the transport locally, you may
+need to create the pid and spool directories manually.
+
+Default pahts of the current installation are:
+%%JABBER_PIDDIR%%
+%%JABBER_SPOOLDIR%%
+
+You should make these paths writable for the service user.
+Default service user for this installation:
+%%JABBER_USER%% \ No newline at end of file
diff --git a/net-im/jabber-pyicq/files/README.jabberd14.in b/net-im/jabber-pyicq/files/README.jabberd14.in
new file mode 100644
index 000000000000..09ad432a9a03
--- /dev/null
+++ b/net-im/jabber-pyicq/files/README.jabberd14.in
@@ -0,0 +1,39 @@
+# PyICQ-t and jabberd14 (net-im/jabber) on FreeBSD
+# README by Martin Matuska <martin_at_matuska_dot_org>
+
+The sample configuration file for jabberd14 may be located in:
+%%TARGETDIR%%/etc/jabber.xml.sample
+
+Please make all necessary changes to your configuration file which may be:
+%%TARGETDIR%%/etc/jabber.xml
+
+NOTE: if you want this service to be accessible from other servers,
+ change any 'icq.localhost' listed below to a fully qualified domain name!
+ Please make sure that your directives are _NOT_ in an XML comment: there
+ are many multi-line comments.
+
+To activate the ICQ transport for your Jabber server,
+add the following to your configuration file and adjust to your settings
+(around line 921 in the sample configuration file):
+-------------------------------------------------------------------------------
+
+ <service id="icq.localhost">
+ <accept>
+ <ip>127.0.0.1</ip>
+ <port>5347</port>
+ <secret>password</secret>
+ </accept>
+ </service>
+
+-------------------------------------------------------------------------------
+Add this section to the browse area of the jsm to advertise it to
+your users (around line 382 of the sample config):
+-------------------------------------------------------------------------------
+
+ <item category="gateway" type="icq" jid="icq.localhost" name="ICQ Transport">
+ <ns>jabber:iq:gateway</ns>
+ <ns>jabber:iq:register</ns>
+ </item>
+
+-------------------------------------------------------------------------------
+Be sure to restart your server after reconfiguring.
diff --git a/net-im/jabber-pyicq/files/README.jabberd2.in b/net-im/jabber-pyicq/files/README.jabberd2.in
new file mode 100644
index 000000000000..7b5c49f6495c
--- /dev/null
+++ b/net-im/jabber-pyicq/files/README.jabberd2.in
@@ -0,0 +1,11 @@
+# PyICQ-t and jabberd2 (net-im/jabberd) on FreeBSD
+# README by Martin Matuska <martin_at_matuska_dot_org>
+
+The configuration for jabberd2 is located in:
+%%TARGETDIR%%/etc/jabberd
+
+If you are using Jabberd2 then you shouldn't have to do much configuration.
+Make sure the 'mainServer' setting is the IP or DNS of your Jabber server, and
+leave the 'port' setting alone. Double-check that the secret for legacy
+components in router.xml (for Jabberd2) is the same as the secret setting in
+config.py. That should be all. You don't even need to restart Jabberd2.
diff --git a/net-im/jabber-pyicq/files/jabber-pyicq-transport.sh.in b/net-im/jabber-pyicq/files/jabber-pyicq-transport.sh.in
index 1f1367cacea8..d2da9865b6c6 100644
--- a/net-im/jabber-pyicq/files/jabber-pyicq-transport.sh.in
+++ b/net-im/jabber-pyicq/files/jabber-pyicq-transport.sh.in
@@ -21,7 +21,7 @@ load_rc_config $name
: ${jabber_pyicq_enable="NO"}
: ${jabber_pyicq_dir="%%PREFIX%%/lib/jabber/pyicq"}
-: ${jabber_pyicq_piddir="/var/jabberd/pid"}
+: ${jabber_pyicq_piddir="%%JABBER_PIDDIR%%"}
: ${jabber_pyicq_user="%%JABBER_USER%%"}
pidfile="${jabber_pyicq_piddir}/PyICQt.pid"
diff --git a/net-im/jabber-pyicq/files/pkg-message.in b/net-im/jabber-pyicq/files/pkg-message.in
index 7fd511c6c383..f8d45b91a727 100644
--- a/net-im/jabber-pyicq/files/pkg-message.in
+++ b/net-im/jabber-pyicq/files/pkg-message.in
@@ -11,12 +11,14 @@ Remember to edit %%PREFIX%%/etc/jabber-pyicq.xml to suit your needs.
* You can also turn on debugging options, and customise some of the text that
is sent to the users in this file.
-If you are using Jabberd2 then you shouldn't have to do much configuration.
-Make sure the 'mainServer' setting is the IP or DNS of your Jabber server, and
-leave the 'port' setting alone. Double-check that the secret for legacy
-components in router.xml (for Jabberd2) is the same as the secret setting in
-config.py. That should be all. You don't even need to restart Jabberd2.
+Please read instructions for different jabber daemons you desire to use:
+- jabberd14 (net-im/jabber): %%DOCSDIR%%/README.jabberd14
+- jabberd2 (net-im/jabberd): %%DOCSDIR%%/README.jabberd2
-If you are using Jabberd1.4.x, it's a bit more complicated. Follow the setup
-instructions at http://pyicq-t.blathersource.org/install.php
+If you did not select WITH_JABBER, WITH_JABBERD or WITH_EJABBERD, you may want
+to use another or an external jabber server. Please read instructions from:
+%%DOCSDIR%%/README.external
+
+If you are using MySQL storage, sample database script can be found in:
+%%EXAMPLESDIR%%/db-setup.mysql
******************************************************************************
diff --git a/net-im/jabber-pyicq/pkg-plist b/net-im/jabber-pyicq/pkg-plist
index c55bd94cbaff..8fbe3ca81085 100644
--- a/net-im/jabber-pyicq/pkg-plist
+++ b/net-im/jabber-pyicq/pkg-plist
@@ -1,5 +1,6 @@
@comment $FreeBSD$
@unexec if cmp -s %D/%%EXAMPLESDIR%%/etc/jabber-pyicq.xml %D/etc/jabber-pyicq.xml; then rm -f %D/etc/jabber-pyicq.xml; fi
+%%EXAMPLESDIR%%/db-setup.mysql
%%EXAMPLESDIR%%/etc/jabber-pyicq.xml
@exec [ -f %D/etc/jabber-pyicq.xml ] || cp %B/%f %D/etc/jabber-pyicq.xml
lib/jabber/pyicq/PyICQt.py