ports/143428: Update port: net-p2p/uhub from 0.2.8 to 0.3.0
Dmitry Yashin
yashin.dm at gmail.com
Mon Feb 1 13:00:09 UTC 2010
>Number: 143428
>Category: ports
>Synopsis: Update port: net-p2p/uhub from 0.2.8 to 0.3.0
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Mon Feb 01 13:00:09 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator: Dmitry Yashin
>Release: 7.0-RELEASE-p11
>Organization:
>Environment:
FreeBSD python 7.0-RELEASE-p11 FreeBSD 7.0-RELEASE-p11 #0: Sun Mar 22 07:08:52 UTC 2009 root at i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386
>Description:
0.3.0:
- More user commands: ban, broadcast, mute, rules, history, myip, whoip, log
- Experimental SSL support
- Large rewrite of the network stack in order to support SSL.
- Added rule file for defining hub rules.
- Many crash fixes and other important bug fixes.
- Optimizations: O(1) timeout scheduler
- New sid allocation code.
- Added configurable server_listen_backlog (default 50).
- Added init.d scripts for RedHat/CentOS
>How-To-Repeat:
>Fix:
Patch attached with submission follows:
diff -ruN --exclude=CVS /usr/ports/net-p2p/uhub.orig/Makefile /usr/ports/net-p2p/uhub/Makefile
--- /usr/ports/net-p2p/uhub.orig/Makefile 2009-11-11 19:43:59.000000000 +0300
+++ /usr/ports/net-p2p/uhub/Makefile 2010-02-01 15:15:42.000000000 +0300
@@ -6,7 +6,7 @@
#
PORTNAME= uhub
-PORTVERSION= 0.2.8
+PORTVERSION= 0.3.0
CATEGORIES= net-p2p
MASTER_SITES= http://www.extatic.org/downloads/uhub/
DISTNAME= ${PORTNAME}-${PORTVERSION}-src
@@ -14,8 +14,6 @@
MAINTAINER= yashin.dm at gmail.com
COMMENT= High performance peer-to-peer hub for the ADC network
-LIB_DEPENDS= event-1.4:${PORTSDIR}/devel/libevent
-
USE_PERL5= yes
USE_GMAKE= yes
@@ -24,6 +22,17 @@
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
MAKEFILE= ${WRKSRC}/GNUmakefile
+OPTIONS= OPENSSL "Enable SSL support (experimental)" off
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITH_OPENSSL)
+.include "${PORTSDIR}/Mk/bsd.openssl.mk"
+MAKE_ARGS= USE_SSL=YES
+CFLAGS+= -I${OPENSSLINC}
+LDFLAGS+= -L${OPENSSLLIB}
+.endif
+
post-patch:
@${REINPLACE_CMD} -e 's|/etc/uhub/|${PREFIX}&|' ${WRKSRC}/doc/uhub.conf
@@ -34,4 +43,4 @@
${TOUCH} ${PREFIX}/etc/uhub/motd.txt.sample ; \
fi
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff -ruN --exclude=CVS /usr/ports/net-p2p/uhub.orig/distinfo /usr/ports/net-p2p/uhub/distinfo
--- /usr/ports/net-p2p/uhub.orig/distinfo 2009-10-15 15:44:24.000000000 +0400
+++ /usr/ports/net-p2p/uhub/distinfo 2010-02-01 11:48:03.000000000 +0300
@@ -1,3 +1,3 @@
-MD5 (uhub-0.2.8-src.tar.gz) = 45d35d9757bc0a84297dec51520f725b
-SHA256 (uhub-0.2.8-src.tar.gz) = 4f205653a2c08b1a3e8dbd5ccee512c42d4b86825f2ee7cd21c53b5283256d2d
-SIZE (uhub-0.2.8-src.tar.gz) = 121873
+MD5 (uhub-0.3.0-src.tar.gz) = d112694a9323bb47a8f62606633a8cf2
+SHA256 (uhub-0.3.0-src.tar.gz) = 24db78bf2f6c0da144197c49a1b37b88cec9f6d991f735d6544686c9f536fef1
+SIZE (uhub-0.3.0-src.tar.gz) = 134379
diff -ruN --exclude=CVS /usr/ports/net-p2p/uhub.orig/files/patch-GNUmakefile /usr/ports/net-p2p/uhub/files/patch-GNUmakefile
--- /usr/ports/net-p2p/uhub.orig/files/patch-GNUmakefile 2009-11-11 19:43:59.000000000 +0300
+++ /usr/ports/net-p2p/uhub/files/patch-GNUmakefile 2010-02-01 12:13:51.000000000 +0300
@@ -1,7 +1,7 @@
---- GNUmakefile.orig 2009-03-24 02:21:38.000000000 +0300
-+++ GNUmakefile 2009-11-07 04:35:56.000000000 +0300
+--- GNUmakefile.orig 2010-01-25 01:38:25.000000000 +0300
++++ GNUmakefile 2010-02-01 12:12:34.000000000 +0300
@@ -3,7 +3,7 @@
- ## Copyright (C) 2007-2008, Jan Vidar Krey <janvidar at extatic.org>
+ ## Copyright (C) 2007-2010, Jan Vidar Krey <janvidar at extatic.org>
#
-CC = gcc
@@ -9,8 +9,8 @@
LD := $(CC)
MV := mv
RANLIB := ranlib
-@@ -31,10 +31,10 @@
- BIN_EXT ?= .exe
+@@ -36,11 +36,12 @@
+ GIT_REVISION ?= NO
else
DESTDIR ?= /
-UHUB_CONF_DIR ?= $(DESTDIR)/etc/uhub
@@ -22,9 +22,11 @@
+CFLAGS += -I$(LOCALBASE)/include
+LDFLAGS += -L$(LOCALBASE)/lib
BIN_EXT ?=
++GIT_REVISION ?= NO
endif
-@@ -252,7 +252,7 @@
+ ifeq ($(SILENT),YES)
+@@ -225,7 +226,7 @@
@if [ ! -d $(UHUB_CONF_DIR) ]; then echo Creating $(UHUB_CONF_DIR); mkdir -p $(UHUB_CONF_DIR); fi
@if [ ! -f $(UHUB_CONF_DIR)/uhub.conf ]; then cp doc/uhub.conf $(UHUB_CONF_DIR); fi
@if [ ! -f $(UHUB_CONF_DIR)/users.conf ]; then cp doc/users.conf $(UHUB_CONF_DIR); fi
diff -ruN --exclude=CVS /usr/ports/net-p2p/uhub.orig/files/patch-main.c_add_pid /usr/ports/net-p2p/uhub/files/patch-main.c_add_pid
--- /usr/ports/net-p2p/uhub.orig/files/patch-main.c_add_pid 2009-11-06 11:18:20.000000000 +0300
+++ /usr/ports/net-p2p/uhub/files/patch-main.c_add_pid 1970-01-01 03:00:00.000000000 +0300
@@ -1,91 +0,0 @@
---- src/main.c.orig 2009-11-06 11:02:57.000000000 +0300
-+++ src/main.c 2009-11-06 11:15:45.000000000 +0300
-@@ -29,6 +29,7 @@
- static const char* arg_gid = 0;
- static const char* arg_config = 0;
- static const char* arg_log = 0;
-+static const char* arg_pid = 0;
- static int arg_log_syslog = 0;
-
-
-@@ -214,6 +215,7 @@
- #ifndef WIN32
- " -u <user> Run as given user\n"
- " -g <group> Run with given group permissions\n"
-+ " -p <file> Store pid in file (process id)\n"
- #endif
- " -V Show version number.\n"
- );
-@@ -225,7 +227,7 @@
- void parse_command_line(int argc, char** argv)
- {
- int opt;
-- while ((opt = getopt(argc, argv, "vqfc:l:hu:g:VCsSL")) != -1)
-+ while ((opt = getopt(argc, argv, "vqfc:l:hu:g:VCsSLp:")) != -1)
- {
- switch (opt)
- {
-@@ -285,6 +287,10 @@
- arg_gid = optarg;
- break;
-
-+ case 'p':
-+ arg_pid = optarg;
-+ break;
-+
- default:
- print_usage(argv[0]);
- break;
-@@ -386,6 +392,32 @@
-
- return 0;
- }
-+
-+int pidfile_create()
-+{
-+ if (arg_pid)
-+ {
-+ FILE* pidfile = fopen(arg_pid, "w");
-+ if (!pidfile)
-+ {
-+ hub_log(log_fatal, "Unable to write pid file: %s\n", arg_pid);
-+ return -1;
-+ }
-+ fprintf(pidfile, "%d", (int) getpid());
-+ fclose(pidfile);
-+ }
-+ return 0;
-+}
-+
-+int pidfile_destroy()
-+{
-+ if (arg_pid)
-+ {
-+ return unlink(arg_pid);
-+ }
-+ return 0;
-+}
-+
- #endif /* WIN32 */
-
-
-@@ -421,11 +453,19 @@
- }
- }
-
-+ if (pidfile_create() == -1)
-+ return -1;
-+
- if (drop_privileges() == -1)
- return -1;
- #endif /* WIN32 */
-
- ret = main_loop();
-+
-+#ifndef WIN32
-+ pidfile_destroy();
-+#endif
-+
- return ret;
- }
-
diff -ruN --exclude=CVS /usr/ports/net-p2p/uhub.orig/files/patch-select.c /usr/ports/net-p2p/uhub/files/patch-select.c
--- /usr/ports/net-p2p/uhub.orig/files/patch-select.c 1970-01-01 03:00:00.000000000 +0300
+++ /usr/ports/net-p2p/uhub/files/patch-select.c 2010-02-01 12:57:43.000000000 +0300
@@ -0,0 +1,13 @@
+--- src/network/select.c.orig 2010-01-25 01:38:25.000000000 +0300
++++ src/network/select.c 2010-02-01 12:57:36.000000000 +0300
+@@ -101,8 +101,8 @@
+ FD_ZERO(&g_backend->wfds);
+
+ size_t secs = timeout_queue_get_next_timeout(&g_backend->timeout_queue, g_backend->now);
+- tval.tv_secs = secs;
+- tval.tv_usecs = 0;
++ tval.tv_sec = secs;
++ tval.tv_usec = 0;
+
+ for (n = 0, found = 0; found < g_backend->num && n < g_backend->max; n++)
+ {
diff -ruN --exclude=CVS /usr/ports/net-p2p/uhub.orig/pkg-descr /usr/ports/net-p2p/uhub/pkg-descr
--- /usr/ports/net-p2p/uhub.orig/pkg-descr 2009-11-11 19:43:59.000000000 +0300
+++ /usr/ports/net-p2p/uhub/pkg-descr 2010-02-01 11:48:52.000000000 +0300
@@ -2,4 +2,4 @@
Its low memory footprint allows it to handle several thousand users
on high-end servers, or a small private hub on embedded hardware.
-WWW: http://www.extatic.org/uhub/
+WWW: http://www.uhub.org/
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list