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

Collapse All | Expand All

(-)net-p2p/verlihub/Makefile (-13 / +15 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-48 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 Linux/Unix Direct Connect Hub Software
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
PORTDOCS=	configuring.txt using.txt help.html verlihub.html html_manual/verlihub.css html_manual/verlihub_manual.html
36
37
.include <bsd.port.pre.mk>
38
40
39
.if ${OSVERSION} < 500000
41
post-patch:
40
USE_GCC=	3.4+
42
	@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/src/verlihub.cpp
41
.endif
42
43
43
post-install:
44
post-install:
44
.if !defined(NOPORTDOCS)
45
.if !defined(NOPORTDOCS)
45
	${MKDIR} ${DOCSDIR}
46
	${MKDIR} ${DOCSDIR}
47
	${MKDIR} ${DOCSDIR}/html_manual
46
.for i in ${PORTDOCS}
48
.for i in ${PORTDOCS}
47
	${INSTALL_DATA} ${WRKSRC}/docs/${i} ${DOCSDIR}
49
	${INSTALL_DATA} ${WRKSRC}/docs/${i} ${DOCSDIR}
48
.endfor
50
.endfor
Lines 50-53 Link Here
50
52
51
	@${CAT} ${PKGMESSAGE}
53
	@${CAT} ${PKGMESSAGE}
52
54
53
.include <bsd.port.post.mk>
55
.include <bsd.port.mk>
(-)net-p2p/verlihub/pkg-plist (-17 / +19 lines)
Lines 101-121 Link Here
101
lib/libvhapi.la
101
lib/libvhapi.la
102
lib/libvhapi.so
102
lib/libvhapi.so
103
lib/libvhapi.so.0
103
lib/libvhapi.so.0
104
share/verlihub/config/faq
104
%%DATADIR%%/config/faq
105
share/verlihub/config/help_admin
105
%%DATADIR%%/config/help_admin
106
share/verlihub/config/help_cheef
106
%%DATADIR%%/config/help_cheef
107
share/verlihub/config/help_master
107
%%DATADIR%%/config/help_master
108
share/verlihub/config/help_op
108
%%DATADIR%%/config/help_op
109
share/verlihub/config/help_reg
109
%%DATADIR%%/config/help_reg
110
share/verlihub/config/help_usr
110
%%DATADIR%%/config/help_usr
111
share/verlihub/config/help_vip
111
%%DATADIR%%/config/help_vip
112
share/verlihub/config/motd
112
%%DATADIR%%/config/motd
113
share/verlihub/config/rules
113
%%DATADIR%%/config/rules
114
share/verlihub/sql/default_pi_plug.sql
114
%%DATADIR%%/sql/default_pi_plug.sql
115
share/verlihub/sql/default_conn_types.sql
115
%%DATADIR%%/sql/default_conn_types.sql
116
share/verlihub/sql/default_file_trigger.sql
116
%%DATADIR%%/sql/default_file_trigger.sql
117
share/verlihub/sql/default_reglist.sql
117
%%DATADIR%%/sql/default_reglist.sql
118
%%PORTDOCS%%@dirrm %%DOCSDIR%%/html_manual
119
%%PORTDOCS%%@dirrm %%DOCSDIR%%
118
@dirrm include/verlihub
120
@dirrm include/verlihub
119
@dirrm share/verlihub/config
121
@dirrm %%DATADIR%%/config
120
@dirrm share/verlihub/sql
122
@dirrm %%DATADIR%%/sql
121
@dirrm share/verlihub
123
@dirrm %%DATADIR%%
(-)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("utf8"));
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-src-verlihub.cpp (+11 lines)
Added Link Here
1
--- src/verlihub.cpp-orig	Thu Oct 19 18:38:08 2006
2
+++ src/verlihub.cpp	Thu Oct 19 19:11:12 2006
3
@@ -81,6 +81,8 @@
4
 	{
5
 		string ConfigBase;
6
 		const char *DirName = NULL;
7
+		DirName = "%%PREFIX%%/etc/verlihub";
8
+		if ((DirName != NULL) && DirExists(DirName)) ConfigBase = DirName;
9
 		char *HomeDir = getenv("HOME");
10
 		string tmp;
11
 		if (HomeDir)
(-)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