Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions

24
misc/buffer/DESCR Normal file
View File

@@ -0,0 +1,24 @@
This is a program designed to speed up writing tapes on remote tape drives.
Requirements are shared memory and locks which normally means that these are
supported in your kernel. [for FreeBSD/NetBSD, this means you MUST have a kernel
with options SYSVSHM compiled in - markm]
Buffer has been tested under SunOS 4.0.*, SunOS 4.1.*, Solarix, HP-UX 7.0, and
Gould UTX 2.1A (sv universe).
The program splits itself into two processes. The first process reads (and
reblocks) from stdin into a shared memory buffer. The second writes from the
shared memory buffer to stdout. Doing it this way means that the writing side
effectly sits in a tight write loop and doesn't have to wait for input.
Similarly for the input side. It is this waiting that slows down other
reblocking processes, like dd.
I run an archive and need to write large chunks out to tape regularly
with an ethernet in the way. Using 'buffer' in a command like:
tar cvf - stuff | rsh somebox "buffer > /dev/rst8"
is a factor of 5 faster than the best alternative, gnu tar with its
remote tape option:
tar cvf somebox:/dev/rst8 stuff

19
misc/buffer/Makefile Normal file
View File

@@ -0,0 +1,19 @@
# $NetBSD: Makefile,v 1.19 2012/10/08 09:57:17 asau Exp $
DISTNAME= buffer-1.17
CATEGORIES= misc
MASTER_SITES= #
MAINTAINER= pkgsrc-users@NetBSD.org
COMMENT= Buffer sporadic binary I/O for faster tape use
INSTALLATION_DIRS= bin ${PKGMANDIR}/man1
.include "../../mk/bsd.prefs.mk"
.if ${OPSYS} == "SunOS"
CPPFLAGS+= -DSYS5
MAKE_ENV+= CC=${CC:Q}
.endif
.include "../../mk/bsd.pkg.mk"

3
misc/buffer/PLIST Normal file
View File

@@ -0,0 +1,3 @@
@comment $NetBSD: PLIST,v 1.2 2009/06/12 19:09:36 rillig Exp $
bin/buffer
man/man1/buffer.1

8
misc/buffer/distinfo Normal file
View File

@@ -0,0 +1,8 @@
$NetBSD: distinfo,v 1.8 2012/10/20 22:14:05 joerg Exp $
SHA1 (buffer-1.17.tar.gz) = 88201f677485880cd508430015b7ce7d9663b6e7
RMD160 (buffer-1.17.tar.gz) = c7f87873f8f74b900609ef495ebabc8596729fb8
Size (buffer-1.17.tar.gz) = 17131 bytes
SHA1 (patch-aa) = 3fd94e382e9444fd88a17bcef348800767f8a8d0
SHA1 (patch-ab) = c17afef3231afe48476273183c0f1365fa8cd86f
SHA1 (patch-ac) = c899209c54933756f5ce97b083fa43daa69a8ffc

View File

@@ -0,0 +1,44 @@
$NetBSD: patch-aa,v 1.7 2008/06/20 01:09:25 joerg Exp $
--- Makefile.orig Wed Jul 14 11:59:17 1993
+++ Makefile Sun Sep 12 12:35:57 1999
@@ -4,13 +4,13 @@
# You should also add -DSYS5 for Ultrix, AIX, and Solarix.
# Add -DDEF_SHMEM=n if you can only have n bytes of shared memory
# (eg: -DDEF_SHMEM=524288 if you can only have half a meg.)
-CFLAGS=
+CFLAGS=-O
# Where to install buffer and its manual pages
-INSTBIN=/usr/local/bin
-INSTMAN=/usr/man/manl
+INSTBIN=${PREFIX}/bin
+INSTMAN=${PREFIX}/man/man1
# The manual page section (normally l or 1)
-S=l
+S=1
RM=/bin/rm
ALL=README buffer.man Makefile buffer.c sem.c COPYING
@@ -18,18 +18,14 @@
all: buffer
buffer: buffer.o sem.o
- $(CC) -o buffer $(CFLAGS) buffer.o sem.o
+ $(CC) -o buffer buffer.o sem.o
clean:
$(RM) -f *.o core buffer .merrs
install: buffer
- rm -f $(INSTBIN)/buffer
- cp buffer $(INSTBIN)/buffer
- chmod 111 $(INSTBIN)/buffer
- rm -f $(INSTMAN)/buffer.$S
- cp buffer.man $(INSTMAN)/buffer.$S
- chmod 444 $(INSTMAN)/buffer.$S
+ ${BSD_INSTALL_PROGRAM} buffer ${DESTDIR}$(INSTBIN)/buffer
+ ${BSD_INSTALL_MAN} buffer.man ${DESTDIR}$(INSTMAN)/buffer.$S
buffer.tar: $(ALL)
$(RM) -f buffer.tar

View File

@@ -0,0 +1,58 @@
$NetBSD: patch-ab,v 1.4 2012/10/20 22:14:05 joerg Exp $
--- sem.c.orig 1994-10-04 16:44:53.000000000 +0000
+++ sem.c
@@ -27,13 +27,16 @@
* semaphores */
#include <stdio.h>
+#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <errno.h>
+#include <sys/param.h>
-#if defined(SYS5) || defined(ultrix) || defined(_AIX)
+#if defined(SYS5) || defined(ultrix) || defined(_AIX) \
+ || (defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 104110000))
union semun {
int val;
struct semid_ds *buf;
@@ -60,7 +63,6 @@ sem_set( sem_id, semn, val )
int val;
{
union semun arg;
- extern int errno;
arg.val = val;
@@ -94,7 +96,7 @@ new_sems( nsems )
return sem;
}
-static
+static void
do_sem( sem_id, pbuf, err )
int sem_id;
struct sembuf *pbuf;
@@ -148,10 +150,17 @@ void
remove_sems( sem_id )
int sem_id;
{
+#if defined(__NetBSD__) && defined(__NetBSD_Version__) \
+ && (__NetBSD_Version__ < 104110000)
+ union semun dummy;
+#else
+#define dummy NULL
+#endif
+
if( sem_id == -1 )
return;
- if( semctl( sem_id, 0, IPC_RMID, NULL ) == -1 ){
+ if( semctl( sem_id, 0, IPC_RMID, dummy ) == -1 ){
report_proc();
perror( "internal error, failed to remove semaphore" );
}

View File

@@ -0,0 +1,51 @@
$NetBSD: patch-ac,v 1.4 2012/10/20 22:14:05 joerg Exp $
--- buffer.c.orig 1994-10-04 16:44:53.000000000 +0000
+++ buffer.c
@@ -103,4 +103,6 @@
*
*/
+#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
#include <stdio.h>
@@ -118,6 +120,4 @@ static char *rcsid = "$Header: /a/swan/h
#endif
-extern char *shmat();
-
/* General macros */
#define TRUE 1
@@ -385,4 +385,5 @@ parse_args( argc, argv )
/* The interrupt handler */
+void
shutdown()
{
@@ -401,4 +402,5 @@ shutdown()
/* Shutdown because the child has ended */
+void
child_shutdown()
{
@@ -461,5 +463,5 @@ buffer_allocate()
if( debug )
- fprintf( stderr, "%s pbuffer is 0x%08x, buffer_size is %d [%d x %d]\n",
+ fprintf( stderr, "%s pbuffer is %p, buffer_size is %d [%d x %d]\n",
proc_string,
(char *)pbuffer, buffer_size, blocks, blocksize );
@@ -489,5 +491,5 @@ buffer_allocate()
}
-buffer_remove()
+void buffer_remove(void)
{
static char removing = FALSE;
@@ -728,5 +730,5 @@ write_block_to_stdout()
if( next_k == 0 && showevery ){
if( debug > 3 )
- fprintf( stderr, "W: next_k = %lu showevery = %lu\n", next_k, showevery );
+ fprintf( stderr, "W: next_k = %lu showevery = %d\n", next_k, showevery );
showevery = showevery / 1024;
next_k = showevery;