1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-08 06:48:28 +00:00

- Update net/csync2 to version 2.0.

- Prevent use of pdflatex when it's installed.
- Replace patch-csync2-compare with USES=shebangfix.
- Add a patch to fix use of strlcpy (pass size of destination instead of
  source).
- Add a patch to let the compiler know csync_fatal does not return.  This
  fixes a warning about an uninitialised variable.
- Use predefined PKG_PREFIX in pkg-install and create directories from
  pkg-plist.

PR:		207765
Approved by:	alexey@renatasystems.org (maintainer)
This commit is contained in:
Tijl Coosemans 2016-03-11 13:33:35 +00:00
parent e9ce1b58c2
commit fcc0629983
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=410829
10 changed files with 81 additions and 118 deletions

View File

@ -2,52 +2,44 @@
# $FreeBSD$
PORTNAME= csync2
PORTVERSION= 1.34
PORTREVISION= 20
PORTVERSION= 2.0
CATEGORIES= net
MASTER_SITES= http://oss.linbit.com/csync2/ \
http://people.freebsd.org/~aaron/distfiles/
MASTER_SITES= http://oss.linbit.com/csync2/
MAINTAINER= alexey@renatasystems.org
COMMENT= Cluster synchronization tool
LIB_DEPENDS= librsync.so:${PORTSDIR}/net/librsync \
libtasn1.so:${PORTSDIR}/security/libtasn1 \
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/COPYING
LIB_DEPENDS= librsync.so.2:${PORTSDIR}/net/librsync1 \
libgnutls.so:${PORTSDIR}/security/gnutls \
libsqlite.so:${PORTSDIR}/databases/sqlite2 \
libgcrypt.so:${PORTSDIR}/security/libgcrypt \
libgpg-error.so:${PORTSDIR}/security/libgpg-error
libsqlite3.so:${PORTSDIR}/databases/sqlite3
OPTIONS_DEFINE= CSYNC2_COMPARE
CSYNC2_COMPARE_DESC= Install csync2-compare script
OPTIONS_DEFINE= CSYNC2_COMPARE DOCS
OPTIONS_SUB= yes
CSYNC2_COMPARE_DESC= Install csync2-compare script
CSYNC2_COMPARE_RUN_DEPENDS= bash:${PORTSDIR}/shells/bash
USES= pkgconfig
USES= pkgconfig shebangfix
SHEBANG_FILES= csync2-compare
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --sysconfdir=${PREFIX}/etc
CONFIGURE_ENV= LIBGNUTLS_CONFIG="${LOCALBASE}/bin/pkg-config gnutls"
CONFIGURE_ARGS= ac_cv_prog_PDFLATEX=
CPPFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
LIBS+= -L${LOCALBASE}/lib
USE_RC_SUBR= csync2
PLIST_FILES= etc/csync2.cfg-dist \
sbin/csync2 \
man/man1/csync2.1.gz
SUB_FILES= pkg-install
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MCSYNC2_COMPARE}
RUN_DEPENDS+= bash:${PORTSDIR}/shells/bash
PLIST_FILES+= sbin/csync2-compare
CSYNC2_COMPARE= csync2-compare
.else
CSYNC2_COMPARE=
.endif
post-patch:
${REINPLACE_CMD} -E "s#%%CSYNC2_COMPARE%%#${CSYNC2_COMPARE}#" ${WRKSRC}/Makefile.in
@${REINPLACE_CMD} -e 's|(localstatedir)/lib|(localstatedir)/db|' \
-e 's/-ldl//' ${WRKSRC}/Makefile.in
post-install:
${MV} ${STAGEDIR}${PREFIX}/etc/csync2.cfg \
${STAGEDIR}${PREFIX}/etc/csync2.cfg.sample
${MKDIR} ${STAGEDIR}/var/backups/csync2
.include <bsd.port.mk>

View File

@ -1,2 +1,2 @@
SHA256 (csync2-1.34.tar.gz) = 32b250dd4a0353f71015c5c3961174b975dd5e799e4a084e8f6d00792bd8c833
SIZE (csync2-1.34.tar.gz) = 222765
SHA256 (csync2-2.0.tar.gz) = 11cb37380fb185bce0c22b804fec9b01c385d9d83cc528cfd48d748453834fa2
SIZE (csync2-2.0.tar.gz) = 411013

View File

@ -1,20 +0,0 @@
--- ./Makefile.am.orig 2007-07-24 14:04:18.000000000 -0700
+++ ./Makefile.am 2008-01-17 02:39:33.790652051 -0800
@@ -48,14 +48,14 @@
LIBS += -lprivatesqlite
endif
-AM_CPPFLAGS = -D'DBDIR="$(localstatedir)/lib/csync2"'
+AM_CPPFLAGS = -D'DBDIR="$(localstatedir)/db/csync2"'
AM_CPPFLAGS += -D'ETCDIR="$(sysconfdir)"'
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(sysconfdir)
- $(mkinstalldirs) $(DESTDIR)$(localstatedir)/lib/csync2
+ $(mkinstalldirs) $(DESTDIR)$(localstatedir)/db/csync2
test -e $(DESTDIR)$(sysconfdir)/csync2.cfg || \
- $(INSTALL_DATA) $(srcdir)/csync2.cfg $(DESTDIR)$(sysconfdir)/csync2.cfg
+ $(INSTALL_DATA) $(srcdir)/csync2.cfg $(DESTDIR)$(sysconfdir)/csync2.cfg-dist
cert:
$(mkinstalldirs) $(DESTDIR)$(sysconfdir)

View File

@ -1,32 +0,0 @@
--- Makefile.in.orig 2007-07-24 21:04:25.000000000 +0000
+++ Makefile.in 2010-05-20 10:51:32.000000000 +0000
@@ -150,7 +150,7 @@
target_alias = @target_alias@
sbin_PROGRAMS = csync2
-sbin_SCRIPTS = csync2-compare
+sbin_SCRIPTS = %%CSYNC2_COMPARE%%
man_MANS = csync2.1
csync2_SOURCES = action.c cfgfile_parser.y cfgfile_scanner.l check.c \
@@ -168,7 +168,7 @@
AM_CFLAGS = $(am__append_2) $(am__append_6)
AM_LDFLAGS = $(am__append_3) $(am__append_7)
-AM_CPPFLAGS = -D'DBDIR="$(localstatedir)/lib/csync2"' -D'ETCDIR="$(sysconfdir)"'
+AM_CPPFLAGS = -D'DBDIR="$(localstatedir)/db/csync2"' -D'ETCDIR="$(sysconfdir)"'
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -699,9 +699,9 @@
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(sysconfdir)
- $(mkinstalldirs) $(DESTDIR)$(localstatedir)/lib/csync2
+ $(mkinstalldirs) $(DESTDIR)$(localstatedir)/db/csync2
test -e $(DESTDIR)$(sysconfdir)/csync2.cfg || \
- $(INSTALL_DATA) $(srcdir)/csync2.cfg $(DESTDIR)$(sysconfdir)/csync2.cfg
+ $(INSTALL_DATA) $(srcdir)/csync2.cfg $(DESTDIR)$(sysconfdir)/csync2.cfg-dist
cert:
$(mkinstalldirs) $(DESTDIR)$(sysconfdir)

View File

@ -1,11 +0,0 @@
--- configure.org 2009-09-03 14:22:32.000000000 +0900
+++ configure 2009-09-03 14:23:02.000000000 +0900
@@ -3836,7 +3836,7 @@
else
LIBGNUTLS_CFLAGS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --cflags`
LIBGNUTLS_LIBS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --libs`
- libgnutls_config_version=`$LIBGNUTLS_CONFIG $libgnutls_config_args --version`
+ libgnutls_config_version=`$LIBGNUTLS_CONFIG $libgnutls_config_args --modversion`
ac_save_CFLAGS="$CFLAGS"

View File

@ -1,8 +0,0 @@
--- csync2-compare.orig 2010-05-20 10:55:31.000000000 +0000
+++ csync2-compare 2010-05-20 10:55:50.000000000 +0000
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/local/bin/bash
verbose=0

View File

@ -0,0 +1,11 @@
--- csync2.h.orig 2013-05-02 12:58:14 UTC
+++ csync2.h
@@ -80,7 +80,7 @@ extern int csync_perm(const char *filena
extern void csync_printtime();
extern void csync_printtotaltime();
-extern void csync_fatal(const char *fmt, ...);
+extern void csync_fatal(const char *fmt, ...) __dead2;
extern void csync_debug(int lv, const char *fmt, ...);
#define csync_debug_ping(N) \

View File

@ -0,0 +1,30 @@
--- rsync.c.orig 2015-03-09 14:08:51 UTC
+++ rsync.c
@@ -41,6 +41,7 @@
/* This has been taken from rsync:lib/compat.c */
+#if 0
/**
* Like strncpy but does not 0 fill the buffer and always null
* terminates.
@@ -61,6 +62,7 @@ static size_t strlcpy(char *d, const cha
}
return ret;
}
+#endif
/* splits filepath at the last '/', if any, like so:
* dirname basename filepath
@@ -117,7 +119,10 @@ int mkpath(const char *path, mode_t mode
return -1;
}
- strlcpy(temp,path,strlen(path));
+ if(strlcpy(temp,path,sizeof(temp))>=sizeof(temp)) {
+ csync_debug(1,"path too long: %s",path);
+ return -1;
+ }
csync_debug(1,"mkpath full path: %s",temp);
for( remaining=strchr(temp+1, '/'); remaining!=NULL; remaining=strchr(remaining+1, '/') ){
*remaining='\0';

View File

@ -1,9 +1,5 @@
#!/bin/sh
: ${PREFIX:="%%PREFIX%%"}
: ${CSYNC2_DBDIR:="/var/db/csync2"}
: ${CSYNC2_BACKUPDIR:="/var/backups/csync2"}
create_cert() {
_errlog=`mktemp /tmp/.${0##*/}.XXXXX`
@ -11,12 +7,12 @@ create_cert() {
exec 3>&2 2>${_errlog}
openssl genrsa -out ${PREFIX}/etc/csync2_ssl_key.pem 1024 || code=1
yes '' | openssl req -new -key ${PREFIX}/etc/csync2_ssl_key.pem \
openssl genrsa -out ${PKG_PREFIX}/etc/csync2_ssl_key.pem 1024 || code=1
yes '' | openssl req -new -key ${PKG_PREFIX}/etc/csync2_ssl_key.pem \
-out /tmp/csync2_ssl_cert.csr || code=1
openssl x509 -req -days 600 -in /tmp/csync2_ssl_cert.csr \
-signkey ${PREFIX}/etc/csync2_ssl_key.pem \
-out ${PREFIX}/etc/csync2_ssl_cert.pem || code=1
-signkey ${PKG_PREFIX}/etc/csync2_ssl_key.pem \
-out ${PKG_PREFIX}/etc/csync2_ssl_cert.pem || code=1
rm -f /tmp/csync2_ssl_cert.csr
@ -33,8 +29,8 @@ create_cert() {
rm -f ${_errlog}
chmod 600 ${PREFIX}/etc/csync2_ssl_key.pem \
${PREFIX}/etc/csync2_ssl_cert.pem
chmod 600 ${PKG_PREFIX}/etc/csync2_ssl_key.pem \
${PKG_PREFIX}/etc/csync2_ssl_cert.pem
echo "csync2: RSA certificate-key pair installed."
@ -49,11 +45,7 @@ post_install() {
[ -n "${PACKAGE_BUILDING}" ] && return 0
for _dir in ${CSYNC2_DBDIR} ${CSYNC2_BACKUPDIR}; do
[ ! -d ${_dir} ] && mkdir -p -m 700 ${_dir}
done
if [ ! -f ${PREFIX}/etc/csync2_ssl_cert.pem ]; then
if [ ! -f ${PKG_PREFIX}/etc/csync2_ssl_cert.pem ]; then
create_cert || return $?
fi

9
net/csync2/pkg-plist Normal file
View File

@ -0,0 +1,9 @@
@sample etc/csync2.cfg.sample
man/man1/csync2.1.gz
sbin/csync2
%%CSYNC2_COMPARE%%sbin/csync2-compare
%%PORTDOCS%%%%DOCSDIR%%/AUTHORS
%%PORTDOCS%%%%DOCSDIR%%/ChangeLog
%%PORTDOCS%%%%DOCSDIR%%/README
@dir(,,700) /var/db/csync2
@dir(,,700) /var/backups/csync2