- Update to to 0.3.0

PR:	ports/143428
Submitted by:	Dmitry Yashin <yashin.dm@gmail.com> (maintainer)
This commit is contained in:
Tong LIU 2010-02-02 09:27:09 +00:00
parent 411913fdca
commit 75dbf689f3
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=249080
5 changed files with 25 additions and 105 deletions

View file

@ -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 @@ DISTNAME= ${PORTNAME}-${PORTVERSION}-src
MAINTAINER= yashin.dm@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 @@ USE_RC_SUBR= uhub.sh
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 @@ post-install:
${TOUCH} ${PREFIX}/etc/uhub/motd.txt.sample ; \
fi
.include <bsd.port.mk>
.include <bsd.port.post.mk>

View file

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

View file

@ -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@extatic.org>
## Copyright (C) 2007-2010, Jan Vidar Krey <janvidar@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

View file

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

View file

@ -2,4 +2,4 @@ uHub is a high performance peer-to-peer hub for the ADC network.
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/