ports/102406: [PATCH] Update port: net-p2p/verlihub fix plugin support, add rc(8) script, fix dependencies, modify doc set, add db_charset patch, ad installation fixes, fix portlint warnings
Pankov Pavel
pankov_p at mail.ru
Fri Nov 17 20:00:13 UTC 2006
The following reply was made to PR ports/102406; it has been noted by GNATS.
From: Pankov Pavel <pankov_p at mail.ru>
To: bug-followup at FreeBSD.org, pankov_p at mail.ru
Cc:
Subject: Re: ports/102406: [PATCH] Update port: net-p2p/verlihub fix plugin
support, add rc(8) script, fix dependencies, modify doc set, add db_charset
patch, ad installation fixes, fix portlint warnings
Date: Fri, 17 Nov 2006 22:49:54 +0300
This is a multi-part message in MIME format.
--------------070709080905050401070102
Content-Type: text/plain; charset=KOI8-R; format=flowed
Content-Transfer-Encoding: 7bit
Here is the new patch. It fixes the pkg-list issue of the last one and
additionaly update checksums for distfile, because it was changed on
mastersites without changing name. Also, new patch update the WWW site
for verlihub.
--------------070709080905050401070102
Content-Type: text/plain;
name="verlihub-2.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="verlihub-2.diff"
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/net-p2p/verlihub/Makefile,v
retrieving revision 1.14
diff -u -r1.14 Makefile
--- Makefile 4 Sep 2006 15:51:10 -0000 1.14
+++ Makefile 17 Nov 2006 19:49:36 -0000
@@ -7,7 +7,7 @@
PORTNAME= verlihub
PORTVERSION= 0.9.8.c
-PORTREVISION= 1
+PORTREVISION= 2
PORTEPOCH= 1
CATEGORIES= net-p2p
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
@@ -15,39 +15,41 @@
DISTNAME= verlihub-0.9.8c-RC2
MAINTAINER= hurbold at yahoo.com
-COMMENT= Verlihub Linux/Unix Direct Connect Hub Software
+COMMENT= A Direct Connect protocol server (Hub)
+# XXX: Actually, bash isn't required for building,
+# but otherwise configure script would pick the wrong path
+BUILD_DEPENDS= bash:${PORTSDIR}/shells/bash
LIB_DEPENDS= GeoIP.5:${PORTSDIR}/net/GeoIP \
pcre.0:${PORTSDIR}/devel/pcre
RUN_DEPENDS= bash:${PORTSDIR}/shells/bash
WRKSRC= ${WRKDIR}/verlihub-0.9.8c
+USE_RC_SUBR= verlihub
+
USE_MYSQL= yes
-USE_PERL5= yes
-USE_GMAKE= yes
GNU_CONFIGURE= yes
USE_LDCONFIG= yes
-CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include"
+USE_GCC= 3.4+
+USE_OPENSSL= yes
SUB_FILES+= pkg-message
-PKGMESSAGE= ${WRKDIR}/pkg-message
-PORTDOCS= configuring.txt help.sql using.txt features.html help.html params.php verlihub.html
-
-.include <bsd.port.pre.mk>
+SUB_FILES= pkg-message
+PORTDOCS= configuring.txt using.txt help.html verlihub.html html_manual/verlihub.css html_manual/verlihub_manual.html
-.if ${OSVERSION} < 500000
-USE_GCC= 3.4+
-.endif
+post-patch:
+ @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/src/verlihub.cpp
post-install:
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
+ ${MKDIR} ${DOCSDIR}/html_manual
.for i in ${PORTDOCS}
- ${INSTALL_DATA} ${WRKSRC}/docs/${i} ${DOCSDIR}
+ ${INSTALL_DATA} ${WRKSRC}/docs/${i} ${DOCSDIR}/${i}
.endfor
.endif
@${CAT} ${PKGMESSAGE}
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /home/ncvs/ports/net-p2p/verlihub/distinfo,v
retrieving revision 1.6
diff -u -r1.6 distinfo
--- distinfo 22 Jan 2006 21:24:00 -0000 1.6
+++ distinfo 17 Nov 2006 19:49:36 -0000
@@ -1,3 +1,3 @@
-MD5 (verlihub-0.9.8c-RC2.tar.gz) = f3f4f6e1b8010935714609c3faa6577f
-SHA256 (verlihub-0.9.8c-RC2.tar.gz) = 853ab3ab8260da1c67d07fec672e5206152001eae7e5ecda526603b0d5e4be12
-SIZE (verlihub-0.9.8c-RC2.tar.gz) = 696574
+MD5 (verlihub-0.9.8c-RC2.tar.gz) = c536dd46daefe8b91c3872837d1deeb2
+SHA256 (verlihub-0.9.8c-RC2.tar.gz) = 571e637eacf1176c968e09528331d4257f4932186ae4ca9e8d4353d1cffa7e1c
+SIZE (verlihub-0.9.8c-RC2.tar.gz) = 701081
Index: pkg-descr
===================================================================
RCS file: /home/ncvs/ports/net-p2p/verlihub/pkg-descr,v
retrieving revision 1.2
diff -u -r1.2 pkg-descr
--- pkg-descr 24 Jun 2004 14:54:02 -0000 1.2
+++ pkg-descr 17 Nov 2006 19:49:36 -0000
@@ -4,7 +4,7 @@
Additional functionality is available through a versatile
'plugin' system.
-WWW: http://verlihub.sourceforge.net
+WWW: http://www.verlihub-project.org/
-Hurbold
hurbold at yahoo.com
Index: pkg-plist
===================================================================
RCS file: /home/ncvs/ports/net-p2p/verlihub/pkg-plist,v
retrieving revision 1.5
diff -u -r1.5 pkg-plist
--- pkg-plist 8 Oct 2005 15:41:31 -0000 1.5
+++ pkg-plist 17 Nov 2006 19:49:36 -0000
@@ -101,21 +101,23 @@
lib/libvhapi.la
lib/libvhapi.so
lib/libvhapi.so.0
-share/verlihub/config/faq
-share/verlihub/config/help_admin
-share/verlihub/config/help_cheef
-share/verlihub/config/help_master
-share/verlihub/config/help_op
-share/verlihub/config/help_reg
-share/verlihub/config/help_usr
-share/verlihub/config/help_vip
-share/verlihub/config/motd
-share/verlihub/config/rules
-share/verlihub/sql/default_pi_plug.sql
-share/verlihub/sql/default_conn_types.sql
-share/verlihub/sql/default_file_trigger.sql
-share/verlihub/sql/default_reglist.sql
+%%DATADIR%%/config/faq
+%%DATADIR%%/config/help_admin
+%%DATADIR%%/config/help_cheef
+%%DATADIR%%/config/help_master
+%%DATADIR%%/config/help_op
+%%DATADIR%%/config/help_reg
+%%DATADIR%%/config/help_usr
+%%DATADIR%%/config/help_vip
+%%DATADIR%%/config/motd
+%%DATADIR%%/config/rules
+%%DATADIR%%/sql/default_pi_plug.sql
+%%DATADIR%%/sql/default_conn_types.sql
+%%DATADIR%%/sql/default_file_trigger.sql
+%%DATADIR%%/sql/default_reglist.sql
+%%PORTDOCS%%@dirrm %%DOCSDIR%%/html_manual
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
@dirrm include/verlihub
- at dirrm share/verlihub/config
- at dirrm share/verlihub/sql
- at dirrm share/verlihub
+ at dirrm %%DATADIR%%/config
+ at dirrm %%DATADIR%%/sql
+ at dirrm %%DATADIR%%
Index: files/patch-db_charset
===================================================================
RCS file: files/patch-db_charset
diff -N files/patch-db_charset
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ files/patch-db_charset 17 Nov 2006 19:49:36 -0000
@@ -0,0 +1,83 @@
+--- src/cdbconf.cpp Thu Apr 8 02:16:21 2004
++++ src/cdbconf.cpp Thu Oct 12 16:57:43 2006
+@@ -18,6 +18,7 @@
+ Add("db_user",db_user,string("verlihub"));
+ Add("db_pass",db_pass,string(""));
+ Add("db_data",db_data,string("verlihub"));
++ Add("db_charset",db_charset,string("utf8"));
+ Add("config_name",config_name,string("config"));
+ Add("lang_name",lang_name,string("lang_en"));
+ Load();
+
+diff -Nur verlihub-orig/src/cdbconf.h verlihub/src/cdbconf.h
+--- src/cdbconf.h 2006-07-15 18:42:52.000000000 +0400
++++ src/cdbconf.h 2006-07-15 18:43:50.000000000 +0400
+@@ -31,6 +31,7 @@
+ string db_user;
+ string db_pass;
+ string db_data;
++ string db_charset;
+ string config_name;
+ string lang_name;
+ bool allow_exec;
+diff -Nur verlihub-orig/src/cmysql.cpp verlihub/src/cmysql.cpp
+--- src/cmysql.cpp 2006-07-15 18:42:52.000000000 +0400
++++ src/cmysql.cpp 2006-07-15 18:45:25.000000000 +0400
+@@ -19,10 +19,10 @@
+ /*!
+ \fn nMySQL::cMySQL::cMySQL(string&host,string&user,string&pass,string&data)
+ */
+-cMySQL::cMySQL(string&host,string&user,string&pass,string&data) : cObj("cMySQL")
++cMySQL::cMySQL(string&host,string&user,string&pass,string&data,string&charset) : cObj("cMySQL")
+ {
+ Init();
+- if(!Connect(host,user,pass,data))
++ if(!Connect(host,user,pass,data,charset))
+ {
+ throw "Mysql connection error.";
+ }
+@@ -40,12 +40,13 @@
+ if(!mDBHandle) Error(0, string("Can't init mysql structure :(.: "));
+ }
+
+-bool cMySQL::Connect(string &host, string &user, string &pass, string &data)
++bool cMySQL::Connect(string &host, string &user, string &pass, string &data, string &charset)
+ {
+ if(Log(1)) LogStream() << "Connecting to mysql server: "
+- << user << "@" << host << "/" << data << endl;
++ << user << "@" << host << "/" << data << "with charset " << charset << endl;
+
+ mysql_options(mDBHandle,MYSQL_OPT_COMPRESS,0);
++ mysql_options(mDBHandle,MYSQL_SET_CHARSET_NAME,charset.c_str());
+ if(!mysql_real_connect(
+ mDBHandle,
+ host.c_str(),
+diff -Nur verlihub-orig/src/cmysql.h verlihub/src/cmysql.h
+--- src/cmysql.h 2006-07-15 18:42:52.000000000 +0400
++++ src/cmysql.h 2006-07-15 18:43:50.000000000 +0400
+@@ -34,10 +34,10 @@
+ friend class cQuery;
+ public:
+ cMySQL();
+- cMySQL(string&host,string&user,string&pass,string&data);
++ cMySQL(string&host,string&user,string&pass,string&data,string&charset);
+ ~cMySQL();
+ void Init();
+- bool Connect(string &host, string &user, string &passwd, string &db);
++ bool Connect(string &host, string &user, string &passwd, string &db, string &charset);
+ public: void Error(int level, string text);
+
+ private:
+diff -Nur verlihub-orig/src/cserverdc.cpp verlihub/src/cserverdc.cpp
+--- src/cserverdc.cpp 2006-07-15 18:42:52.000000000 +0400
++++ src/cserverdc.cpp 2006-07-15 18:43:50.000000000 +0400
+@@ -72,7 +72,8 @@
+ mDBConf.db_host,
+ mDBConf.db_user,
+ mDBConf.db_pass,
+- mDBConf.db_data), // connect to mysql
++ mDBConf.db_data,
++ mDBConf.db_charset), // connect to mysql
+ mC(*this), // create the config object
+ mL(*this),
+ mSetupList(mMySQL),
Index: files/patch-plugins
===================================================================
RCS file: files/patch-plugins
diff -N files/patch-plugins
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ files/patch-plugins 17 Nov 2006 19:49:36 -0000
@@ -0,0 +1,45 @@
+diff -ruN src-orig/cpluginloader.cpp src/cpluginloader.cpp
+--- src-orig/cpluginloader.cpp Fri Oct 1 15:19:44 2004
++++ src/cpluginloader.cpp Thu Oct 12 17:16:22 2006
+@@ -40,6 +40,12 @@
+ */
+ bool nPlugin::cPluginLoader::Open()
+ {
++ /*
++ * Reset dlerror() since it can contain error from previous
++ * call to dlopen()/dlsym().
++ */
++ dlerror();
++
+ mHandle = dlopen(mFileName.c_str(), RTLD_NOW);
+ if(!mHandle || IsError()) // NOTE hte OR (||) operator evaluates only the first statement if that one is true
+ {
+@@ -99,6 +105,12 @@
+ */
+ void * nPlugin::cPluginLoader::LoadSym(const char *name)
+ {
++ /*
++ * Reset dlerror() since it can contain error from previous
++ * call to dlopen()/dlsym().
++ */
++ dlerror();
++
+ void *func = dlsym( mHandle, name);
+ if(IsError())
+ {
+diff -ruN src-orig/tpluginbase.cpp src/tpluginbase.cpp
+--- src-orig/tpluginbase.cpp Fri Oct 1 15:19:44 2004
++++ src/tpluginbase.cpp Thu Oct 12 17:16:39 2006
+@@ -34,6 +34,12 @@
+ */
+ bool nPlugin::tPluginBase::Open()
+ {
++ /*
++ * Reset dlerror() since it can contain error from previous
++ * call to dlopen()/dlsym().
++ */
++ dlerror();
++
+ mHandle = dlopen(mFileName.c_str(), RTLD_NOW);
+ if(!mHandle)
+ {
Index: files/patch-src-verlihub.cpp
===================================================================
RCS file: files/patch-src-verlihub.cpp
diff -N files/patch-src-verlihub.cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ files/patch-src-verlihub.cpp 17 Nov 2006 19:49:36 -0000
@@ -0,0 +1,11 @@
+--- src/verlihub.cpp-orig Thu Oct 19 18:38:08 2006
++++ src/verlihub.cpp Thu Oct 19 19:11:12 2006
+@@ -81,6 +81,8 @@
+ {
+ string ConfigBase;
+ const char *DirName = NULL;
++ DirName = "%%PREFIX%%/etc/verlihub";
++ if ((DirName != NULL) && DirExists(DirName)) ConfigBase = DirName;
+ char *HomeDir = getenv("HOME");
+ string tmp;
+ if (HomeDir)
Index: files/verlihub.in
===================================================================
RCS file: files/verlihub.in
diff -N files/verlihub.in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ files/verlihub.in 17 Nov 2006 19:49:36 -0000
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+# PROVIDE: verlihub
+# REQUIRE: DAEMON
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# verlihub_enable (bool): Set to NO by default.
+# Set it to YES to enable verlihub.
+#
+
+. "%%RC_SUBR%%"
+
+name="verlihub"
+rcvar=${name}_enable
+
+command=%%PREFIX%%/bin/${name}
+pidfile=/var/run/${name}.pid
+
+logfile=/var/log/${name}.log
+errfile=/var/log/${name}.err
+command_args="> $logfile 2> $errfile &"
+
+: ${verlihub_configdir="`%%PREFIX%%/bin/vh_getcfg`"}
+required_dirs="$verlihub_configdir"
+required_files="$verlihub_configdir/dbconfig $verlihub_configdir/motd $verlihub_configdir/help_usr $verlihub_configdir/faq $verlihub_configdir/rules"
+
+load_rc_config $name
+
+: ${verlihub_enable="NO"}
+
+start_postcmd="echo \$! > $pidfile"
+stop_postcmd="rm $pidfile"
+
+run_rc_command "$1"
--------------070709080905050401070102--
More information about the freebsd-ports-bugs
mailing list