commit dbdd62ff50375da338358949e926641e1a3ebf67
parent 4db475807a6be461ed4de5a9a23699f449241687
Author: parazyd <parazyd@dyne.org>
Date: Mon, 15 Oct 2018 13:28:02 +0200
net-fs/davfs2: Add 1.5.4
Diffstat:
5 files changed, 283 insertions(+), 0 deletions(-)
diff --git a/net-fs/davfs2/Manifest b/net-fs/davfs2/Manifest
@@ -0,0 +1 @@
+DIST davfs2-1.5.4.tar.gz 478377 BLAKE2B 25c7dba1a6cda384a60c8ce2e0a56d5c805f5c30f35f086bfe1f55ee4eb79b8228beca2e7214e9858a1c49c8f782c6de8f4f0631cf0e2090991a0e35ba5d8ed2 SHA512 08550f171f4b196f55f3fb71c6c75ed24063f8a5afc31c52502d0c911cf7aca4da01f7a123269d410dadc497c44ef5a3573e455aca6eafe48eb86f18429b94b2
diff --git a/net-fs/davfs2/davfs2-1.5.4.ebuild b/net-fs/davfs2/davfs2-1.5.4.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools user
+
+DESCRIPTION="Linux FUSE (or coda) driver that allows you to mount a WebDAV resource"
+HOMEPAGE="https://savannah.nongnu.org/projects/davfs2"
+SRC_URI="mirror://nongnu/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="amd64 ~arm ppc x86"
+IUSE="nls"
+RESTRICT="test"
+
+RDEPEND="dev-libs/libxml2
+ net-libs/neon
+ sys-libs/zlib
+ nls? ( virtual/libintl virtual/libiconv )
+"
+DEPEND="${REPEND}
+ nls? ( sys-devel/gettext )
+"
+
+PATCHES=(
+ "${FILESDIR}/010-main_code_fix.patch"
+ "${FILESDIR}/100-musl-compat.patch"
+)
+
+pkg_setup() {
+ enewgroup davfs2
+}
+
+src_prepare() {
+ default
+ eaclocal -I config \
+ && eautoheader \
+ && eautomake --add-missing --force-missing --copy \
+ && eautoconf
+}
+
+src_configure() {
+ econf dav_user=nobody --enable-largefile $(use_enable nls)
+}
+
+pkg_postinst() {
+ elog
+ elog "Quick setup:"
+ elog " (as root)"
+ elog " # gpasswd -a \${your_user} davfs2"
+ elog " # echo 'http://path/to/dav /home/\${your_user}/dav davfs rw,user,noauto 0 0' >> /etc/fstab"
+ elog " (as user)"
+ elog " \$ mkdir -p ~/dav"
+ elog " \$ mount ~/dav"
+ elog
+}
diff --git a/net-fs/davfs2/files/010-main_code_fix.patch b/net-fs/davfs2/files/010-main_code_fix.patch
@@ -0,0 +1,22 @@
+--- a/src/cache.c
++++ b/src/cache.c
+@@ -58,7 +58,7 @@
+ #ifdef HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+-#include <sys/xattr.h>
++#include <linux/xattr.h>
+
+ #include <ne_alloc.h>
+ #include <ne_string.h>
+--- a/src/webdav.c
++++ b/src/webdav.c
+@@ -2033,7 +2033,7 @@ ssl_verify(void *userdata, int failures,
+ len = getline(&s, &n, stdin);
+ if (len < 0)
+ abort();
+- if (rpmatch(s) > 0)
++ if ((s[0]=='y' || s[0]=='Y') > 0)
+ ret = 0;
+ free(s);
+ }
diff --git a/net-fs/davfs2/files/100-musl-compat.patch b/net-fs/davfs2/files/100-musl-compat.patch
@@ -0,0 +1,194 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -42,7 +42,7 @@ DAV_CHECK_NEON
+ # Checks for header files.
+ AC_HEADER_DIRENT
+ AC_HEADER_STDC
+-AC_CHECK_HEADERS([fcntl.h libintl.h langinfo.h limits.h locale.h mntent.h stddef.h stdint.h stdlib.h string.h sys/file.h sys/mount.h sys/time.h syslog.h termios.h unistd.h utime.h])
++AC_CHECK_HEADERS([error.h fcntl.h iconv.h libintl.h langinfo.h limits.h locale.h mntent.h stddef.h stdint.h stdlib.h string.h sys/file.h sys/mount.h sys/time.h sys/select.h sys/types.h syslog.h termios.h unistd.h utime.h])
+
+ # Checks for typedefs, structures, and compiler characteristics.
+ AC_C_CONST
+@@ -78,7 +78,7 @@ AC_FUNC_SELECT_ARGTYPES
+ AC_FUNC_STRFTIME
+ AC_FUNC_STAT
+ AC_FUNC_UTIME_NULL
+-AC_CHECK_FUNCS([endpwent ftruncate getmntent memset mkdir nl_langinfo rpmatch select setlocale strcasecmp strchr strdup strerror strpbrk strrchr strstr strtol strtoull utime])
++AC_CHECK_FUNCS([endpwent ftruncate getmntent memset mkdir nl_langinfo rpmatch select setlocale strcasecmp strchr strdup strerror strpbrk strrchr strstr strtol strtoull utime canonicalize_file_name fopencookie])
+
+ # Misc.
+ DAV_DEFAULTS
+--- a/src/cache.c
++++ b/src/cache.c
+@@ -19,12 +19,12 @@
+
+
+ #include "config.h"
++#include "compat.h"
+
+ #ifdef HAVE_DIRENT_H
+ #include <dirent.h>
+ #endif
+ #include <errno.h>
+-#include <error.h>
+ #ifdef HAVE_FCNTL_H
+ #include <fcntl.h>
+ #endif
+--- a/src/dav_fuse.c
++++ b/src/dav_fuse.c
+@@ -47,6 +47,9 @@
+ #ifdef HAVE_SYS_STAT_H
+ #include <sys/stat.h>
+ #endif
++#ifdef HAVE_SYS_SELECT_H
++#include <sys/select.h>
++#endif
+
+ #include "defaults.h"
+ #include "mount_davfs.h"
+--- a/src/kernel_interface.c
++++ b/src/kernel_interface.c
+@@ -19,8 +19,8 @@
+
+
+ #include "config.h"
++#include "compat.h"
+
+-#include <error.h>
+ #ifdef HAVE_FCNTL_H
+ #include <fcntl.h>
+ #endif
+@@ -51,6 +51,9 @@
+ #ifdef HAVE_SYS_STAT_H
+ #include <sys/stat.h>
+ #endif
++#ifdef HAVE_SYS_TYPES_H
++#include <sys/types.h>
++#endif
+ #include <sys/wait.h>
+
+ #include "defaults.h"
+--- a/src/mount_davfs.c
++++ b/src/mount_davfs.c
+@@ -19,10 +19,10 @@
+
+
+ #include "config.h"
++#include "compat.h"
+
+ #include <ctype.h>
+ #include <errno.h>
+-#include <error.h>
+ #ifdef HAVE_FCNTL_H
+ #include <fcntl.h>
+ #endif
+--- a/src/umount_davfs.c
++++ b/src/umount_davfs.c
+@@ -19,8 +19,8 @@
+
+
+ #include "config.h"
++#include "compat.h"
+
+-#include <error.h>
+ #include <errno.h>
+ #include <getopt.h>
+ #ifdef HAVE_LIBINTL_H
+--- a/src/webdav.c
++++ b/src/webdav.c
+@@ -19,9 +19,9 @@
+
+
+ #include "config.h"
++#include "compat.h"
+
+ #include <errno.h>
+-#include <error.h>
+ #ifdef HAVE_FCNTL_H
+ #include <fcntl.h>
+ #endif
+@@ -368,6 +368,7 @@ dav_init_webdav(const dav_args *args)
+ error(EXIT_FAILURE, errno, _("socket library initialization failed"));
+
+ if (args->neon_debug & ~NE_DBG_HTTPPLAIN) {
++#ifdef HAVE_FOPENCOOKIE
+ char *buf = malloc(log_bufsize);
+ cookie_io_functions_t *log_func = malloc(sizeof(cookie_io_functions_t));
+ if (!log_func) abort();
+@@ -380,6 +381,9 @@ dav_init_webdav(const dav_args *args)
+ error(EXIT_FAILURE, errno,
+ _("can't open stream to log neon-messages"));
+ ne_debug_init(log_stream, args->neon_debug);
++#else
++ error(EXIT_FAILURE, 0, "neon debugging unsupported");
++#endif
+ }
+
+ session = ne_session_create(args->scheme, args->host, args->port);
+--- /dev/null
++++ b/src/compat.h
+@@ -0,0 +1,64 @@
++#ifndef _COMPAT_H
++#define _COMPAT_H
++
++#ifndef _PATH_MOUNTED
++# define _PATH_MOUNTED "/proc/mounts"
++#endif
++
++#ifndef _PATH_MNTTAB
++# define _PATH_MNTTAB "/etc/fstab"
++#endif
++
++#ifdef HAVE_ERROR_H
++# include <error.h>
++#else
++# include <stdio.h>
++# include <stdarg.h>
++# include <stdlib.h>
++# include <string.h>
++static void error_at_line(int status, int errnum, const char *filename,
++ unsigned int linenum, const char *format, ...)
++{
++ va_list ap;
++
++ fflush(stdout);
++
++ if (filename != NULL)
++ fprintf(stderr, "%s:%u: ", filename, linenum);
++
++ va_start(ap, format);
++ vfprintf(stderr, format, ap);
++ va_end(ap);
++
++ if (errnum != 0)
++ fprintf(stderr, ": %s", strerror(errnum));
++
++ fprintf(stderr, "\n");
++
++ if (status != 0)
++ exit(status);
++}
++
++#define error(status, errnum, format...) \
++ error_at_line(status, errnum, NULL, 0, format)
++
++#endif /* HAVE_ERROR_H */
++
++#ifndef HAVE_CANONICALIZE_FILE_NAME
++#include <limits.h>
++#include <string.h>
++#include <stdlib.h>
++static char * canonicalize_file_name(const char *path)
++{
++ char buf[PATH_MAX] = { };
++
++ snprintf(buf, sizeof(buf) - 1, "%s", path);
++
++ if (!realpath(path, buf))
++ return NULL;
++
++ return strdup(buf);
++}
++#endif
++
++#endif /* _COMPAT_H */
diff --git a/net-fs/davfs2/metadata.xml b/net-fs/davfs2/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>gokturk@gentoo.org</email>
+ <name>Göktürk Yüksek</name>
+ </maintainer>
+</pkgmetadata>