1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-02-04 11:23:46 +00:00

Add jabber-users-agent 1.2, a Perl based Jabber User Directory.

PR:		82195
Submitted by:	Renato Botelho <freebsd@galle.com.br>
This commit is contained in:
Roman Bogorodskiy 2005-06-29 11:44:07 +00:00
parent b57fee216e
commit 6fe89aea5e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=138174
17 changed files with 363 additions and 0 deletions

View File

@ -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>

View File

@ -0,0 +1,2 @@
MD5 (Users-Agent-1.2.tar.gz) = e1d580dc34b56d00a1990464659ea766
SIZE (Users-Agent-1.2.tar.gz) = 7871

View File

@ -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"

View File

@ -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>

View File

@ -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.
#
##############################################################################

View File

@ -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.

View File

@ -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/

View File

@ -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

View File

@ -269,6 +269,7 @@
SUBDIR += jabber-msn
SUBDIR += jabber-pyicq
SUBDIR += jabber-pymsn
SUBDIR += jabber-users-agent
SUBDIR += jabber-xdb_ldap
SUBDIR += jabber-yahoo
SUBDIR += jabberd

View File

@ -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>

View File

@ -0,0 +1,2 @@
MD5 (Users-Agent-1.2.tar.gz) = e1d580dc34b56d00a1990464659ea766
SIZE (Users-Agent-1.2.tar.gz) = 7871

View File

@ -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"

View File

@ -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>

View File

@ -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.
#
##############################################################################

View File

@ -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.

View File

@ -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/

View File

@ -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