pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/net/openrsync net/openrsync: import openrsync-0.20190221
details: https://anonhg.NetBSD.org/pkgsrc/rev/dfb719f9b2f2
branches: trunk
changeset: 393040:dfb719f9b2f2
user: kamil <kamil%pkgsrc.org@localhost>
date: Mon Mar 11 16:27:03 2019 +0000
description:
net/openrsync: import openrsync-0.20190221
Implementation of rsync with a BSD (ISC) license.
diffstat:
net/openrsync/DESCR | 1 +
net/openrsync/Makefile | 19 +++++
net/openrsync/PLIST | 5 +
net/openrsync/distinfo | 11 +++
net/openrsync/patches/patch-Makefile | 32 +++++++++
net/openrsync/patches/patch-extern.h | 19 +++++
net/openrsync/patches/patch-pledge.c | 15 ++++
net/openrsync/patches/patch-recallocarray.c | 99 +++++++++++++++++++++++++++++
net/openrsync/patches/patch-unveil.c | 15 ++++
9 files changed, 216 insertions(+), 0 deletions(-)
diffs (252 lines):
diff -r 413f0391cd71 -r dfb719f9b2f2 net/openrsync/DESCR
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/net/openrsync/DESCR Mon Mar 11 16:27:03 2019 +0000
@@ -0,0 +1,1 @@
+Implementation of rsync with a BSD (ISC) license.
diff -r 413f0391cd71 -r dfb719f9b2f2 net/openrsync/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/net/openrsync/Makefile Mon Mar 11 16:27:03 2019 +0000
@@ -0,0 +1,19 @@
+# $NetBSD: Makefile,v 1.1 2019/03/11 16:27:03 kamil Exp $
+
+GITHUB_PROJECT= openrsync
+GITHUB_TAG= f18392f58d1f0bc72917e3ac3a46be74c194688d
+DISTNAME= openrsync-0.20190221
+CATEGORIES= net
+MASTER_SITES= ${MASTER_SITE_GITHUB:=kristapsdz/}
+
+MAINTAINER= pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE= https://github.com/kristapsdz/openrsync
+COMMENT= BSD-licensed implementation of rsync
+LICENSE= isc
+
+WRKSRC= ${WRKDIR}/openrsync-${GITHUB_TAG}
+
+INSTALL_MAKE_FLAGS+= PREFIX=${PREFIX}
+INSTALL_MAKE_FLAGS+= MANDIR=${PREFIX}/${PKGMANDIR}
+
+.include "../../mk/bsd.pkg.mk"
diff -r 413f0391cd71 -r dfb719f9b2f2 net/openrsync/PLIST
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/net/openrsync/PLIST Mon Mar 11 16:27:03 2019 +0000
@@ -0,0 +1,5 @@
+@comment $NetBSD: PLIST,v 1.1 2019/03/11 16:27:03 kamil Exp $
+bin/openrsync
+man/man1/openrsync.1
+man/man5/rsync.5
+man/man5/rsyncd.5
diff -r 413f0391cd71 -r dfb719f9b2f2 net/openrsync/distinfo
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/net/openrsync/distinfo Mon Mar 11 16:27:03 2019 +0000
@@ -0,0 +1,11 @@
+$NetBSD: distinfo,v 1.1 2019/03/11 16:27:03 kamil Exp $
+
+SHA1 (openrsync-0.20190221-f18392f58d1f0bc72917e3ac3a46be74c194688d.tar.gz) = 5439cc9d8854c36fc7f7cc2db49d5ced4d73f4a5
+RMD160 (openrsync-0.20190221-f18392f58d1f0bc72917e3ac3a46be74c194688d.tar.gz) = d6fd986bbec6c01a5967ab5083a409c1373302e4
+SHA512 (openrsync-0.20190221-f18392f58d1f0bc72917e3ac3a46be74c194688d.tar.gz) =
4c4a5ddda02e577f812a9832b6afb63104f65f76446037ddb30bf40aa0a269e919e100c7a688b5717ed6a10aa0f7698114e5a77021df2d1deb44b87b9aa36a82
+Size (openrsync-0.20190221-f18392f58d1f0bc72917e3ac3a46be74c194688d.tar.gz) = 73171 bytes
+SHA1 (patch-Makefile) = ed03f7c75fb958ffa5cb7b046f1871a74711fce0
+SHA1 (patch-extern.h) = c479848ab9741ad563b715c9f10786b22854766f
+SHA1 (patch-pledge.c) = 940beb1c5f339221b0252f6fd228fcf848b51042
+SHA1 (patch-recallocarray.c) = 4ba079d9d368680aff56fc0d4a04fcd6778a3aed
+SHA1 (patch-unveil.c) = e40ec3d6cd9e2ff032a9704baaa7da9993351fd1
diff -r 413f0391cd71 -r dfb719f9b2f2 net/openrsync/patches/patch-Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/net/openrsync/patches/patch-Makefile Mon Mar 11 16:27:03 2019 +0000
@@ -0,0 +1,32 @@
+$NetBSD: patch-Makefile,v 1.1 2019/03/11 16:27:03 kamil Exp $
+
+Add fallback files with functions missing on !OpenBSD.
+Specify -D_OPENBSD_SOURCE to enable OpenBSD APIs on NetBSD.
+
+--- Makefile.orig 2019-02-21 15:41:00.000000000 +0000
++++ Makefile
+@@ -12,12 +12,15 @@ OBJS = blocks.o \
+ md4.o \
+ mkpath.o \
+ mktemp.o \
++ pledge.o \
++ recallocarray.o \
+ receiver.o \
+ sender.o \
+ server.o \
+ session.o \
+ socket.o \
+ symlinks.o \
++ unveil.o \
+ uploader.o
+ ALLOBJS = $(OBJS) \
+ main.o
+@@ -27,7 +30,7 @@ MANDIR = $(PREFIX)/man
+ BINDIR = $(PREFIX)/bin
+
+ # The -O0 is to help with debugging coredumps.
+-CFLAGS += -O0 -g -W -Wall -Wextra -Wno-unused-parameter
++CFLAGS += -O0 -g -W -Wall -Wextra -Wno-unused-parameter -D_OPENBSD_SOURCE
+
+ all: openrsync
+
diff -r 413f0391cd71 -r dfb719f9b2f2 net/openrsync/patches/patch-extern.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/net/openrsync/patches/patch-extern.h Mon Mar 11 16:27:03 2019 +0000
@@ -0,0 +1,19 @@
+$NetBSD: patch-extern.h,v 1.1 2019/03/11 16:27:03 kamil Exp $
+
+Add fallback declarations of functions missing on !OpenBSD.
+
+--- extern.h.orig 2019-02-21 15:41:00.000000000 +0000
++++ extern.h
+@@ -383,6 +383,12 @@ int idents_recv(struct sess *, int, s
+ void idents_remap(struct sess *, int, struct ident *, size_t);
+ int idents_send(struct sess *, int, const struct ident *, size_t);
+
++#ifndef __OpenBSD__
++void *recallocarray(void *ptr, size_t oldnmemb, size_t nmemb, size_t size);
++int pledge(const char *promises, const char *execpromises);
++int unveil(const char *path, const char *permissions);
++#endif
++
+ __END_DECLS
+
+ #endif /*!EXTERN_H*/
diff -r 413f0391cd71 -r dfb719f9b2f2 net/openrsync/patches/patch-pledge.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/net/openrsync/patches/patch-pledge.c Mon Mar 11 16:27:03 2019 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-pledge.c,v 1.1 2019/03/11 16:27:03 kamil Exp $
+
+Add a fallback implementation of OpenBSD specific function.
+
+--- pledge.c.orig 2019-03-11 16:01:37.907598032 +0000
++++ pledge.c
+@@ -0,0 +1,8 @@
++#ifndef __OpenBSD__
++int
++pledge(const char *promises, const char *execpromises)
++{
++
++ return 0;
++}
++#endif
diff -r 413f0391cd71 -r dfb719f9b2f2 net/openrsync/patches/patch-recallocarray.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/net/openrsync/patches/patch-recallocarray.c Mon Mar 11 16:27:03 2019 +0000
@@ -0,0 +1,99 @@
+$NetBSD: patch-recallocarray.c,v 1.1 2019/03/11 16:27:03 kamil Exp $
+
+Add a fallback implementation of OpenBSD specific function.
+
+--- recallocarray.c.orig 2019-03-11 16:01:37.907728248 +0000
++++ recallocarray.c
+@@ -0,0 +1,92 @@
++#ifndef __OpenBSD__
++
++/* $OpenBSD: recallocarray.c,v 1.1 2017/03/06 18:44:21 otto Exp $ */
++/*
++ * Copyright (c) 2008, 2017 Otto Moerbeek <otto%drijf.net@localhost>
++ *
++ * Permission to use, copy, modify, and distribute this software for any
++ * purpose with or without fee is hereby granted, provided that the above
++ * copyright notice and this permission notice appear in all copies.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ */
++
++#include <errno.h>
++#include <stdlib.h>
++#include <stdint.h>
++#include <string.h>
++#include <unistd.h>
++
++void *(* volatile __internal_explicit_memset_impl)(void *, int, size_t) = memset;
++
++static void *
++__internal_explicit_bzero(void *b, size_t len)
++{
++
++ return (*__internal_explicit_memset_impl)(b, 0, len);
++}
++
++/*
++ * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX
++ * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW
++ */
++#define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4))
++
++void *
++recallocarray(void *ptr, size_t oldnmemb, size_t newnmemb, size_t size)
++{
++ size_t oldsize, newsize;
++ void *newptr;
++
++ if (ptr == NULL)
++ return calloc(newnmemb, size);
++
++ if ((newnmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
++ newnmemb > 0 && SIZE_MAX / newnmemb < size) {
++ errno = ENOMEM;
++ return NULL;
++ }
++ newsize = newnmemb * size;
++
++ if ((oldnmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
++ oldnmemb > 0 && SIZE_MAX / oldnmemb < size) {
++ errno = EINVAL;
++ return NULL;
++ }
++ oldsize = oldnmemb * size;
++
++ /*
++ * Don't bother too much if we're shrinking just a bit,
++ * we do not shrink for series of small steps, oh well.
++ */
++ if (newsize <= oldsize) {
++ size_t d = oldsize - newsize;
++
++ if (d < oldsize / 2 && d < (size_t)getpagesize()) {
++ memset((char *)ptr + newsize, 0, d);
++ return ptr;
++ }
++ }
++
++ newptr = malloc(newsize);
++ if (newptr == NULL)
++ return NULL;
++
++ if (newsize > oldsize) {
++ memcpy(newptr, ptr, oldsize);
++ memset((char *)newptr + oldsize, 0, newsize - oldsize);
++ } else
++ memcpy(newptr, ptr, newsize);
++
++ __internal_explicit_bzero(ptr, oldsize);
++ free(ptr);
++
++ return newptr;
++}
++#endif
diff -r 413f0391cd71 -r dfb719f9b2f2 net/openrsync/patches/patch-unveil.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/net/openrsync/patches/patch-unveil.c Mon Mar 11 16:27:03 2019 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-unveil.c,v 1.1 2019/03/11 16:27:03 kamil Exp $
+
+Add a fallback implementation of OpenBSD specific function.
+
+--- unveil.c.orig 2019-03-11 16:01:37.907822028 +0000
++++ unveil.c
+@@ -0,0 +1,8 @@
++#ifndef __OpenBSD__
++int
++unveil(const char *path, const char *permissions)
++{
++
++ return 0;
++}
++#endif
Home |
Main Index |
Thread Index |
Old Index