pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/spreadlogd Import spreadlogd version 2.0.0.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c238a9045324
branches:  trunk
changeset: 531369:c238a9045324
user:      obache <obache%pkgsrc.org@localhost>
date:      Sun Jul 29 06:58:59 2007 +0000

description:
Import spreadlogd version 2.0.0.
Packaged and provided by Mark Blackman via PR 36348.

Spreadlogd is a general purpose daemon for receiving Spread toolkit
broadcast/multicast messages and logging them either to a file or for further
processing by a Perl module as an interpreter is embedded.

diffstat:

 net/spreadlogd/DESCR               |   10 +++
 net/spreadlogd/Makefile            |   39 +++++++++++++
 net/spreadlogd/PLIST               |    5 +
 net/spreadlogd/distinfo            |    8 ++
 net/spreadlogd/files/spreadlogd.sh |   27 +++++++++
 net/spreadlogd/patches/patch-aa    |  104 +++++++++++++++++++++++++++++++++++++
 net/spreadlogd/patches/patch-ab    |   16 +++++
 net/spreadlogd/patches/patch-ac    |   15 +++++
 8 files changed, 224 insertions(+), 0 deletions(-)

diffs (256 lines):

diff -r b8cd88c4aa26 -r c238a9045324 net/spreadlogd/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/spreadlogd/DESCR      Sun Jul 29 06:58:59 2007 +0000
@@ -0,0 +1,10 @@
+Spreadlogd is a daemon to log to file, messages from spread toolkit clients.
+
+If you kill -HUP or kill the spreadlogd process, it will not actually process
+the signal until after it has received its next message from Spread. You can
+move you log files to new names and then kill -HUP and it will reopen the log
+files. This is useful for seamless log rotation without losing any messages.
+
+Spread is really cool. It is a poweful group communication toolkit developed
+at the Center for Networking and Distributed Systems at the Johns Hopkins
+University (http://www.spread.org/ and http://www.cnds.jhu.edu/, respectively).
diff -r b8cd88c4aa26 -r c238a9045324 net/spreadlogd/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/spreadlogd/Makefile   Sun Jul 29 06:58:59 2007 +0000
@@ -0,0 +1,39 @@
+# $NetBSD: Makefile,v 1.1.1.1 2007/07/29 06:58:59 obache Exp $
+#
+
+DISTNAME=      spreadlogd
+PKGNAME=       spreadlogd-2.0.0
+CATEGORIES=    net
+MASTER_SITES=  http://www.backhand.org/mod_log_spread/
+DIST_SUBDIR=   ${PKGNAME_NOREV}
+
+MAINTAINER=    mark%exonetric.com@localhost
+HOMEPAGE=      http://www.backhand.org/mod_log_spread/
+COMMENT=       Daemon to log to file, messages from spread toolkit clients
+
+GNU_CONFIGURE= yes
+USE_TOOLS+=    perl
+WRKSRC=                ${WRKDIR}/${PKGNAME_NOREV}
+
+RCD_SCRIPTS=   spreadlogd
+# define the "example" directory for post-install target and for the CONF_FILES
+# variable used by pkginstall
+EXAMPLEDIR=    ${PREFIX}/share/examples/spreadlogd
+
+# tell pkginstall where to pluck virgin configuration files from in the case of a new
+# install, knowing that the post-install target in *this* Makefile will put the
+# sample configuration in the example directory for us (as well as creating it)
+CONF_FILES+=   ${EXAMPLEDIR}/spreadlogd.conf.sample ${PKG_SYSCONFDIR}/spreadlogd.conf
+
+# create example directory *and* put the sample configuration file here with the suffix
+# .sample so that pkginstall can drop it in for us.
+post-install:
+       ${INSTALL_DATA_DIR} ${EXAMPLEDIR}
+       ${INSTALL_DATA} ${WRKSRC}/spreadlogd.conf ${EXAMPLEDIR}/spreadlogd.conf.sample
+
+BUILDLINK_API_DEPENDS.libevent+=libevent>=1.0c
+
+.include "../../net/spread/buildlink3.mk"
+.include "../../devel/libevent/buildlink3.mk"
+.include "../../lang/perl5/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff -r b8cd88c4aa26 -r c238a9045324 net/spreadlogd/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/spreadlogd/PLIST      Sun Jul 29 06:58:59 2007 +0000
@@ -0,0 +1,5 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2007/07/29 06:58:59 obache Exp $
+sbin/spreadlogd
+share/examples/rc.d/spreadlogd
+share/examples/spreadlogd/spreadlogd.conf.sample
+@dirrm share/examples/spreadlogd
diff -r b8cd88c4aa26 -r c238a9045324 net/spreadlogd/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/spreadlogd/distinfo   Sun Jul 29 06:58:59 2007 +0000
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.1.1.1 2007/07/29 06:58:59 obache Exp $
+
+SHA1 (spreadlogd-2.0.0/spreadlogd.tar.gz) = 4fd88a3b804e4fbd655c822350d3137505120234
+RMD160 (spreadlogd-2.0.0/spreadlogd.tar.gz) = 2f70a3a0b6768128b2152321e016d795540a6ada
+Size (spreadlogd-2.0.0/spreadlogd.tar.gz) = 79559 bytes
+SHA1 (patch-aa) = 952d46b24ec2a8bea5335290bc7ba4aedd9f3a7d
+SHA1 (patch-ab) = c70fd89f4839213969febac0825329acbf61b59a
+SHA1 (patch-ac) = d38e189fbaceb97f4fffde25ff78a671eb39d4e9
diff -r b8cd88c4aa26 -r c238a9045324 net/spreadlogd/files/spreadlogd.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/spreadlogd/files/spreadlogd.sh        Sun Jul 29 06:58:59 2007 +0000
@@ -0,0 +1,27 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# PROVIDE: spreadlogd
+# REQUIRE: DAEMON
+#
+# To start spreadlogd at startup, copy this script to /etc/rc.d and set
+# spreadlogd=YES in /etc/rc.conf.
+#
+# Addtionally you may set spread_log to a file where to log stuff.
+
+if [ -f /etc/rc.subr ]; then
+       . /etc/rc.subr
+fi
+
+rcd_dir=`@DIRNAME@ $0`
+
+name="spreadlogd"
+rcvar=$name
+command="@PREFIX@/sbin/${name}"
+sig_stop=INT
+
+required_files="@PKG_SYSCONFDIR@/spreadlogd.conf"
+
+command_args=""
+
+load_rc_config $name
+run_rc_command "$1"
diff -r b8cd88c4aa26 -r c238a9045324 net/spreadlogd/patches/patch-aa
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/spreadlogd/patches/patch-aa   Sun Jul 29 06:58:59 2007 +0000
@@ -0,0 +1,104 @@
+$NetBSD: patch-aa,v 1.1.1.1 2007/07/29 06:58:59 obache Exp $
+
+--- config.c.orig      2006-05-05 20:25:41.000000000 +0100
++++ config.c
+@@ -301,6 +301,15 @@ int config_close(void) {
+   SpreadConfiguration *sc;
+   LogFacility *lf;
+                               int i;
++#ifdef HAVE_FCNTL_H
++  struct flock fl;
++
++  fl.l_type   = F_UNLCK;  /* tell it to unlock the region */
++  fl.l_whence = SEEK_SET; /* SEEK_SET, SEEK_CUR, SEEK_END */
++  fl.l_start  = 0;        /* Offset from l_whence         */
++  fl.l_len    = 0;        /* length, 0 = to EOF           */
++  fl.l_pid    = getpid(); /* our PID                      */
++#endif
+   sciter = sl_getlist(&spreaddaemons);
+   if(!sciter) return 0;
+   sc = (SpreadConfiguration *)sciter->data;
+@@ -314,13 +323,23 @@ int config_close(void) {
+       if(lf->vhostdir) {
+       for (i=0;i< FHASH_SIZE;i++) {
+         if(lf->hash[i].fd>0) {
+-          if(!skiplocking) flock(lf->hash[i].fd, LOCK_UN);
++          if(!skiplocking) 
++#ifdef HAVE_FCNTL_H   
++        fcntl(lf->hash[i].fd, F_SETLK, &fl);  
++#else
++            flock(lf->hash[i].fd, LOCK_UN);
++#endif        
+           close(lf->hash[i].fd);
+           lf->hash[i].fd = -1;
+         }
+       }
+       } else if(lf->logfile && lf->logfile->fd>0) {
+-      if(!skiplocking) flock(lf->logfile->fd, LOCK_UN);
++      if(!skiplocking)
++#ifdef HAVE_FCNTL_H   
++        fcntl(lf->logfile->fd, F_SETLK, &fl); 
++#else
++        flock(lf->logfile->fd, LOCK_UN);
++#endif        
+       close(lf->logfile->fd);
+       lf->logfile->fd = -1;
+       }
+@@ -356,6 +375,15 @@ int config_start(void) {
+   struct skiplistnode *sciter, *lfiter;
+   SpreadConfiguration *sc;
+   LogFacility *lf;
++#ifdef HAVE_FCNTL_H
++  struct flock fl;
++ 
++  fl.l_type   = F_WRLCK;  /* F_RDLCK, F_WRLCK, F_UNLCK    */
++  fl.l_whence = SEEK_SET; /* SEEK_SET, SEEK_CUR, SEEK_END */
++  fl.l_start  = 0;        /* Offset from l_whence         */
++  fl.l_len    = 0;        /* length, 0 = to EOF           */
++  fl.l_pid    = getpid(); /* our PID                      */ 
++#endif
+   sciter = sl_getlist(&spreaddaemons);
+   if(!sciter) return 0;
+   sc = (SpreadConfiguration *)sciter->data;
+@@ -381,7 +409,11 @@ int config_start(void) {
+                       }
+               }       
+       if(!skiplocking) {
+-      if(flock(lf->logfile->fd, LOCK_NB|LOCK_EX)==-1) {
++#ifdef HAVE_FCNTL_H                           
++        if(fcntl(lf->logfile->fd, F_SETLK, &fl)==-1) {
++#else
++            if(flock(lf->logfile->fd, LOCK_NB|LOCK_EX)==-1) {
++#endif                
+         fprintf(stderr, "Cannot lock %s, is another spreadlogd running?\n",
+                 lf->logfile->filename);
+         exit(1);
+@@ -441,6 +473,15 @@ int config_get_fd(SpreadConfiguration *s
+   hash_element temp;
+   char *cp;
+   char fullpath[MAXPATHLEN];
++#ifdef HAVE_FCNTL_H
++  struct flock fl;
++ 
++  fl.l_type   = F_WRLCK;  /* F_RDLCK, F_WRLCK, F_UNLCK    */
++  fl.l_whence = SEEK_SET; /* SEEK_SET, SEEK_CUR, SEEK_END */
++  fl.l_start  = 0;        /* Offset from l_whence         */
++  fl.l_len    = 0;        /* length, 0 = to EOF           */
++  fl.l_pid    = getpid(); /* our PID                      */ 
++#endif
+   lf = sl_find(sc->logfacilities, group, NULL);
+   if(!lf || !lf->logfile || !lf->logfile->filename) return -1;
+   if(lf->vhostdir) {
+@@ -457,7 +498,11 @@ int config_get_fd(SpreadConfiguration *s
+                    O_CREAT|O_APPEND|O_WRONLY,
+                    00644);
+       if(!skiplocking) {
+-      if(flock(temp.fd, LOCK_NB|LOCK_EX)==-1) {
++#ifdef HAVE_FCNTL_H                           
++            if(fcntl(temp.fd, F_SETLK, &fl)==-1) {
++#else
++            if(flock(temp.fd, LOCK_NB|LOCK_EX)==-1) {
++#endif                
+         fprintf(stderr, "Cannot lock %s, is another spreadlogd running?\n",
+                 fullpath);
+         exit(1);
diff -r b8cd88c4aa26 -r c238a9045324 net/spreadlogd/patches/patch-ab
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/spreadlogd/patches/patch-ab   Sun Jul 29 06:58:59 2007 +0000
@@ -0,0 +1,16 @@
+$NetBSD: patch-ab,v 1.1.1.1 2007/07/29 06:58:59 obache Exp $
+
+--- echash.h.orig      2006-05-04 13:21:46.000000000 +0100
++++ echash.h
+@@ -88,11 +88,4 @@ API_EXPORT(int) echash_next(ec_hash_tabl
+ API_EXPORT(int) echash_firstkey(ec_hash_table *h, const char **k, int *klen);
+ API_EXPORT(int) echash_nextkey(ec_hash_table *h, const char **k, int *klen, char *lk, int lklen);
+ 
+-/* This function serves no real API use sans calculating expected buckets
+-   for keys (or extending the hash... which is unsupported) */
+-API_EXPORT(unsigned int) echash__hash(const char *k, u_int32_t length,
+-                                   u_int32_t initval);
+-API_EXPORT(ec_hash_bucket *) echash__new_bucket(const char *k, int klen,
+-                                                void *data);
+-API_EXPORT(void) echash__rebucket(ec_hash_table *h, int newsize);
+ #endif
diff -r b8cd88c4aa26 -r c238a9045324 net/spreadlogd/patches/patch-ac
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/spreadlogd/patches/patch-ac   Sun Jul 29 06:58:59 2007 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-ac,v 1.1.1.1 2007/07/29 06:58:59 obache Exp $
+
+--- Makefile.in.orig   2007-05-16 09:47:12.216090000 +0100
++++ Makefile.in
+@@ -53,8 +53,8 @@ spreadlogd:  $(OBJS)
+ install:      spreadlogd
+       $(srcdir)/mkinstalldirs $(DESTDIR)$(sbindir)
+       $(INSTALL) -m 0755 spreadlogd $(DESTDIR)$(sbindir)/spreadlogd
+-      $(srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir)
+-      $(INSTALL) -m 0755 spreadlogd.conf $(DESTDIR)$(sysconfdir)/spreadlogd.conf.sample
++#     $(srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir)
++#     $(INSTALL) -m 0755 spreadlogd.conf $(DESTDIR)$(sysconfdir)/spreadlogd.conf.sample
+ 
+ clean:
+       rm -f *~ *.o spreadlogd libskiplist.a y.tab.h y.tab.c lex.sld_.c \



Home | Main Index | Thread Index | Old Index