View | Details | Raw Unified | Return to bug 102406 | Differences between
and this patch

Collapse All | Expand All

(-)net-p2p/verlihub/Makefile (-15 / +18 lines)
Lines 7-13 Link Here
7
7
8
PORTNAME=	verlihub
8
PORTNAME=	verlihub
9
PORTVERSION=	0.9.8.c
9
PORTVERSION=	0.9.8.c
10
PORTREVISION=	1
10
PORTREVISION=	2
11
PORTEPOCH=	1
11
PORTEPOCH=	1
12
CATEGORIES=	net-p2p
12
CATEGORIES=	net-p2p
13
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
13
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
Lines 15-53 Link Here
15
DISTNAME=	verlihub-0.9.8c-RC2
15
DISTNAME=	verlihub-0.9.8c-RC2
16
16
17
MAINTAINER=	hurbold@yahoo.com
17
MAINTAINER=	hurbold@yahoo.com
18
COMMENT=	Verlihub Linux/Unix Direct Connect Hub Software
18
COMMENT=	A Direct Connect protocol server (Hub)
19
19
20
# XXX: Actually, bash isn't required for building,
21
# but otherwise configure script would pick the wrong path
22
BUILD_DEPENDS=	bash:${PORTSDIR}/shells/bash
20
LIB_DEPENDS=	GeoIP.5:${PORTSDIR}/net/GeoIP \
23
LIB_DEPENDS=	GeoIP.5:${PORTSDIR}/net/GeoIP \
21
		pcre.0:${PORTSDIR}/devel/pcre
24
		pcre.0:${PORTSDIR}/devel/pcre
22
RUN_DEPENDS=	bash:${PORTSDIR}/shells/bash
25
RUN_DEPENDS=	bash:${PORTSDIR}/shells/bash
23
26
24
WRKSRC=		${WRKDIR}/verlihub-0.9.8c
27
WRKSRC=		${WRKDIR}/verlihub-0.9.8c
25
28
29
USE_RC_SUBR=	verlihub
30
26
USE_MYSQL=	yes
31
USE_MYSQL=	yes
27
USE_PERL5=	yes
28
USE_GMAKE=	yes
29
GNU_CONFIGURE=	yes
32
GNU_CONFIGURE=	yes
30
USE_LDCONFIG=	yes
33
USE_LDCONFIG=	yes
31
CONFIGURE_ENV=	CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include"
34
USE_GCC=	3.4+
35
USE_OPENSSL=	yes
32
SUB_FILES+=	pkg-message
36
SUB_FILES+=	pkg-message
33
37
34
PKGMESSAGE=	${WRKDIR}/pkg-message
38
SUB_FILES=	pkg-message
35
PORTDOCS=	configuring.txt help.sql using.txt features.html help.html params.php verlihub.html
39
DOCS=	configuring.txt using.txt help.html verlihub.html
36
40
MANUAL_DOCS=	verlihub.css verlihub_manual.html
37
.include <bsd.port.pre.mk>
41
PORTDOCS=	${DOCS} ${MANUAL_DOCS}
38
39
.if ${OSVERSION} < 500000
40
USE_GCC=	3.4+
41
.endif
42
42
43
post-install:
43
post-install:
44
.if !defined(NOPORTDOCS)
44
.if !defined(NOPORTDOCS)
45
	${MKDIR} ${DOCSDIR}
45
	${MKDIR} ${DOCSDIR}
46
.for i in ${PORTDOCS}
46
.for i in ${DOCS}
47
	${INSTALL_DATA} ${WRKSRC}/docs/${i} ${DOCSDIR}
47
	${INSTALL_DATA} ${WRKSRC}/docs/${i} ${DOCSDIR}
48
.endfor
48
.endfor
49
.for i in ${MANUAL_DOCS}
50
	${INSTALL_DATA} ${WRKSRC}/docs/html_manual/${i} ${DOCSDIR}
51
.endfor
49
.endif
52
.endif
50
53
51
	@${CAT} ${PKGMESSAGE}
54
	@${CAT} ${PKGMESSAGE}
52
55
53
.include <bsd.port.post.mk>
56
.include <bsd.port.mk>
(-)net-p2p/verlihub/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
MD5 (verlihub-0.9.8c-RC2.tar.gz) = f3f4f6e1b8010935714609c3faa6577f
1
MD5 (verlihub-0.9.8c-RC2.tar.gz) = c536dd46daefe8b91c3872837d1deeb2
2
SHA256 (verlihub-0.9.8c-RC2.tar.gz) = 853ab3ab8260da1c67d07fec672e5206152001eae7e5ecda526603b0d5e4be12
2
SHA256 (verlihub-0.9.8c-RC2.tar.gz) = 571e637eacf1176c968e09528331d4257f4932186ae4ca9e8d4353d1cffa7e1c
3
SIZE (verlihub-0.9.8c-RC2.tar.gz) = 696574
3
SIZE (verlihub-0.9.8c-RC2.tar.gz) = 701081
(-)net-p2p/verlihub/pkg-descr (-1 / +1 lines)
Lines 4-10 Link Here
4
Additional functionality is available through a versatile
4
Additional functionality is available through a versatile
5
'plugin' system.
5
'plugin' system.
6
 
6
 
7
WWW: http://verlihub.sourceforge.net
7
WWW: http://www.verlihub-project.org/
8
8
9
-Hurbold
9
-Hurbold
10
hurbold@yahoo.com
10
hurbold@yahoo.com
(-)net-p2p/verlihub/files/patch-db_charset (+83 lines)
Added Link Here
1
--- src/cdbconf.cpp	Thu Apr  8 02:16:21 2004
2
+++ src/cdbconf.cpp	Thu Oct 12 16:57:43 2006
3
@@ -18,6 +18,7 @@
4
 	Add("db_user",db_user,string("verlihub"));
5
 	Add("db_pass",db_pass,string(""));
6
 	Add("db_data",db_data,string("verlihub"));
7
+	Add("db_charset",db_charset,string("latin1"));
8
 	Add("config_name",config_name,string("config"));
9
 	Add("lang_name",lang_name,string("lang_en"));
10
 	Load();
11
 
12
diff -Nur verlihub-orig/src/cdbconf.h verlihub/src/cdbconf.h
13
--- src/cdbconf.h	2006-07-15 18:42:52.000000000 +0400
14
+++ src/cdbconf.h	2006-07-15 18:43:50.000000000 +0400
15
@@ -31,6 +31,7 @@
16
 	string db_user;
17
 	string db_pass;
18
 	string db_data;
19
+	string db_charset;
20
 	string config_name;
21
 	string lang_name;
22
 	bool allow_exec;
23
diff -Nur verlihub-orig/src/cmysql.cpp verlihub/src/cmysql.cpp
24
--- src/cmysql.cpp	2006-07-15 18:42:52.000000000 +0400
25
+++ src/cmysql.cpp	2006-07-15 18:45:25.000000000 +0400
26
@@ -19,10 +19,10 @@
27
 /*!
28
     \fn nMySQL::cMySQL::cMySQL(string&host,string&user,string&pass,string&data)
29
  */
30
-cMySQL::cMySQL(string&host,string&user,string&pass,string&data) : cObj("cMySQL")
31
+cMySQL::cMySQL(string&host,string&user,string&pass,string&data,string&charset) : cObj("cMySQL")
32
 {
33
     Init();
34
-    if(!Connect(host,user,pass,data))
35
+    if(!Connect(host,user,pass,data,charset))
36
     {
37
     	throw "Mysql connection error.";
38
     }
39
@@ -40,12 +40,13 @@
40
 	if(!mDBHandle) Error(0, string("Can't init mysql structure :(.: "));
41
 }
42
 
43
-bool cMySQL::Connect(string &host, string &user, string &pass, string &data)
44
+bool cMySQL::Connect(string &host, string &user, string &pass, string &data, string &charset)
45
 {
46
 	if(Log(1)) LogStream() << "Connecting to mysql server: "
47
-			<< user << "@" << host << "/" << data << endl;
48
+			<< user << "@" << host << "/" << data << "with charset " << charset << endl;
49
 
50
 	mysql_options(mDBHandle,MYSQL_OPT_COMPRESS,0);
51
+	mysql_options(mDBHandle,MYSQL_SET_CHARSET_NAME,charset.c_str());
52
 	if(!mysql_real_connect(
53
 		mDBHandle,
54
 		host.c_str(),
55
diff -Nur verlihub-orig/src/cmysql.h verlihub/src/cmysql.h
56
--- src/cmysql.h	2006-07-15 18:42:52.000000000 +0400
57
+++ src/cmysql.h	2006-07-15 18:43:50.000000000 +0400
58
@@ -34,10 +34,10 @@
59
 friend class cQuery;
60
 public:
61
 	cMySQL();
62
-	cMySQL(string&host,string&user,string&pass,string&data);
63
+	cMySQL(string&host,string&user,string&pass,string&data,string&charset);
64
 	~cMySQL();
65
 	void Init();
66
-	bool Connect(string &host, string &user, string &passwd, string &db);
67
+	bool Connect(string &host, string &user, string &passwd, string &db, string &charset);
68
 	public: void Error(int level, string text);
69
 
70
 private:
71
diff -Nur verlihub-orig/src/cserverdc.cpp verlihub/src/cserverdc.cpp
72
--- src/cserverdc.cpp	2006-07-15 18:42:52.000000000 +0400
73
+++ src/cserverdc.cpp	2006-07-15 18:43:50.000000000 +0400
74
@@ -72,7 +72,8 @@
75
 		mDBConf.db_host,
76
 		mDBConf.db_user,
77
 		mDBConf.db_pass,
78
-		mDBConf.db_data), // connect to mysql
79
+		mDBConf.db_data,
80
+		mDBConf.db_charset), // connect to mysql
81
 	mC(*this), // create the config object
82
 	mL(*this),
83
 	mSetupList(mMySQL),
(-)net-p2p/verlihub/files/patch-plugins (+45 lines)
Added Link Here
1
diff -ruN src-orig/cpluginloader.cpp src/cpluginloader.cpp
2
--- src-orig/cpluginloader.cpp	Fri Oct  1 15:19:44 2004
3
+++ src/cpluginloader.cpp	Thu Oct 12 17:16:22 2006
4
@@ -40,6 +40,12 @@
5
  */
6
 bool nPlugin::cPluginLoader::Open()
7
 {
8
+	/*
9
+	* Reset dlerror() since it can contain error from previous
10
+	* call to dlopen()/dlsym().
11
+	*/
12
+	dlerror();
13
+
14
 	mHandle = dlopen(mFileName.c_str(), RTLD_NOW);
15
 	if(!mHandle || IsError()) // NOTE hte OR (||) operator evaluates only the first statement if that one is true
16
 	{
17
@@ -99,6 +105,12 @@
18
  */
19
 void * nPlugin::cPluginLoader::LoadSym(const char *name)
20
 {
21
+	/*
22
+	* Reset dlerror() since it can contain error from previous
23
+	* call to dlopen()/dlsym().
24
+	*/
25
+	dlerror();
26
+
27
 	void *func = dlsym( mHandle, name);
28
 	if(IsError())
29
 	{
30
diff -ruN src-orig/tpluginbase.cpp src/tpluginbase.cpp
31
--- src-orig/tpluginbase.cpp	Fri Oct  1 15:19:44 2004
32
+++ src/tpluginbase.cpp	Thu Oct 12 17:16:39 2006
33
@@ -34,6 +34,12 @@
34
  */
35
 bool nPlugin::tPluginBase::Open()
36
 {
37
+	/*
38
+	* Reset dlerror() since it can contain error from previous
39
+	* call to dlopen()/dlsym().
40
+	*/
41
+	dlerror();
42
+
43
 	mHandle = dlopen(mFileName.c_str(), RTLD_NOW);
44
 	if(!mHandle)
45
 	{
(-)net-p2p/verlihub/files/patch-prefix-conf-dir (+24 lines)
Added Link Here
1
Index: src/verlihub.cpp
2
===================================================================
3
RCS file: /cvsroot/verlihub/verlihub/src/verlihub.cpp,v
4
retrieving revision 1.14
5
diff -u -r1.14 verlihub.cpp
6
--- src/verlihub.cpp	24 Apr 2005 19:35:30 -0000	1.14
7
+++ src/verlihub.cpp	8 Dec 2006 21:08:11 -0000
8
@@ -25,6 +25,7 @@
9
 #include <sstream>
10
 #include <signal.h>
11
 #include <dirent.h>
12
+#include <dirsettings.h>
13
 #include "script_api.h"
14
 
15
 using namespace std;
16
@@ -81,6 +82,8 @@
17
 		const char *DirName = NULL;
18
 		char *HomeDir = getenv("HOME");
19
 		string tmp;
20
+		DirName = PREFIXDIR "/etc/verlihub";
21
+		if ((DirName != NULL) && DirExists(DirName)) ConfigBase = DirName;
22
 		if (HomeDir)
23
 		{
24
 			tmp = HomeDir;
(-)net-p2p/verlihub/files/pkg-message.in (-2 / +2 lines)
Lines 14-21 Link Here
14
14
15
Follow the instructions given.
15
Follow the instructions given.
16
16
17
Visit http://verlihub.sourceforge.net for the project's homepage
17
Visit http://www.verlihub-project.org/ for the project's homepage
18
or http://verlihub.no-ip.com for the project's forums. The verlihub
18
or http://www.verlihubforums.com/ for the project's forums. The verlihub
19
manual is available online at http://www.danomac.org/verlihub
19
manual is available online at http://www.danomac.org/verlihub
20
20
21
-------------------------------------------------------------------
21
-------------------------------------------------------------------
(-)net-p2p/verlihub/files/verlihub.in (+36 lines)
Added Link Here
1
#!/bin/sh
2
3
# PROVIDE: verlihub
4
# REQUIRE: DAEMON
5
#
6
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
7
# to enable this service:
8
#
9
# verlihub_enable (bool):   Set to NO by default.
10
#               Set it to YES to enable verlihub.
11
#
12
13
. "%%RC_SUBR%%"
14
15
name="verlihub"
16
rcvar=${name}_enable
17
18
command=%%PREFIX%%/bin/${name}
19
pidfile=/var/run/${name}.pid
20
21
logfile=/var/log/${name}.log
22
errfile=/var/log/${name}.err
23
command_args="> $logfile 2> $errfile &"
24
25
: ${verlihub_configdir="`%%PREFIX%%/bin/vh_getcfg`"}
26
required_dirs="$verlihub_configdir"
27
required_files="$verlihub_configdir/dbconfig $verlihub_configdir/motd $verlihub_configdir/help_usr $verlihub_configdir/faq $verlihub_configdir/rules"
28
29
load_rc_config $name
30
31
: ${verlihub_enable="NO"}
32
33
start_postcmd="echo \$! > $pidfile"
34
stop_postcmd="rm $pidfile"
35
36
run_rc_command "$1"

Return to bug 102406