diff options
Diffstat (limited to 'net-im')
-rw-r--r-- | net-im/ejabberd/Manifest | 56 | ||||
-rw-r--r-- | net-im/ejabberd/ejabberd-1.1.1-r1.ebuild | 145 | ||||
-rw-r--r-- | net-im/ejabberd/ejabberd-1.1.2-r1.ebuild | 26 | ||||
-rw-r--r-- | net-im/ejabberd/ejabberd-1.1.2.ebuild | 145 | ||||
-rw-r--r-- | net-im/ejabberd/files/digest-ejabberd-1.1.1-r1 | 9 | ||||
-rw-r--r-- | net-im/ejabberd/files/digest-ejabberd-1.1.2 | 9 | ||||
-rw-r--r-- | net-im/ejabberd/files/digest-ejabberd-1.1.2-r1 | 9 | ||||
-rw-r--r-- | net-im/ejabberd/files/mod_presence.diff | 633 |
8 files changed, 40 insertions, 992 deletions
diff --git a/net-im/ejabberd/Manifest b/net-im/ejabberd/Manifest index ac783f6d..db303b21 100644 --- a/net-im/ejabberd/Manifest +++ b/net-im/ejabberd/Manifest @@ -1,3 +1,7 @@ +AUX check_pam.diff 12905 RMD160 aee968e9d72be0b0cbc37852226db14cba67a4fe SHA1 92fd41da261025f3cb4af056e46db16391d5e6e1 SHA256 d8ec3dd0ff902c465535809a94e7bd3c34bd53c7d0a50a206150e688ac6386c9 +MD5 6b0c111316a61e615be8da892b596266 files/check_pam.diff 12905 +RMD160 aee968e9d72be0b0cbc37852226db14cba67a4fe files/check_pam.diff 12905 +SHA256 d8ec3dd0ff902c465535809a94e7bd3c34bd53c7d0a50a206150e688ac6386c9 files/check_pam.diff 12905 AUX ejabberd-1.1.2-mod-proxy.patch 14771 RMD160 4a3d817fd103aebfb8e76fc9f23396b57da5f473 SHA1 023ab0fe368bd6de78ad21a977b1d5a09818cab3 SHA256 3c130d4d76fcc6e51014c4ef7db2939d3d6ee911f59fe17bd580ca914a07d6e3 MD5 c9f267fcc007f5a0a92834fc63d9cb3e files/ejabberd-1.1.2-mod-proxy.patch 14771 RMD160 4a3d817fd103aebfb8e76fc9f23396b57da5f473 files/ejabberd-1.1.2-mod-proxy.patch 14771 @@ -14,36 +18,32 @@ AUX ejabberd-1.1.2.initd 1298 RMD160 ec7b25205026521ec09f8595bbe6ae36c94bc55f SH MD5 13c4ef3cee491a8529dc8866347f0636 files/ejabberd-1.1.2.initd 1298 RMD160 ec7b25205026521ec09f8595bbe6ae36c94bc55f files/ejabberd-1.1.2.initd 1298 SHA256 69481e6f156e85c69038675283f818fe3fa92d0ab442aaf78831345969aa021a files/ejabberd-1.1.2.initd 1298 +AUX http_binding.patch 27120 RMD160 33a486a0070317755217d2513f38e1fc51436cd8 SHA1 9b5079ed7134c9ec6b101e79921f9978de820475 SHA256 9edbe0257b9e3fb547bcdb4f4325627e279199adfd6753622665b762eb675ed0 +MD5 98f2370cd26723c02ae57ae780221663 files/http_binding.patch 27120 +RMD160 33a486a0070317755217d2513f38e1fc51436cd8 files/http_binding.patch 27120 +SHA256 9edbe0257b9e3fb547bcdb4f4325627e279199adfd6753622665b762eb675ed0 files/http_binding.patch 27120 AUX mod_archive.erl 29560 RMD160 6c628ca4f1d82cd826c2a4d11c87d6b3344f3f24 SHA1 b934e9a9ed1ab7dc700b589177dc9425aa535a6f SHA256 b46976ca86a43cb13ed71009a5fadf7a2ca231e51da83150cdff0d646fbed00f MD5 c3c630a783edc22b0d81646f2c2eb829 files/mod_archive.erl 29560 RMD160 6c628ca4f1d82cd826c2a4d11c87d6b3344f3f24 files/mod_archive.erl 29560 SHA256 b46976ca86a43cb13ed71009a5fadf7a2ca231e51da83150cdff0d646fbed00f files/mod_archive.erl 29560 -AUX mod_presence.diff 24484 RMD160 6b13d9029854cbf8f22e34722428e805385e4b35 SHA1 8583b61d5f3d3108a631505fc7db0b8c37453e91 SHA256 dd03c73b4b900a160c85abe8df64d27934a5d79126566e6347c727517776a0ad -MD5 acd6e372c151a9df76d8a171a8653139 files/mod_presence.diff 24484 -RMD160 6b13d9029854cbf8f22e34722428e805385e4b35 files/mod_presence.diff 24484 -SHA256 dd03c73b4b900a160c85abe8df64d27934a5d79126566e6347c727517776a0ad files/mod_presence.diff 24484 -DIST check_pam.diff.gz 3865 RMD160 86d6ff263d216c63662ef1078f947f9f7a6c1fce SHA1 756d258a27d145c53b0bac7bb2a333102604127b SHA256 c474adefeefd6e2d18fff531dc4c2f3c149ba003dbd606655656a95ca72ee62a -DIST ejabberd-1.1.1.tar.gz 803278 RMD160 b9c0b7ab3fe1f1b2dce52e1460bba04b313ea534 SHA1 4f23d787afe75c7c866decdff6f539195449776e SHA256 52a97275537073066bd352f5718954f6994b272d1efa51187e17edf0c9b11082 +AUX mod_pep.patch 74047 RMD160 04ea7221b539038a3610a2d745667abbe4b39969 SHA1 4c072204fc46e928492336dcc587c725e14992b1 SHA256 8335979552f290078015347433b0eb1aaa7f59da8431874b4720cd99f7ef91cf +MD5 f6f334f668f70146c06dcdfcb55e0f40 files/mod_pep.patch 74047 +RMD160 04ea7221b539038a3610a2d745667abbe4b39969 files/mod_pep.patch 74047 +SHA256 8335979552f290078015347433b0eb1aaa7f59da8431874b4720cd99f7ef91cf files/mod_pep.patch 74047 +DIST ejabberd-1.1.1_httpbind.tar.gz 14496 RMD160 3dd17d39daf0ff58ed6572559dbc74faadc475cc SHA1 82d9c2b63b27d241fc08495347d979fbd000b66f SHA256 a5e48ce27b9691ef428f82959e6d487e6b293b60fbc415cc88a99bed476e720c DIST ejabberd-1.1.2.tar.gz 836240 RMD160 e763752e6c5fb46c51b71e265ab2ceda6d043a0d SHA1 9e94bdbc10fee5b781405daf43a0b4abc4dee6c1 SHA256 029129a6bcb5d15dbccc5aa756f61c52692eb6882ec7aad0193aa940b6a20bb6 -DIST mod_presence-0.0.3.tar.gz 51392 RMD160 adb6444dcef2fead52c1510fc247f7af20aa62c7 SHA1 88afa3af72d61608a55f1605d58b6ffd1fc43cfa SHA256 5fc2a97576f33965d07bb1f803a8fe48647479da37cd58333aea6a7e48ebc4a1 -EBUILD ejabberd-1.1.1-r1.ebuild 3886 RMD160 688617ec68dd542758b695d18d57c6d123c5e2f7 SHA1 42051242370093ccff3ecd35fcfa4bda4140ddd3 SHA256 04236fb5a30476d6b05bbfc8be4e0eb4abad407194204fa8729f3481c0e4bd53 -MD5 151e7780af1a89705e11cdae74358821 ejabberd-1.1.1-r1.ebuild 3886 -RMD160 688617ec68dd542758b695d18d57c6d123c5e2f7 ejabberd-1.1.1-r1.ebuild 3886 -SHA256 04236fb5a30476d6b05bbfc8be4e0eb4abad407194204fa8729f3481c0e4bd53 ejabberd-1.1.1-r1.ebuild 3886 -EBUILD ejabberd-1.1.2-r1.ebuild 5726 RMD160 2426f1d8488a7c685efffc470cd3c67e485d3850 SHA1 3f981158b85b92f2ca825dee38f92fa50b4b8dd2 SHA256 c8d73f7922ac2c672024b86bb6bb63c7b5416ece901390b2341ed2f06f58c14c -MD5 1713684f7f7dbad5c06b18ffc7a06271 ejabberd-1.1.2-r1.ebuild 5726 -RMD160 2426f1d8488a7c685efffc470cd3c67e485d3850 ejabberd-1.1.2-r1.ebuild 5726 -SHA256 c8d73f7922ac2c672024b86bb6bb63c7b5416ece901390b2341ed2f06f58c14c ejabberd-1.1.2-r1.ebuild 5726 -EBUILD ejabberd-1.1.2.ebuild 3886 RMD160 688617ec68dd542758b695d18d57c6d123c5e2f7 SHA1 42051242370093ccff3ecd35fcfa4bda4140ddd3 SHA256 04236fb5a30476d6b05bbfc8be4e0eb4abad407194204fa8729f3481c0e4bd53 -MD5 151e7780af1a89705e11cdae74358821 ejabberd-1.1.2.ebuild 3886 -RMD160 688617ec68dd542758b695d18d57c6d123c5e2f7 ejabberd-1.1.2.ebuild 3886 -SHA256 04236fb5a30476d6b05bbfc8be4e0eb4abad407194204fa8729f3481c0e4bd53 ejabberd-1.1.2.ebuild 3886 -MD5 6bf0894f239498e7a5bdbaac771cdc75 files/digest-ejabberd-1.1.1-r1 723 -RMD160 d2d272d4488b3eec4fc58eeb9449396f29d783c0 files/digest-ejabberd-1.1.1-r1 723 -SHA256 f57333e151bec1d584876aade6dc4fec76e8deffdd240d7aa2d2ec947d6dbba8 files/digest-ejabberd-1.1.1-r1 723 -MD5 f10adb4f04e5543f5410c8a2e1081c96 files/digest-ejabberd-1.1.2 723 -RMD160 7eeb128a9c425adfe020101bef8a0278e1bd0211 files/digest-ejabberd-1.1.2 723 -SHA256 811fc4d85d4bcd926bdce37a5ecade163afb5b14663d747842375c8ffdc5100d files/digest-ejabberd-1.1.2 723 -MD5 f10adb4f04e5543f5410c8a2e1081c96 files/digest-ejabberd-1.1.2-r1 723 -RMD160 7eeb128a9c425adfe020101bef8a0278e1bd0211 files/digest-ejabberd-1.1.2-r1 723 -SHA256 811fc4d85d4bcd926bdce37a5ecade163afb5b14663d747842375c8ffdc5100d files/digest-ejabberd-1.1.2-r1 723 +DIST mod_presence-0.0.4.tar.gz 51874 RMD160 f9a724b4c6d58fc83c09f71eacb18b6b0ba77ea9 SHA1 c9a7f05939798bdaf61f9ca8da5c0ac80258afbd SHA256 0f3983a61ac779ddbadde94961db0ce724bff2fb23483654d1be0221a13c5a11 +EBUILD ejabberd-1.1.2-r1.ebuild 6047 RMD160 67cac92974a0abad21d0742691541d4e04763ba8 SHA1 c3f5dbd14928e4f3bae8743af7c0ca0a5466fae5 SHA256 8b3a13991e2a1b2a3e9d262acfa663f6e7c054596801e96359121a0e25b15f55 +MD5 97b595d6ef284930fda4e83563e6ef3f ejabberd-1.1.2-r1.ebuild 6047 +RMD160 67cac92974a0abad21d0742691541d4e04763ba8 ejabberd-1.1.2-r1.ebuild 6047 +SHA256 8b3a13991e2a1b2a3e9d262acfa663f6e7c054596801e96359121a0e25b15f55 ejabberd-1.1.2-r1.ebuild 6047 +EBUILD ejabberd-1.1.2-r2.ebuild 6109 RMD160 667e6cbaec3903d773d70d09833bd849b4b848a2 SHA1 57f23c26bf40b172e0f30ba09ba851d77c13d269 SHA256 f6844047ac3615d97658c27f8e6f30fff6efc71fd984b8533564c5620610d0b5 +MD5 acf6e6019067a4867e029a874c36b806 ejabberd-1.1.2-r2.ebuild 6109 +RMD160 667e6cbaec3903d773d70d09833bd849b4b848a2 ejabberd-1.1.2-r2.ebuild 6109 +SHA256 f6844047ac3615d97658c27f8e6f30fff6efc71fd984b8533564c5620610d0b5 ejabberd-1.1.2-r2.ebuild 6109 +MD5 30a6b40979271475494b8103ac79c2b4 files/digest-ejabberd-1.1.2-r1 497 +RMD160 93a5b27c67cf098e343f1e877df1bdb5b4fe05ff files/digest-ejabberd-1.1.2-r1 497 +SHA256 e90edb5f4836aa10b0e5490f1d9ed4d690c9dbd841ad566e03797f61f41f9024 files/digest-ejabberd-1.1.2-r1 497 +MD5 28991a43f2edef2f12f58b614f87d1a3 files/digest-ejabberd-1.1.2-r2 765 +RMD160 ab10e70d0a76179cfa03d7358b790ca12caa1484 files/digest-ejabberd-1.1.2-r2 765 +SHA256 3fb5d04a5f49ed371b8f835c393ea62c566c669d9ad1557073dbc3a04d11cc82 files/digest-ejabberd-1.1.2-r2 765 diff --git a/net-im/ejabberd/ejabberd-1.1.1-r1.ebuild b/net-im/ejabberd/ejabberd-1.1.1-r1.ebuild deleted file mode 100644 index 586f4fce..00000000 --- a/net-im/ejabberd/ejabberd-1.1.1-r1.ebuild +++ /dev/null @@ -1,145 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-im/ejabberd/ejabberd-1.1.1.ebuild,v 1.2 2006/08/01 04:26:09 tsunam Exp $ - -inherit eutils multilib ssl-cert versionator autotools - -JABBER_ETC="/etc/jabber" -JABBER_RUN="/var/run/jabber" -JABBER_SPOOL="/var/spool/jabber" -JABBER_LOG="/var/log/jabber" - -DESCRIPTION="The Erlang Jabber Daemon" -HOMEPAGE="http://ejabberd.jabber.ru/" -SRC_URI="http://process-one.net/en/projects/${PN}/download/${PV}/${P}.tar.gz - pam? ( http://beber.meleeweb.net/jabber/check_pam.diff.gz ) - mod_presence? ( http://www.goryachev.org/jabber/mod_presence-0.0.3.tar.gz )" -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="x86 ~amd64" -IUSE="mod_archive mod_irc mod_muc mod_pubsub mod_presence ldap odbc pam web" - -DEPEND=">=net-im/jabber-base-0.01 - >=dev-libs/expat-1.95 - >=dev-lang/erlang-10.2.0 - odbc? ( dev-db/unixODBC ) - ldap? ( =net-nds/openldap-2* ) - pam? ( sys-libs/pam)" -RESTRICT="nomirror" - -PROVIDE="virtual/jabber-server" -S=${WORKDIR}/${P}/src - -src_unpack() { - unpack ${A} - cd ${S} - - if use mod_presence; then - epatch ${WORKDIR}/mod_presence/mod_presence.diff - cp -r ${WORKDIR}/mod_presence/pixmaps . - fi - - if use pam; then - patch -p0 < ${WORKDIR}/check_pam.diff - fi - - if use mod_archive; then - cp ${FILESDIR}/mod_archive.erl . - fi -} - -src_compile() { - eautoconf - econf ${myconf} \ - $(use_enable mod_irc) \ - $(use_enable ldap eldap) \ - $(use_enable mod_muc) \ - $(use_enable mod_pubsub) \ - $(use_enable ssl tls) \ - $(use_enable web) \ - $(use_enable odbc) \ - $(use_enable mod_presence) \ - || die "econf failed" - - emake || die "compiling ejabberd core failed" -} - -src_install() { - make \ - DESTDIR=${D} \ - EJABBERDDIR=${D}/usr/$(get_libdir)/erlang/lib/${P} \ - ETCDIR=${D}${JABBER_ETC} \ - LOGDIR=${D}${JABBER_LOG} \ - install \ - || die "install failed" - - insinto /usr/share/doc/${PF} - cd ${S}/.. - dodoc doc/release_notes_${PV}.txt - dohtml doc/*.{html,png} - - # - # Create /usr/bin/ejabberd - # - cat <<EOF > ${T}/ejabberd -#!/bin/bash - -erl -pa /usr/$(get_libdir)/erlang/lib/${P}/ebin \\ - ${pa} \\ - -sname ejabberd \\ - -s ejabberd \\ - -ejabberd config \"${JABBER_ETC}/ejabberd.cfg\" \\ - log_path \"${JABBER_LOG}/ejabberd.log\" \\ - -kernel inetrc \"${JABBER_ETC}/inetrc\" \\ - -sasl sasl_error_logger \{file,\"${JABBER_LOG}/sasl.log\"\} \\ - -mnesia dir \"${JABBER_SPOOL}\" \\ - \$@ -EOF - - # - # Create /usr/bin/ejabberdctl - # - cat <<EOF > ${T}/ejabberdctl -#!/bin/sh - -exec env HOME=${JABBER_RUN} \\ - erl -pa /usr/$(get_libdir)/erlang/lib/${P}/ebin \\ - ${pa} \\ - -noinput \\ - -sname ejabberdctl \\ - -s ejabberd_ctl \\ - -extra \$@ -EOF - - dobin ${T}/ejabberdctl - dobin ${T}/ejabberd - - newinitd ${FILESDIR}/${P}.initd ${PN} - newconfd ${FILESDIR}/${P}.confd ${PN} - - insinto ${JABBER_ETC} - if use ssl; then - docert ssl - rm -f ${D}${JABBER_ETC}/ssl.{crt,csr,key} - fowners jabber:jabber ${JABBER_ETC}/ssl.pem - fi - doins ${FILESDIR}/inetrc -} - -pkg_postinst() { - if [ ! -e ${JABBER_ETC}/ejabberd.cfg ] - then - einfo "Configuration file has been installed in ${JABBER_ETC}/ejabberd.cfg." - einfo "Edit it according to your needs. For configuration instructions," - einfo "please see /usr/share/doc/${PF}/html/guide.html" - fi - if use ssl ; then - einfo "A script to generate a ssl key has been installed in" - einfo "${JABBER_ETC}/self-cert.sh . Use it and change the config file to" - einfo "point to the full path" - fi - if ! use web ; then - einfo "The web USE flag is off, this will disable the web admin interface," - einfo "if this was not the intention then add web to your USE flags." - fi -} diff --git a/net-im/ejabberd/ejabberd-1.1.2-r1.ebuild b/net-im/ejabberd/ejabberd-1.1.2-r1.ebuild index 25cb81b6..2ba43ad6 100644 --- a/net-im/ejabberd/ejabberd-1.1.2-r1.ebuild +++ b/net-im/ejabberd/ejabberd-1.1.2-r1.ebuild @@ -20,12 +20,11 @@ E_PGSQL=${E_PGSQL_N}-${E_PGSQL_V} DESCRIPTION="The Erlang Jabber Daemon" HOMEPAGE="http://ejabberd.jabber.ru/" SRC_URI="http://process-one.net/en/projects/${PN}/download/${PV}/${P}.tar.gz - pam? ( http://beber.meleeweb.net/jabber/check_pam.diff.gz ) - mod_presence? ( http://www.goryachev.org/jabber/mod_presence-0.0.3.tar.gz )" + mod_presence? ( http://www.goryachev.org/jabber/mod_presence-0.0.4.tar.gz )" LICENSE="GPL-2" SLOT="0" KEYWORDS="x86 ~amd64" -IUSE="${IUSE} mod_archive mod_irc mod_muc mod_pubsub mod_presence mod_proxy statsdx ldap odbc pam web mysql postgres" +IUSE="${IUSE} mod_archive mod_irc mod_muc mod_pep mod_pubsub mod_presence mod_proxy statsdx ldap odbc pam web mysql postgres http_binding" DEPEND="${RDEPEND} >=net-im/jabber-base-0.01 @@ -72,22 +71,15 @@ src_unpack() { epatch ${FILESDIR}/${P}-statsdx-web.patch fi - if use mod_proxy; then - epatch ${FILESDIR}/${P}-mod-proxy.patch - fi + use pam && epatch ${FILESDIR}/check_pam.diff # http://ejabberd.jabber.ru/pam + use mod_proxy && epatch ${FILESDIR}/${P}-mod-proxy.patch # http://bugs.gentoo.org/show_bug.cgi?id=137724 + use mod_pep && epatch ${FILESDIR}/mod_pep.patch # http://www.dtek.chalmers.se/~henoch/text/ejabberd-pep.html + use http_binding && epatch ${FILESDIR}/http_binding.patch # http://www.jabber.ru/bugzilla/show_bug.cgi?id=91 | http://ejabberd.jabber.ru/mod_proxy65 + use mod_archive && cp ${FILESDIR}/mod_archive.erl ${S} # http://ejabberd.jabber.ru/mod_archive if use mod_presence; then - cp -r ${WORKDIR}/mod_presence/pixmaps . - cd ../.. - epatch ${FILESDIR}/mod_presence.diff - fi - - if use pam; then - patch -p0 < ${WORKDIR}/check_pam.diff - fi - - if use mod_archive; then - cp ${FILESDIR}/mod_archive.erl . + cp -r ${WORKDIR}/mod_presence/pixmaps ${S} + epatch ${WORKDIR}/mod_presence/mod_presence.diff fi } diff --git a/net-im/ejabberd/ejabberd-1.1.2.ebuild b/net-im/ejabberd/ejabberd-1.1.2.ebuild deleted file mode 100644 index 586f4fce..00000000 --- a/net-im/ejabberd/ejabberd-1.1.2.ebuild +++ /dev/null @@ -1,145 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-im/ejabberd/ejabberd-1.1.1.ebuild,v 1.2 2006/08/01 04:26:09 tsunam Exp $ - -inherit eutils multilib ssl-cert versionator autotools - -JABBER_ETC="/etc/jabber" -JABBER_RUN="/var/run/jabber" -JABBER_SPOOL="/var/spool/jabber" -JABBER_LOG="/var/log/jabber" - -DESCRIPTION="The Erlang Jabber Daemon" -HOMEPAGE="http://ejabberd.jabber.ru/" -SRC_URI="http://process-one.net/en/projects/${PN}/download/${PV}/${P}.tar.gz - pam? ( http://beber.meleeweb.net/jabber/check_pam.diff.gz ) - mod_presence? ( http://www.goryachev.org/jabber/mod_presence-0.0.3.tar.gz )" -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="x86 ~amd64" -IUSE="mod_archive mod_irc mod_muc mod_pubsub mod_presence ldap odbc pam web" - -DEPEND=">=net-im/jabber-base-0.01 - >=dev-libs/expat-1.95 - >=dev-lang/erlang-10.2.0 - odbc? ( dev-db/unixODBC ) - ldap? ( =net-nds/openldap-2* ) - pam? ( sys-libs/pam)" -RESTRICT="nomirror" - -PROVIDE="virtual/jabber-server" -S=${WORKDIR}/${P}/src - -src_unpack() { - unpack ${A} - cd ${S} - - if use mod_presence; then - epatch ${WORKDIR}/mod_presence/mod_presence.diff - cp -r ${WORKDIR}/mod_presence/pixmaps . - fi - - if use pam; then - patch -p0 < ${WORKDIR}/check_pam.diff - fi - - if use mod_archive; then - cp ${FILESDIR}/mod_archive.erl . - fi -} - -src_compile() { - eautoconf - econf ${myconf} \ - $(use_enable mod_irc) \ - $(use_enable ldap eldap) \ - $(use_enable mod_muc) \ - $(use_enable mod_pubsub) \ - $(use_enable ssl tls) \ - $(use_enable web) \ - $(use_enable odbc) \ - $(use_enable mod_presence) \ - || die "econf failed" - - emake || die "compiling ejabberd core failed" -} - -src_install() { - make \ - DESTDIR=${D} \ - EJABBERDDIR=${D}/usr/$(get_libdir)/erlang/lib/${P} \ - ETCDIR=${D}${JABBER_ETC} \ - LOGDIR=${D}${JABBER_LOG} \ - install \ - || die "install failed" - - insinto /usr/share/doc/${PF} - cd ${S}/.. - dodoc doc/release_notes_${PV}.txt - dohtml doc/*.{html,png} - - # - # Create /usr/bin/ejabberd - # - cat <<EOF > ${T}/ejabberd -#!/bin/bash - -erl -pa /usr/$(get_libdir)/erlang/lib/${P}/ebin \\ - ${pa} \\ - -sname ejabberd \\ - -s ejabberd \\ - -ejabberd config \"${JABBER_ETC}/ejabberd.cfg\" \\ - log_path \"${JABBER_LOG}/ejabberd.log\" \\ - -kernel inetrc \"${JABBER_ETC}/inetrc\" \\ - -sasl sasl_error_logger \{file,\"${JABBER_LOG}/sasl.log\"\} \\ - -mnesia dir \"${JABBER_SPOOL}\" \\ - \$@ -EOF - - # - # Create /usr/bin/ejabberdctl - # - cat <<EOF > ${T}/ejabberdctl -#!/bin/sh - -exec env HOME=${JABBER_RUN} \\ - erl -pa /usr/$(get_libdir)/erlang/lib/${P}/ebin \\ - ${pa} \\ - -noinput \\ - -sname ejabberdctl \\ - -s ejabberd_ctl \\ - -extra \$@ -EOF - - dobin ${T}/ejabberdctl - dobin ${T}/ejabberd - - newinitd ${FILESDIR}/${P}.initd ${PN} - newconfd ${FILESDIR}/${P}.confd ${PN} - - insinto ${JABBER_ETC} - if use ssl; then - docert ssl - rm -f ${D}${JABBER_ETC}/ssl.{crt,csr,key} - fowners jabber:jabber ${JABBER_ETC}/ssl.pem - fi - doins ${FILESDIR}/inetrc -} - -pkg_postinst() { - if [ ! -e ${JABBER_ETC}/ejabberd.cfg ] - then - einfo "Configuration file has been installed in ${JABBER_ETC}/ejabberd.cfg." - einfo "Edit it according to your needs. For configuration instructions," - einfo "please see /usr/share/doc/${PF}/html/guide.html" - fi - if use ssl ; then - einfo "A script to generate a ssl key has been installed in" - einfo "${JABBER_ETC}/self-cert.sh . Use it and change the config file to" - einfo "point to the full path" - fi - if ! use web ; then - einfo "The web USE flag is off, this will disable the web admin interface," - einfo "if this was not the intention then add web to your USE flags." - fi -} diff --git a/net-im/ejabberd/files/digest-ejabberd-1.1.1-r1 b/net-im/ejabberd/files/digest-ejabberd-1.1.1-r1 deleted file mode 100644 index b4b47cb1..00000000 --- a/net-im/ejabberd/files/digest-ejabberd-1.1.1-r1 +++ /dev/null @@ -1,9 +0,0 @@ -MD5 6b78cb824b35a7f651ab33790cf841c7 check_pam.diff.gz 3865 -RMD160 86d6ff263d216c63662ef1078f947f9f7a6c1fce check_pam.diff.gz 3865 -SHA256 c474adefeefd6e2d18fff531dc4c2f3c149ba003dbd606655656a95ca72ee62a check_pam.diff.gz 3865 -MD5 ef6fae4a3f9c7f807f21e9cd3dae195b ejabberd-1.1.1.tar.gz 803278 -RMD160 b9c0b7ab3fe1f1b2dce52e1460bba04b313ea534 ejabberd-1.1.1.tar.gz 803278 -SHA256 52a97275537073066bd352f5718954f6994b272d1efa51187e17edf0c9b11082 ejabberd-1.1.1.tar.gz 803278 -MD5 fa9a979f5e3530a2b3143416934d989b mod_presence-0.0.3.tar.gz 51392 -RMD160 adb6444dcef2fead52c1510fc247f7af20aa62c7 mod_presence-0.0.3.tar.gz 51392 -SHA256 5fc2a97576f33965d07bb1f803a8fe48647479da37cd58333aea6a7e48ebc4a1 mod_presence-0.0.3.tar.gz 51392 diff --git a/net-im/ejabberd/files/digest-ejabberd-1.1.2 b/net-im/ejabberd/files/digest-ejabberd-1.1.2 deleted file mode 100644 index 2e59e9e3..00000000 --- a/net-im/ejabberd/files/digest-ejabberd-1.1.2 +++ /dev/null @@ -1,9 +0,0 @@ -MD5 6b78cb824b35a7f651ab33790cf841c7 check_pam.diff.gz 3865 -RMD160 86d6ff263d216c63662ef1078f947f9f7a6c1fce check_pam.diff.gz 3865 -SHA256 c474adefeefd6e2d18fff531dc4c2f3c149ba003dbd606655656a95ca72ee62a check_pam.diff.gz 3865 -MD5 5b947e19e18a6b554bf31d1c95176eb6 ejabberd-1.1.2.tar.gz 836240 -RMD160 e763752e6c5fb46c51b71e265ab2ceda6d043a0d ejabberd-1.1.2.tar.gz 836240 -SHA256 029129a6bcb5d15dbccc5aa756f61c52692eb6882ec7aad0193aa940b6a20bb6 ejabberd-1.1.2.tar.gz 836240 -MD5 fa9a979f5e3530a2b3143416934d989b mod_presence-0.0.3.tar.gz 51392 -RMD160 adb6444dcef2fead52c1510fc247f7af20aa62c7 mod_presence-0.0.3.tar.gz 51392 -SHA256 5fc2a97576f33965d07bb1f803a8fe48647479da37cd58333aea6a7e48ebc4a1 mod_presence-0.0.3.tar.gz 51392 diff --git a/net-im/ejabberd/files/digest-ejabberd-1.1.2-r1 b/net-im/ejabberd/files/digest-ejabberd-1.1.2-r1 index 2e59e9e3..1810b759 100644 --- a/net-im/ejabberd/files/digest-ejabberd-1.1.2-r1 +++ b/net-im/ejabberd/files/digest-ejabberd-1.1.2-r1 @@ -1,9 +1,6 @@ -MD5 6b78cb824b35a7f651ab33790cf841c7 check_pam.diff.gz 3865 -RMD160 86d6ff263d216c63662ef1078f947f9f7a6c1fce check_pam.diff.gz 3865 -SHA256 c474adefeefd6e2d18fff531dc4c2f3c149ba003dbd606655656a95ca72ee62a check_pam.diff.gz 3865 MD5 5b947e19e18a6b554bf31d1c95176eb6 ejabberd-1.1.2.tar.gz 836240 RMD160 e763752e6c5fb46c51b71e265ab2ceda6d043a0d ejabberd-1.1.2.tar.gz 836240 SHA256 029129a6bcb5d15dbccc5aa756f61c52692eb6882ec7aad0193aa940b6a20bb6 ejabberd-1.1.2.tar.gz 836240 -MD5 fa9a979f5e3530a2b3143416934d989b mod_presence-0.0.3.tar.gz 51392 -RMD160 adb6444dcef2fead52c1510fc247f7af20aa62c7 mod_presence-0.0.3.tar.gz 51392 -SHA256 5fc2a97576f33965d07bb1f803a8fe48647479da37cd58333aea6a7e48ebc4a1 mod_presence-0.0.3.tar.gz 51392 +MD5 5b0a9fd6fb1c595f6812cb33be8d2cd5 mod_presence-0.0.4.tar.gz 51874 +RMD160 f9a724b4c6d58fc83c09f71eacb18b6b0ba77ea9 mod_presence-0.0.4.tar.gz 51874 +SHA256 0f3983a61ac779ddbadde94961db0ce724bff2fb23483654d1be0221a13c5a11 mod_presence-0.0.4.tar.gz 51874 diff --git a/net-im/ejabberd/files/mod_presence.diff b/net-im/ejabberd/files/mod_presence.diff deleted file mode 100644 index 159cbbb5..00000000 --- a/net-im/ejabberd/files/mod_presence.diff +++ /dev/null @@ -1,633 +0,0 @@ -diff -ruN ejabberd-1.1.2.orig/src/Makefile.in ejabberd-1.1.2/src/Makefile.in ---- ejabberd-1.1.2.orig/src/Makefile.in 2006-04-01 20:06:36.000000000 +0400 -+++ ejabberd-1.1.2/src/Makefile.in 2006-09-25 19:14:28.000000000 +0400 -@@ -39,6 +39,7 @@ - PRIVDIR = $(EJABBERDDIR)/priv - SODIR = $(PRIVDIR)/lib - MSGSDIR = $(PRIVDIR)/msgs -+PIXMAPSDIR = $(PRIVDIR)/pixmaps - LOGDIR = $(DESTDIR)@prefix@/var/log/ejabberd - ETCDIR = $(DESTDIR)@prefix@/etc/ejabberd - -@@ -81,6 +82,8 @@ - install -m 644 *.so $(SODIR) - install -d $(MSGSDIR) - install -m 644 msgs/*.msg $(MSGSDIR) -+ install -d $(PIXMAPSDIR) -+ cp -r pixmaps/* $(PIXMAPSDIR) - install -d $(ETCDIR) - install -b -m 644 ejabberd.cfg.example $(ETCDIR)/ejabberd.cfg - install -d $(LOGDIR) -diff -ruN ejabberd-1.1.2.orig/src/mod_presence.erl ejabberd-1.1.2/src/mod_presence.erl ---- ejabberd-1.1.2.orig/src/mod_presence.erl 1970-01-01 03:00:00.000000000 +0300 -+++ ejabberd-1.1.2/src/mod_presence.erl 2006-09-25 19:45:31.000000000 +0400 -@@ -0,0 +1,572 @@ -+%%%---------------------------------------------------------------------- -+%%% File : mod_presence.erl -+%%% Author : Igor Goryachev <igor@goryachev.org> -+%%% Purpose : Module for showing presences via web -+%%% Created : 30 Apr 2006 by Igor Goryachev <igor@goryachev.org> -+%%% Id : $Id$ -+%%%---------------------------------------------------------------------- -+ -+-module(mod_presence). -+-author('igor@goryachev.org'). -+-vsn('$Revision$'). -+ -+-behaviour(gen_server). -+-behaviour(gen_mod). -+ -+%% API -+-export([start_link/2, -+ start/2, -+ stop/1, -+ get_info/2, -+ show_presence/1]). -+ -+%% gen_server callbacks -+-export([init/1, handle_call/3, handle_cast/2, handle_info/2, -+ terminate/2, code_change/3]). -+ -+-include("ejabberd.hrl"). -+-include("jlib.hrl"). -+ -+-record(presence_registered, {us_host, xml, icon}). -+-record(state, {host, server_host, access}). -+-record(session, {sid, usr, us, priority}). -+-record(presence, {resource, status, priority, text}). -+ -+-define(PROCNAME, ejabberd_mod_presence). -+-define(SERVICE_NAME(Host), "presence." ++ Host). -+ -+-define(PIXMAPS_DIR, "pixmaps"). -+ -+ -+%%==================================================================== -+%% API -+%%==================================================================== -+%%-------------------------------------------------------------------- -+%% Function: start_link() -> {ok,Pid} | ignore | {error,Error} -+%% Description: Starts the server -+%%-------------------------------------------------------------------- -+start_link(Host, Opts) -> -+ Proc = gen_mod:get_module_proc(Host, ?PROCNAME), -+ gen_server:start_link({local, Proc}, ?MODULE, [Host, Opts], []). -+ -+start(Host, Opts) -> -+ Proc = gen_mod:get_module_proc(Host, ?PROCNAME), -+ ChildSpec = -+ {Proc, -+ {?MODULE, start_link, [Host, Opts]}, -+ temporary, -+ 1000, -+ worker, -+ [?MODULE]}, -+ Dir = -+ case os:getenv("EJABBERD_PIXMAPS_PATH") of -+ false -> -+ case code:priv_dir(ejabberd) of -+ {error, _} -> -+ ?PIXMAPS_DIR; -+ Path -> -+ filename:join([Path, ?PIXMAPS_DIR]) -+ end; -+ Path -> -+ Path -+ end, -+ ets:new(pixmaps_dirs, [named_table, public]), -+ ets:insert(pixmaps_dirs, {directory, Dir}), -+ supervisor:start_child(ejabberd_sup, ChildSpec). -+ -+stop(Host) -> -+ Proc = gen_mod:get_module_proc(Host, ?PROCNAME), -+ gen_server:call(Proc, stop), -+ supervisor:stop_child(ejabberd_sup, Proc). -+ -+%%==================================================================== -+%% gen_server callbacks -+%%==================================================================== -+ -+%%-------------------------------------------------------------------- -+%% Function: init(Args) -> {ok, State} | -+%% {ok, State, Timeout} | -+%% ignore | -+%% {stop, Reason} -+%% Description: Initiates the server -+%%-------------------------------------------------------------------- -+init([Host, Opts]) -> -+ mnesia:create_table(presence_registered, -+ [{disc_copies, [node()]}, -+ {attributes, record_info(fields, presence_registered)}]), -+ MyHost = gen_mod:get_opt(host, Opts, ?SERVICE_NAME(Host)), -+ mnesia:add_table_index(presence_registered, xml), -+ mnesia:add_table_index(presence_registered, icon), -+ Access = gen_mod:get_opt(access, Opts, all), -+ AccessCreate = gen_mod:get_opt(access_create, Opts, all), -+ AccessAdmin = gen_mod:get_opt(access_admin, Opts, none), -+ ejabberd_router:register_route(MyHost), -+ {ok, #state{host = MyHost, -+ server_host = Host, -+ access = {Access, AccessCreate, AccessAdmin}}}. -+ -+%%-------------------------------------------------------------------- -+%% Function: %% handle_call(Request, From, State) -> {reply, Reply, State} | -+%% {reply, Reply, State, Timeout} | -+%% {noreply, State} | -+%% {noreply, State, Timeout} | -+%% {stop, Reason, Reply, State} | -+%% {stop, Reason, State} -+%% Description: Handling call messages -+%%-------------------------------------------------------------------- -+handle_call(stop, _From, State) -> -+ {stop, normal, ok, State}. -+ -+%%-------------------------------------------------------------------- -+%% Function: handle_cast(Msg, State) -> {noreply, State} | -+%% {noreply, State, Timeout} | -+%% {stop, Reason, State} -+%% Description: Handling cast messages -+%%-------------------------------------------------------------------- -+handle_cast(_Msg, State) -> -+ {noreply, State}. -+ -+%%-------------------------------------------------------------------- -+%% Function: handle_info(Info, State) -> {noreply, State} | -+%% {noreply, State, Timeout} | -+%% {stop, Reason, State} -+%% Description: Handling all non call/cast messages -+%%-------------------------------------------------------------------- -+handle_info({route, From, To, Packet}, -+ #state{host = Host, -+ server_host = ServerHost, -+ access = Access} = State) -> -+ case catch do_route(Host, ServerHost, Access, From, To, Packet) of -+ {'EXIT', Reason} -> -+ ?ERROR_MSG("~p", [Reason]); -+ _ -> -+ ok -+ end, -+ {noreply, State}; -+handle_info(_Info, State) -> -+ {noreply, State}. -+ -+%%-------------------------------------------------------------------- -+%% Function: terminate(Reason, State) -> void() -+%% Description: This function is called by a gen_server when it is about to -+%% terminate. It should be the opposite of Module:init/1 and do any necessary -+%% cleaning up. When it returns, the gen_server terminates with Reason. -+%% The return value is ignored. -+%%-------------------------------------------------------------------- -+terminate(_Reason, State) -> -+ ejabberd_router:unregister_route(State#state.host), -+ ok. -+ -+%%-------------------------------------------------------------------- -+%% Func: code_change(OldVsn, State, Extra) -> {ok, NewState} -+%% Description: Convert process state when code is changed -+%%-------------------------------------------------------------------- -+code_change(_OldVsn, State, _Extra) -> -+ {ok, State}. -+ -+%%-------------------------------------------------------------------- -+%%% Internal functions -+%%-------------------------------------------------------------------- -+ -+do_route(Host, ServerHost, Access, From, To, Packet) -> -+ {AccessRoute, _AccessCreate, _AccessAdmin} = Access, -+ case acl:match_rule(ServerHost, AccessRoute, From) of -+ allow -> -+ do_route1(Host, ServerHost, Access, From, To, Packet); -+ _ -> -+ {xmlelement, _Name, Attrs, _Els} = Packet, -+ Lang = xml:get_attr_s("xml:lang", Attrs), -+ ErrText = "Access denied by service policy", -+ Err = jlib:make_error_reply(Packet, -+ ?ERRT_FORBIDDEN(Lang, ErrText)), -+ ejabberd_router:route(To, From, Err) -+ end. -+ -+do_route1(Host, ServerHost, Access, From, To, Packet) -> -+ {_AccessRoute, AccessCreate, AccessAdmin} = Access, -+ {xmlelement, Name, Attrs, _Els} = Packet, -+ case Name of -+ "iq" -> -+ case jlib:iq_query_info(Packet) of -+ #iq{type = get, xmlns = ?NS_DISCO_INFO = XMLNS, -+ sub_el = _SubEl} = IQ -> -+ Res = IQ#iq{type = result, -+ sub_el = [{xmlelement, "query", -+ [{"xmlns", XMLNS}], -+ iq_disco_info()}]}, -+ ejabberd_router:route(To, -+ From, -+ jlib:iq_to_xml(Res)); -+ #iq{type = get, -+ xmlns = ?NS_DISCO_ITEMS} = IQ -> -+ ok; -+ #iq{type = get, -+ xmlns = ?NS_REGISTER = XMLNS, -+ lang = Lang, -+ sub_el = _SubEl} = IQ -> -+ Res = IQ#iq{type = result, -+ sub_el = -+ [{xmlelement, "query", -+ [{"xmlns", XMLNS}], -+ iq_get_register_info( -+ Host, From, Lang)}]}, -+ ejabberd_router:route(To, -+ From, -+ jlib:iq_to_xml(Res)); -+ #iq{type = set, -+ xmlns = ?NS_REGISTER = XMLNS, -+ lang = Lang, -+ sub_el = SubEl} = IQ -> -+ case process_iq_register_set(Host, From, SubEl, Lang) of -+ {result, IQRes} -> -+ Res = IQ#iq{type = result, -+ sub_el = -+ [{xmlelement, "query", -+ [{"xmlns", XMLNS}], -+ IQRes}]}, -+ ejabberd_router:route( -+ To, From, jlib:iq_to_xml(Res)); -+ {error, Error} -> -+ Err = jlib:make_error_reply( -+ Packet, Error), -+ ejabberd_router:route( -+ To, From, Err) -+ end; -+ #iq{type = get, -+ xmlns = ?NS_VCARD = XMLNS, -+ lang = Lang, -+ sub_el = _SubEl} = IQ -> -+ Res = IQ#iq{type = result, -+ sub_el = -+ [{xmlelement, "vCard", -+ [{"xmlns", XMLNS}], -+ iq_get_vcard(Lang)}]}, -+ ejabberd_router:route(To, -+ From, -+ jlib:iq_to_xml(Res)); -+ #iq{} -> -+ Err = jlib:make_error_reply( -+ Packet, -+ ?ERR_FEATURE_NOT_IMPLEMENTED), -+ ejabberd_router:route(To, From, Err); -+ _ -> -+ ok -+ end; -+ _ -> -+ case xml:get_attr_s("type", Attrs) of -+ "error" -> -+ ok; -+ "result" -> -+ ok; -+ _ -> -+ Err = jlib:make_error_reply( -+ Packet, ?ERR_ITEM_NOT_FOUND), -+ ejabberd_router:route(To, From, Err) -+ end -+ end. -+ -+iq_disco_info() -> -+ [{xmlelement, "identity", -+ [{"category", "presence"}, -+ {"type", "text"}, -+ {"name", "ejabberd/mod_presence"}], []}, -+ {xmlelement, "feature", [{"var", ?NS_REGISTER}], []}, -+ {xmlelement, "feature", [{"var", ?NS_VCARD}], []}]. -+ -+-define(XFIELD(Type, Label, Var, Val), -+ {xmlelement, "field", [{"type", Type}, -+ {"label", translate:translate(Lang, Label)}, -+ {"var", Var}], -+ [{xmlelement, "value", [], [{xmlcdata, Val}]}]}). -+ -+iq_get_register_info(Host, From, Lang) -> -+ {LUser, LServer, _} = jlib:jid_tolower(From), -+ LUS = {LUser, LServer}, -+ {XML, Icon, Registered} = -+ case catch mnesia:dirty_read(presence_registered, {LUS, Host}) of -+ {'EXIT', _Reason} -> -+ {"false", "disabled", []}; -+ [] -> -+ {"false", "disabled", []}; -+ [#presence_registered{xml = X, icon = I}] -> -+ {X, I, [{xmlelement, "registered", [], []}]} -+ end, -+ Registered ++ -+ [{xmlelement, "instructions", [], -+ [{xmlcdata, -+ translate:translate( -+ Lang, "You need an x:data capable client to register presence")}]}, -+ {xmlelement, "x", -+ [{"xmlns", ?NS_XDATA}], -+ [{xmlelement, "title", [], -+ [{xmlcdata, -+ translate:translate( -+ Lang, "Presence registration at ") ++ Host}]}, -+ {xmlelement, "instructions", [], -+ [{xmlcdata, -+ translate:translate( -+ Lang, "What presence features do you want to register?")}]}, -+ {xmlelement, "field", [{"type", "list-single"}, -+ {"label", "Icon theme"}, -+ {"var", "icon"}], -+ [{xmlelement, "value", [], [{xmlcdata, Icon}]}, -+ {xmlelement, "option", [{"label", "disabled"}], -+ [{xmlelement, "value", [], [{xmlcdata, "disabled"}]}]} -+ ] ++ available_themes(xdata)}, -+ ?XFIELD("boolean", "Raw XML", "xml", XML)]}]. -+ -+iq_set_register_info(Host, From, XML, Icon, Lang) -> -+ {LUser, LServer, _} = jlib:jid_tolower(From), -+ LUS = {LUser, LServer}, -+ F = fun() -> -+ case XML of -+ "" -> -+ mnesia:delete({presence_registered, {LUS, Host}}), -+ ok; -+ _ -> -+ Allow = -+ case mnesia:select( -+ presence_registered, -+ [{#presence_registered{us_host = '$1', -+ xml = XML, -+ icon = Icon, -+ _ = '_'}, -+ [{'==', {element, 2, '$1'}, Host}], -+ ['$_']}]) of -+ [] -> -+ true; -+ [#presence_registered{us_host = {U, _Host}}] -> -+ U == LUS -+ end, -+ if -+ Allow -> -+ mnesia:write( -+ #presence_registered{us_host = {LUS, Host}, -+ xml = XML, -+ icon = Icon}), -+ ok; -+ true -> -+ false -+ end -+ end -+ end, -+ case mnesia:transaction(F) of -+ {atomic, ok} -> -+ {result, []}; -+ {atomic, false} -> -+ ErrText = "Specified presence is already registered", -+ {error, ?ERRT_CONFLICT(Lang, ErrText)}; -+ _ -> -+ {error, ?ERR_INTERNAL_SERVER_ERROR} -+ end. -+ -+process_iq_register_set(Host, From, SubEl, Lang) -> -+ {xmlelement, _Name, _Attrs, Els} = SubEl, -+ case xml:get_subtag(SubEl, "remove") of -+ false -> -+ case xml:remove_cdata(Els) of -+ [{xmlelement, "x", _Attrs1, _Els1} = XEl] -> -+ case {xml:get_tag_attr_s("xmlns", XEl), -+ xml:get_tag_attr_s("type", XEl)} of -+ {?NS_XDATA, "cancel"} -> -+ {result, []}; -+ {?NS_XDATA, "submit"} -> -+ XData = jlib:parse_xdata_submit(XEl), -+ case XData of -+ invalid -> -+ {error, ?ERR_BAD_REQUEST}; -+ _ -> -+ case lists:keysearch("xml", 1, XData) of -+ false -> -+ ErrText = "You must fill in field \"Xml\" in the form", -+ {error, ?ERRT_NOT_ACCEPTABLE(Lang, ErrText)}; -+ {value, {_, [XML]}} -> -+ case lists:keysearch("icon", 1, XData) of -+ false -> -+ ErrText = "You must fill in field \"Icon\" in the form", -+ {error, ?ERRT_NOT_ACCEPTABLE(Lang, ErrText)}; -+ {value, {_, [Icon]}} -> -+ iq_set_register_info(Host, From, XML, Icon, Lang) -+ end -+ end -+ end; -+ _ -> -+ {error, ?ERR_BAD_REQUEST} -+ end; -+ _ -> -+ {error, ?ERR_BAD_REQUEST} -+ end; -+ _ -> -+ iq_set_register_info(Host, From, "false", "disabled", Lang) -+ end. -+ -+iq_get_vcard(Lang) -> -+ [{xmlelement, "FN", [], -+ [{xmlcdata, "ejabberd/mod_presence"}]}, -+ {xmlelement, "URL", [], -+ [{xmlcdata, -+ "http://ejabberd.jabberstudio.org/"}]}, -+ {xmlelement, "DESC", [], -+ [{xmlcdata, translate:translate(Lang, "ejabberd presence module\n" -+ "Copyright (c) 2006 Igor Goryachev")}]}]. -+ -+get_info(LUser, LServer) -> -+ LUS = {LUser, LServer}, -+ case catch mnesia:dirty_read(presence_registered, {LUS, ?SERVICE_NAME(LServer)}) of -+ {'EXIT', _Reason} -> -+ {false, disabled}; -+ [] -> -+ {false, disabled}; -+ [#presence_registered{xml = X, icon = I}] -> -+ X1 = case X of -+ "0" -> false; -+ "1" -> true; -+ _ -> list_to_atom(X) -+ end, -+ {X1, list_to_atom(I)} -+ end. -+ -+get_status_weight(Status) -> -+ case Status of -+ "chat" -> 0; -+ "available" -> 1; -+ "away" -> 2; -+ "xa" -> 3; -+ "dnd" -> 4; -+ _ -> 9 -+ end. -+ -+ -+get_presences({bare, LUser, LServer}) -> -+ Resources = ejabberd_sm:get_user_resources(LUser, LServer), -+ lists:map( -+ fun(Resource) -> -+ [Session] = mnesia:dirty_index_read(session, -+ {LUser, LServer, Resource}, -+ #session.usr), -+ Pid = element(2, Session#session.sid), -+ {_User, _Resource, Status, Text} = -+ rpc:call(node(Pid), ejabberd_c2s, get_presence, [Pid]), -+ Priority = Session#session.priority, -+ #presence{resource = Resource, -+ status = Status, -+ priority = Priority, -+ text = Text} -+ end, -+ Resources); -+get_presences({sorted, LUser, LServer}) -> -+ lists:sort( -+ fun(A, B) -> -+ if -+ A#presence.priority == B#presence.priority -> -+ WA = get_status_weight(A#presence.status), -+ WB = get_status_weight(B#presence.status), -+ WA < WB; -+ true -> -+ A#presence.priority > B#presence.priority -+ end -+ end, -+ get_presences({bare, LUser, LServer})); -+get_presences({xml, LUser, LServer}) -> -+ {xmlelement, "presence", -+ [{"user", LUser}, {"server", LServer}], -+ lists:map( -+ fun(Presence) -> -+ {xmlelement, "resource", -+ [{"name", Presence#presence.resource}, -+ {"status", Presence#presence.status}, -+ {"priority", integer_to_list(Presence#presence.priority)}], -+ [{xmlcdata, Presence#presence.text}]} -+ end, -+ get_presences({sorted, LUser, LServer}))}; -+get_presences({status, LUser, LServer}) -> -+ case get_presences({sorted, LUser, LServer}) of -+ [Highest | _Rest] -> -+ Highest#presence.status; -+ _ -> -+ "unavailable" -+ end; -+get_presences(_) -> -+ []. -+ -+-define(XML_HEADER, "<?xml version='1.0' encoding='utf-8'?>"). -+ -+get_pixmaps_directory() -> -+ [{directory, Path} | _] = ets:lookup(pixmaps_dirs, directory), -+ Path. -+ -+available_themes(list) -> -+ case file:list_dir(get_pixmaps_directory()) of -+ {ok, List} -> -+ List; -+ {error, _} -> -+ [] -+ end; -+available_themes(xdata) -> -+ lists:map( -+ fun(Theme) -> -+ {xmlelement, "option", [{"label", Theme}], -+ [{xmlelement, "value", [], [{xmlcdata, Theme}]}]} -+ end, available_themes(list)); -+available_themes(_) -> -+ []. -+ -+-define(XE(Name, Els), {xmlelement, Name, [], Els}). -+-define(C(Text), {xmlcdata, Text}). -+-define(XC(Name, Text), ?XE(Name, [?C(Text)])). -+ -+show_presence({xml, LUser, LServer}) -> -+ {XML, _Icon} = get_info(LUser, LServer), -+ case XML of -+ true -> -+ {200, [{"Content-Type", "text/xml; charset=utf-8"}], -+ ?XML_HEADER ++ xml:element_to_string( -+ get_presences({xml, LUser, LServer}))}; -+ _ -> -+ {404, [], ejabberd_web:make_xhtml([?XC("h1", "Not found")])} -+ end; -+show_presence({image, LUser, LServer}) -> -+ {_XML, Icon} = get_info(LUser, LServer), -+ case Icon of -+ disabled -> -+ {404, [], ejabberd_web:make_xhtml([?XC("h1", "Not found")])}; -+ _ -> -+ show_presence({image_no_check, LUser, LServer, atom_to_list(Icon)}) -+ end; -+show_presence({image, LUser, LServer, Theme}) -> -+ {_XML, Icon} = get_info(LUser, LServer), -+ case Icon of -+ disabled -> -+ {404, [], ejabberd_web:make_xhtml([?XC("h1", "Not found")])}; -+ _ -> -+ show_presence({image_no_check, LUser, LServer, Theme}) -+ end; -+show_presence({image_no_check, LUser, LServer, Theme}) -> -+ case lists:member(Theme, available_themes(list)) of -+ true -> -+ case filelib:wildcard( -+ filename:join([get_pixmaps_directory(), Theme, -+ get_presences( -+ {status, LUser, LServer}) ++ ".{gif,png,jpg}"])) of -+ [First | _Rest] -> -+ CT = case string:substr(First, string:len(First) - 2, 3) of -+ "gif" -> "gif"; -+ "png" -> "png"; -+ "jpg" -> "jpeg" -+ end, -+ case file:read_file(First) of -+ {ok, Content} -> -+ {200, [{"Content-Type", "image/" ++ CT}], -+ binary_to_list(Content)}; -+ _ -> -+ {404, [], ejabberd_web:make_xhtml([?XC("h1", "Not found")])} -+ end; -+ _ -> -+ {404, [], ejabberd_web:make_xhtml([?XC("h1", "Not found")])} -+ end; -+ false -> -+ {404, [], ejabberd_web:make_xhtml([?XC("h1", "Not found")])} -+ end; -+show_presence(_) -> -+ {404, [], ejabberd_web:make_xhtml([?XC("h1", "Not found")])}. -+ -diff -ruN ejabberd-1.1.2.orig/src/web/ejabberd_web.erl ejabberd-1.1.2/src/web/ejabberd_web.erl ---- ejabberd-1.1.2.orig/src/web/ejabberd_web.erl 2006-02-07 11:42:39.000000000 +0300 -+++ ejabberd-1.1.2/src/web/ejabberd_web.erl 2006-09-25 19:18:13.000000000 +0400 -@@ -139,6 +139,33 @@ - lang = _Lang} = Request) -> - ejabberd_http_poll:process_request(Request#request{path = RPath}); - -+process_get({true, _}, -+ #request{path = ["presence" | RPath], -+ q = _Query, -+ lang = _Lang} = Request) -> -+ case RPath of -+ [User, Server | Tail] -> -+ LServer = jlib:nameprep(Server), -+ case lists:member(LServer, ?MYHOSTS) of -+ true -> -+ LUser = jlib:nodeprep(User), -+ case Tail of -+ ["xml"] -> -+ mod_presence:show_presence({xml, LUser, LServer}); -+ ["image"] -> -+ mod_presence:show_presence({image, LUser, LServer}); -+ ["image", Theme] -> -+ mod_presence:show_presence({image, LUser, LServer, Theme}); -+ _ -> -+ {404, [], make_xhtml([?XC("h1", "Not found")])} -+ end; -+ false -> -+ {404, [], make_xhtml([?XC("h1", "Not found")])} -+ end; -+ _ -> -+ {404, [], make_xhtml([?XC("h1", "Not found")])} -+ end; -+ - process_get(_, _Request) -> - {404, [], make_xhtml([?XC("h1", "Not found")])}. - |