net-misc/csync: fix compilation with GCC 8
authorBernard Cafarelli <voyageur@gentoo.org>
Thu, 6 Dec 2018 22:19:43 +0000 (23:19 +0100)
committerBernard Cafarelli <voyageur@gentoo.org>
Thu, 6 Dec 2018 22:20:18 +0000 (23:20 +0100)
Update ebuild (EAPI, patch, samba conditional)

Closes: https://bugs.gentoo.org/671094
Package-Manager: Portage-2.3.52, Repoman-2.3.12
Signed-off-by: Bernard Cafarelli <voyageur@gentoo.org>
net-misc/csync/csync-0.50.0-r1.ebuild [new file with mode: 0644]
net-misc/csync/files/csync-0.50.0-gcc_5_and_8.patch [new file with mode: 0644]

diff --git a/net-misc/csync/csync-0.50.0-r1.ebuild b/net-misc/csync/csync-0.50.0-r1.ebuild
new file mode 100644 (file)
index 0000000..5374066
--- /dev/null
@@ -0,0 +1,47 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils
+
+DESCRIPTION="lightweight file synchronizer utility"
+HOMEPAGE="https://www.csync.org/"
+SRC_URI="https://open.cryptomilk.org/attachments/download/27/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc iconv samba +sftp test"
+
+RDEPEND=">=dev-db/sqlite-3.4:3
+       net-libs/neon[ssl]
+       iconv? ( virtual/libiconv )
+       samba? ( >=net-fs/samba-3.5 )
+       sftp? ( >=net-libs/libssh-0.5 )
+       !net-misc/ocsync"
+DEPEND="${RDEPEND}
+       app-text/asciidoc
+       doc? ( app-doc/doxygen )
+       test? ( dev-util/cmocka )"
+
+PATCHES=( "${FILESDIR}"/${P}-gcc_5_and_8.patch )
+src_prepare() {
+       cmake-utils_src_prepare
+
+       # proper docdir
+       sed -e "s:/doc/${PN}:/doc/${PF}:" \
+               -i doc/CMakeLists.txt || die
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DSYSCONF_INSTALL_DIR="${EPREFIX}"/etc
+               -DWITH_ICONV="$(usex iconv)"
+               -DUNIT_TESTING="$(usex test)"
+               $(cmake-utils_use_find_package doc Doxygen)
+               $(cmake-utils_use_find_package samba SMBClient)
+               $(cmake-utils_use_find_package sftp LibSSH)
+       )
+       cmake-utils_src_configure
+}
diff --git a/net-misc/csync/files/csync-0.50.0-gcc_5_and_8.patch b/net-misc/csync/files/csync-0.50.0-gcc_5_and_8.patch
new file mode 100644 (file)
index 0000000..44bcc3e
--- /dev/null
@@ -0,0 +1,36 @@
+diff -Naur csync-0.50.0.orig/modules/csync_smb.c csync-0.50.0/modules/csync_smb.c
+--- csync-0.50.0.orig/modules/csync_smb.c      2013-07-29 14:04:37.000000000 +0200
++++ csync-0.50.0/modules/csync_smb.c   2018-12-06 23:08:05.320992985 +0100
+@@ -49,7 +49,7 @@
+     char *pw, int pwlen)
+ {
+   static int try_krb5 = 1;
+-  char *h;
++  const char *h;
+   (void) smb_ctx;
+   (void) shr;
+diff -Naur csync-0.50.0.orig/src/csync_log.h csync-0.50.0/src/csync_log.h
+--- csync-0.50.0.orig/src/csync_log.h  2013-07-29 14:04:37.000000000 +0200
++++ csync-0.50.0/src/csync_log.h       2018-12-06 23:11:34.280239832 +0100
+@@ -55,7 +55,7 @@
+ };
+ #define CSYNC_LOG(priority, ...) \
+-  csync_log(priority, __FUNCTION__, __VA_ARGS__)
++  csync_log(priority, __func__, __VA_ARGS__)
+ void csync_log(int verbosity,
+                const char *function,
+diff -Naur csync-0.50.0.orig/tests/csync_tests/check_csync_log.c csync-0.50.0/tests/csync_tests/check_csync_log.c
+--- csync-0.50.0.orig/tests/csync_tests/check_csync_log.c      2013-04-22 13:00:35.000000000 +0200
++++ csync-0.50.0/tests/csync_tests/check_csync_log.c   2018-12-06 23:11:34.280239832 +0100
+@@ -115,7 +115,7 @@
+     rc = csync_set_log_callback(check_log_callback);
+     assert_int_equal(rc, 0);
+-    csync_log(1, __FUNCTION__, "rc = %d", rc);
++    csync_log(1, __func__, "rc = %d", rc);
+     rc = _tstat(path, &sb);