diff options
author | novel <novel@FreeBSD.org> | 2005-06-29 19:44:07 +0800 |
---|---|---|
committer | novel <novel@FreeBSD.org> | 2005-06-29 19:44:07 +0800 |
commit | e5809ae25f65c525a0db802928616c6cc7ed4860 (patch) | |
tree | 0f8912f8aa3fd50df3c0c83a50fb0f5d4e8b92aa /net-im | |
parent | 52bbfdc9480a810d42d1715b9b5bc8d2646c1ce1 (diff) | |
download | freebsd-ports-gnome-e5809ae25f65c525a0db802928616c6cc7ed4860.tar.gz freebsd-ports-gnome-e5809ae25f65c525a0db802928616c6cc7ed4860.tar.zst freebsd-ports-gnome-e5809ae25f65c525a0db802928616c6cc7ed4860.zip |
Add jabber-users-agent 1.2, a Perl based Jabber User Directory.
PR: 82195
Submitted by: Renato Botelho <freebsd@galle.com.br>
Diffstat (limited to 'net-im')
-rw-r--r-- | net-im/jabber-users-agent/Makefile | 50 | ||||
-rw-r--r-- | net-im/jabber-users-agent/distinfo | 2 | ||||
-rw-r--r-- | net-im/jabber-users-agent/files/jabber-users-agent.sh.in | 37 | ||||
-rw-r--r-- | net-im/jabber-users-agent/files/patch-config.xml | 13 | ||||
-rw-r--r-- | net-im/jabber-users-agent/files/patch-users-agent | 57 | ||||
-rw-r--r-- | net-im/jabber-users-agent/files/pkg-message.in | 9 | ||||
-rw-r--r-- | net-im/jabber-users-agent/pkg-descr | 5 | ||||
-rw-r--r-- | net-im/jabber-users-agent/pkg-plist | 8 |
8 files changed, 181 insertions, 0 deletions
diff --git a/net-im/jabber-users-agent/Makefile b/net-im/jabber-users-agent/Makefile new file mode 100644 index 000000000000..8be0eb52cedc --- /dev/null +++ b/net-im/jabber-users-agent/Makefile @@ -0,0 +1,50 @@ +# New ports collection makefile for: jabber-users-agent +# Date created: 2005-06-07 +# Whom: Renato Botelho <freebsd@galle.com.br> +# +# $FreeBSD$ +# + +PORTNAME= users-agent +PORTVERSION= 1.2 +CATEGORIES= net +MASTER_SITES= http://files.jabberstudio.org/users-agent/ +PKGNAMEPREFIX= jabber- +DISTNAME= Users-Agent-${PORTVERSION} + +MAINTAINER= freebsd@galle.com.br +COMMENT= A Perl based Jabber User Directory + +NO_BUILD= yes +STRIP= +WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} +INST_DIR= ${PREFIX}/lib/jabber/${PORTNAME} +PORTDOCS= README INSTALL +USE_RC_SUBR= jabber-users-agent.sh +SUB_LIST+= PERL=${PERL} + +BUILD_DEPENDS+= ${SITE_PERL}/Net/Jabber.pm:${PORTSDIR}/net/p5-Net-Jabber \ + ${SITE_PERL}/${PERL_ARCH}/DBD/mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql + +.include <bsd.port.pre.mk> + +post-patch: + @${PERL} -pi -e 's|config.xml|${PREFIX}/etc/jabber-users-agent.xml|g' \ + ${WRKSRC}/users-agent + @${PERL} -pi -e 's|%%PERL%%|${PERL}|g' ${WRKSRC}/users-agent + +do-install: + ${MKDIR} ${INST_DIR} + ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${WRKSRC}/createDB ${INST_DIR} + +.if !exists(${PREFIX}/etc/jabber-users-agent.xml) + ${INSTALL_DATA} ${WRKSRC}/config.xml ${PREFIX}/etc/jabber-users-agent.xml +.endif + ${INSTALL_DATA} ${WRKSRC}/config.xml ${PREFIX}/etc/jabber-users-agent.xml.sample + +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} + ${INSTALL_DATA} ${PORTDOCS:S!^!${WRKSRC}/!} ${DOCSDIR} +.endif + +.include <bsd.port.post.mk> diff --git a/net-im/jabber-users-agent/distinfo b/net-im/jabber-users-agent/distinfo new file mode 100644 index 000000000000..207d6daa944a --- /dev/null +++ b/net-im/jabber-users-agent/distinfo @@ -0,0 +1,2 @@ +MD5 (Users-Agent-1.2.tar.gz) = e1d580dc34b56d00a1990464659ea766 +SIZE (Users-Agent-1.2.tar.gz) = 7871 diff --git a/net-im/jabber-users-agent/files/jabber-users-agent.sh.in b/net-im/jabber-users-agent/files/jabber-users-agent.sh.in new file mode 100644 index 000000000000..cc06be8b2de7 --- /dev/null +++ b/net-im/jabber-users-agent/files/jabber-users-agent.sh.in @@ -0,0 +1,37 @@ +#!/bin/sh + +# Start or stop jabber-users-agent +# $FreeBSD$ + +# PROVIDE: jabber_users_agent +# REQUIRE: DAEMON +# BEFORE: LOGIN +# KEYWORD: FreeBSD shutdown +# +# Define these jabber_users_agent_* variables in one of these files: +# /etc/rc.conf +# /etc/rc.conf.local +# +# DO NOT CHANGE THESE DEFAULT VALUES HERE +# +jabber_users_agent_dir=${jabberd_users_agent_dir-"%%PREFIX%%/lib/jabber/users-agent"} +jabber_users_agent_enable=${jabberd_users_agent_enable-"NO"} + +. /etc/rc.subr + +name="jabber_users_agent" +rcvar=`set_rcvar` +command_interpreter="%%PERL%%" +command="${jabber_users_agent_dir}/users-agent" +command_args="&" + +pidfile="/var/jabberd/pid/users-agent.pid" + +load_rc_config $name +stop_postcmd="jabber_users_agent_stop_post" + +jabber_users_agent_stop_post () { + rm -f ${pidfile} +} + +run_rc_command "$1" diff --git a/net-im/jabber-users-agent/files/patch-config.xml b/net-im/jabber-users-agent/files/patch-config.xml new file mode 100644 index 000000000000..dd30bcf8c6b9 --- /dev/null +++ b/net-im/jabber-users-agent/files/patch-config.xml @@ -0,0 +1,13 @@ +--- config.xml.orig Thu Jun 9 07:25:05 2005 ++++ config.xml Thu Jun 9 07:33:13 2005 +@@ -10,6 +10,10 @@ + </component> + <mysql> + <dbname>JUD</dbname> ++ <!-- ++ <host>mysql.remote.server</host> ++ <port>3306</port> ++ --> + <username>someone</username> + <password>something</password> + <limit>250</limit> diff --git a/net-im/jabber-users-agent/files/patch-users-agent b/net-im/jabber-users-agent/files/patch-users-agent new file mode 100644 index 000000000000..3c7de0aa7eaa --- /dev/null +++ b/net-im/jabber-users-agent/files/patch-users-agent @@ -0,0 +1,57 @@ +--- users-agent.orig Mon Sep 6 23:05:32 2004 ++++ users-agent Mon Jun 13 09:19:06 2005 +@@ -1,9 +1,4 @@ +-#!/bin/sh +-#-*-Perl-*- +- +-exec perl -x $0 "$@"; +- +-#!perl ++#!%%PERL%% + + ############################################################################## + # +@@ -29,7 +24,7 @@ + + my %optctl = (); + $optctl{debug} = 0; +-$optctl{config} = "config.xml"; ++$optctl{config} = "/usr/local/etc/jabber-users-agent.xml"; + &GetOptions(\%optctl, "debug=i","config=s"); + + if (!(-f $optctl{config})) +@@ -39,6 +34,10 @@ + exit(1); + } + ++open(PIDFILE,">/var/jabberd/pid/users-agent.pid"); ++ print PIDFILE "$$"; ++close(PIDFILE); ++ + my $Debug = new Net::Jabber::Debug(level=>$optctl{debug}, + header=>"Users-Agent"); + +@@ -119,8 +118,13 @@ + ############################################################################## + &readConfigXML(); + ++my $data_source = "DBI:mysql:database=".$config{mysql}->{dbname}; ++ ++if ($config{mysql}->{host} ne '') { ++ $data_source .= ";host=".$config{mysql}->{host}.";port=".($config{mysql}->{port} eq '' ? '3306' : $config{mysql}->{port}); ++} + +-my $dbh = DBI->connect("DBI:mysql:database=".$config{mysql}->{dbname},$config{mysql}->{username},$config{mysql}->{password}); ++my $dbh = DBI->connect($data_source,$config{mysql}->{username},$config{mysql}->{password}); + #$dbh->trace(2) if (($optctl{debug} > 0) && defined($dbh)); + + ############################################################################## +@@ -174,7 +178,7 @@ + + ############################################################################## + # +-# readConfigXML - read the config.xml file, parse it, and set config hash ++# readConfigXML - read the /usr/local/etc/jabber-users-agent.xml file, parse it, and set config hash + # with the proper settings. + # + ############################################################################## diff --git a/net-im/jabber-users-agent/files/pkg-message.in b/net-im/jabber-users-agent/files/pkg-message.in new file mode 100644 index 000000000000..b3057d262a18 --- /dev/null +++ b/net-im/jabber-users-agent/files/pkg-message.in @@ -0,0 +1,9 @@ +ATTENTION: + +Before start to use this, you need to create a MySQL database. You +can use a script to help you, this script is installed as +%%PREFIX%%/lib/jabber/users-agent/createDB. You will find instructions +to use it on %%DOCSDIR%%/INSTALL. + +After create the database, configure host, username and password +to access it on %%PREFIX%%/etc/jabber-users-agent.xml. diff --git a/net-im/jabber-users-agent/pkg-descr b/net-im/jabber-users-agent/pkg-descr new file mode 100644 index 000000000000..6dad63928790 --- /dev/null +++ b/net-im/jabber-users-agent/pkg-descr @@ -0,0 +1,5 @@ +A Perl based Jabber User Directory. Currently the +one running on users.jabber.org. + +Author: reatmon@jabber.org +WWW: http://jabberstudio.org/projects/users-agent/ diff --git a/net-im/jabber-users-agent/pkg-plist b/net-im/jabber-users-agent/pkg-plist new file mode 100644 index 000000000000..7e8e8052a252 --- /dev/null +++ b/net-im/jabber-users-agent/pkg-plist @@ -0,0 +1,8 @@ +@comment $FreeBSD$ +lib/jabber/users-agent/createDB +lib/jabber/users-agent/users-agent +@dirrm lib/jabber/users-agent +@unexec rmdir %D/lib/jabber 2>/dev/null || true +@unexec if cmp -s %D/etc/jabber-users-agent.xml %D/etc/jabber-users-agent.xml.sample; then rm -f %D/etc/jabber-users-agent.xml; fi +etc/jabber-users-agent.xml.sample +@exec [ -f %B/jabber-users-agent.xml ] || cp %B/%f %B/jabber-users-agent.xml |