View | Details | Raw Unified | Return to bug 216348 | Differences between
and this patch

Collapse All | Expand All

(-)net-mgmt/seafile-client/Makefile (-26 / +2 lines)
Lines 1-7 Link Here
1
# $FreeBSD$
1
# $FreeBSD$
2
2
3
PORTNAME=	seafile-client
3
PORTNAME=	seafile-client
4
PORTVERSION=	6.0.1
4
PORTVERSION=	6.0.2
5
DISTVERSIONPREFIX=	v
5
DISTVERSIONPREFIX=	v
6
CATEGORIES=	net-mgmt
6
CATEGORIES=	net-mgmt
7
7
Lines 34-43 Link Here
34
USES=		autoreconf gettext iconv libarchive libtool mysql pathfix \
34
USES=		autoreconf gettext iconv libarchive libtool mysql pathfix \
35
		pkgconfig python:-2.7 shebangfix sqlite ssl
35
		pkgconfig python:-2.7 shebangfix sqlite ssl
36
USE_GNOME=	glib20
36
USE_GNOME=	glib20
37
SHEBANG_FILES=	scripts/*.sh scripts/upgrade/*.sh  tests/*.py tests/basic/*.sh \
37
SHEBANG_FILES=	*.sh scripts/*.sh integration-tests/*.sh
38
		tests/sync-auto-test/*.template *.sh scripts/build/*.py \
39
		scripts/*.py *.py scripts/upgrade/*.py app/seaf-cli \
40
		tools/seafile-admin
41
GNU_CONFIGURE=	yes
38
GNU_CONFIGURE=	yes
42
USE_LDCONFIG=	yes
39
USE_LDCONFIG=	yes
43
CONFIGURE_ENV=	SSL_CFLAGS="${OPENSSLINC}" SSL_LIBS="-L${OPENSSLLIB} -lssl -lcrypto"
40
CONFIGURE_ENV=	SSL_CFLAGS="${OPENSSLINC}" SSL_LIBS="-L${OPENSSLLIB} -lssl -lcrypto"
Lines 46-66 Link Here
46
CPPFLAGS+=	-I${LOCALBASE}/include -I${LOCALBASE}/include/evhtp
43
CPPFLAGS+=	-I${LOCALBASE}/include -I${LOCALBASE}/include/evhtp
47
LDFLAGS+=	-L${LOCALBASE}/lib
44
LDFLAGS+=	-L${LOCALBASE}/lib
48
45
49
OPTIONS_DEFINE=		FUSE RIAK
50
OPTIONS_SUB=		yes
51
52
FUSE_DESC=		Use file system in userspace
53
RIAK_DESC=		Use distributed noSQL database
54
55
FUSE_CONFIGURE_ENABLE=	fuse
56
FUSE_LIB_DEPENDS=	libfuse.so:sysutils/fusefs-libs
57
58
RIAK_CONFIGURE_ENABLE=	riak
59
RIAK_RUN_DEPENDS=	riak:databases/riak
60
61
OPTIONS_DEFAULT=	FUSE
62
OPTIONS_EXCLUDE_DragonFly=	FUSE
63
64
.include <bsd.port.options.mk>
46
.include <bsd.port.options.mk>
65
47
66
post-patch:
48
post-patch:
Lines 68-78 Link Here
68
.if ${OSVERSION} >= 1100097
50
.if ${OSVERSION} >= 1100097
69
	${REINPLACE_CMD} 's/P_KTHREAD/P_KPROC/' ${WRKSRC}/lib/utils.c
51
	${REINPLACE_CMD} 's/P_KTHREAD/P_KPROC/' ${WRKSRC}/lib/utils.c
70
.endif
52
.endif
71
	${REINPLACE_CMD} 's/python/${PYTHON_VERSION}/' \
72
		${WRKSRC}/scripts/upgrade/regenerate_secret_key.sh
73
	${REINPLACE_CMD} -e 's|^INSTALL.*|INSTALLPATH="${PREFIX}/${SEAFILE_SERVER}/seafile"|' \
74
			${WRKSRC}/scripts/seaf-cli-wrapper.sh
75
	${REINPLACE_CMD} 's/<evhtp.h>/<evhtp\/evhtp.h>/' ${WRKSRC}/server/upload-file.c \
76
			${WRKSRC}/server/access-file.c ${WRKSRC}/server/http-server.c
77
53
78
.include <bsd.port.mk>
54
.include <bsd.port.mk>
(-)net-mgmt/seafile-client/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1481772891
1
TIMESTAMP = 1485062937
2
SHA256 (haiwen-seafile-v6.0.1_GH0.tar.gz) = c212833ff21af19554d216ab3f5c01c3a5878d4bd30b4f71c67ec9b71416a095
2
SHA256 (haiwen-seafile-v6.0.2_GH0.tar.gz) = 8ac2eb3611e69b4fd85a9572714153566705c73e443cf2ae24da556c7cf12078
3
SIZE (haiwen-seafile-v6.0.1_GH0.tar.gz) = 1154256
3
SIZE (haiwen-seafile-v6.0.2_GH0.tar.gz) = 454751
(-)net-mgmt/seafile-client/files/patch-configure.ac (-19 / +7 lines)
Lines 1-6 Link Here
1
--- configure.ac.orig	2016-05-10 12:25:35 UTC
1
--- configure.ac.orig	2017-01-05 08:05:21 UTC
2
+++ configure.ac
2
+++ configure.ac
3
@@ -50,8 +50,16 @@ else
3
@@ -51,8 +51,16 @@ else
4
   AC_MSG_RESULT(no)
4
   AC_MSG_RESULT(no)
5
 fi
5
 fi
6
 
6
 
Lines 18-37 Link Here
18
   blinux=true
18
   blinux=true
19
   AC_MSG_RESULT(compile in linux)
19
   AC_MSG_RESULT(compile in linux)
20
 else
20
 else
21
@@ -93,6 +101,11 @@ if test "$bwin32" != true; then
21
@@ -61,6 +69,7 @@ fi
22
       [compile_fuse=$enableval],[compile_fuse="yes"])
23
 fi
24
 
22
 
25
+if test "$bbsd" = true; then
26
+   AC_ARG_ENABLE(fuse, AC_HELP_STRING([--enable-fuse], [enable fuse virtual file system]),
27
+      [compile_fuse=$enableval],[compile_fuse="no"])
28
+fi
29
+
30
 AC_ARG_ENABLE(client, AC_HELP_STRING([--enable-client], [enable client]),
31
    [compile_client=$enableval],[compile_client="yes"])
32
 
33
@@ -148,6 +161,7 @@ AM_CONDITIONAL([COMPILE_FUSE], [test "${
34
 
35
 AM_CONDITIONAL([WIN32], [test "$bwin32" = "true"])
23
 AM_CONDITIONAL([WIN32], [test "$bwin32" = "true"])
36
 AM_CONDITIONAL([MACOS], [test "$bmac" = "true"])
24
 AM_CONDITIONAL([MACOS], [test "$bmac" = "true"])
37
+AM_CONDITIONAL([BSD], [test "$bbsd" = "true"])
25
+AM_CONDITIONAL([BSD], [test "$bbsd" = "true"])
Lines 38-44 Link Here
38
 AM_CONDITIONAL([LINUX], [test "$blinux" = "true"])
26
 AM_CONDITIONAL([LINUX], [test "$blinux" = "true"])
39
 
27
 
40
 
28
 
41
@@ -193,6 +207,8 @@ if test "$bwin32" = true; then
29
@@ -105,6 +114,8 @@ if test "$bwin32" = true; then
42
   LIB_MAC=
30
   LIB_MAC=
43
   MSVC_CFLAGS="-D__MSVCRT__ -D__MSVCRT_VERSION__=0x0601"
31
   MSVC_CFLAGS="-D__MSVCRT__ -D__MSVCRT_VERSION__=0x0601"
44
   LIB_CRYPT32=-lcrypt32
32
   LIB_CRYPT32=-lcrypt32
Lines 47-53 Link Here
47
 elif test "$bmac" = true ; then
35
 elif test "$bmac" = true ; then
48
   LIB_WS32=
36
   LIB_WS32=
49
   LIB_GDI32=
37
   LIB_GDI32=
50
@@ -207,6 +224,24 @@ elif test "$bmac" = true ; then
38
@@ -119,6 +130,24 @@ elif test "$bmac" = true ; then
51
   LIB_MAC="-framework CoreServices"
39
   LIB_MAC="-framework CoreServices"
52
   LIB_CRYPT32=
40
   LIB_CRYPT32=
53
   LIB_ICONV=-liconv
41
   LIB_ICONV=-liconv
Lines 72-78 Link Here
72
 else
60
 else
73
   LIB_WS32=
61
   LIB_WS32=
74
   LIB_GDI32=
62
   LIB_GDI32=
75
@@ -220,6 +257,8 @@ else
63
@@ -132,6 +161,8 @@ else
76
   LIB_MAC=
64
   LIB_MAC=
77
   MSVC_CFLAGS=
65
   MSVC_CFLAGS=
78
   LIB_CRYPT32=
66
   LIB_CRYPT32=
Lines 81-87 Link Here
81
 fi
69
 fi
82
 
70
 
83
 AC_SUBST(LIB_WS32)
71
 AC_SUBST(LIB_WS32)
84
@@ -232,6 +272,8 @@ AC_SUBST(LIB_IPHLPAPI)
72
@@ -144,6 +175,8 @@ AC_SUBST(LIB_IPHLPAPI)
85
 AC_SUBST(LIB_SHELL32)
73
 AC_SUBST(LIB_SHELL32)
86
 AC_SUBST(LIB_PSAPI)
74
 AC_SUBST(LIB_PSAPI)
87
 AC_SUBST(LIB_MAC)
75
 AC_SUBST(LIB_MAC)
(-)net-mgmt/seafile-client/files/patch-controller_seafile-controller.c (-104 lines)
Lines 1-104 Link Here
1
--- controller/seafile-controller.c.orig	2015-09-21 03:42:11 UTC
2
+++ controller/seafile-controller.c
3
@@ -17,6 +17,19 @@
4
 #include "log.h"
5
 #include "seafile-controller.h"
6
 
7
+#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__)
8
+#include <sys/sysctl.h>
9
+#include <sys/types.h>
10
+#include <sys/user.h>
11
+#include <limits.h>
12
+
13
+#ifndef WITH_PROC_FS
14
+#define WITH_PROC_FS g_file_test("/proc/curproc", G_FILE_TEST_EXISTS)
15
+#endif
16
+
17
+static char *command_name = NULL;
18
+#endif
19
+
20
 #define CHECK_PROCESS_INTERVAL 10        /* every 10 seconds */
21
 
22
 SeafileController *ctl;
23
@@ -247,7 +260,20 @@ static void
24
 init_seafile_path ()
25
 {
26
     GError *error = NULL;
27
+#if defined(__linux__)
28
     char *executable = g_file_read_link ("/proc/self/exe", &error);
29
+#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__)
30
+    /*
31
+     * seafile.sh starts the process using abs path
32
+     */
33
+    char executable[_POSIX_PATH_MAX];
34
+    memset(executable, 0, _POSIX_PATH_MAX);
35
+    char * rc = realpath(command_name, executable);
36
+    if (!rc) {
37
+        seaf_warning ("failed to readpath: %s\n", executable);
38
+        return;
39
+    }
40
+#endif
41
     char *tmp = NULL;
42
     if (error != NULL) {
43
         seaf_warning ("failed to readlink: %s\n", error->message);
44
@@ -261,7 +287,9 @@ init_seafile_path ()
45
 
46
     topdir = g_path_get_dirname (installpath);
47
 
48
+#if defined(__linux__)
49
     g_free (executable);
50
+#endif
51
     g_free (tmp);
52
 }
53
 
54
@@ -402,11 +430,40 @@ need_restart (int which)
55
         return FALSE;
56
     } else {
57
         char buf[256];
58
+	gboolean with_procfs;
59
+#if defined(__linux__)
60
+	with_procfs = g_file_test("/proc/self", G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR);
61
+#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__)
62
+	with_procfs = g_file_test("/proc/curproc", G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR);
63
+#else
64
+	with_procfs = FALSE;
65
+#endif
66
+	if (with_procfs) {
67
         snprintf (buf, sizeof(buf), "/proc/%d", pid);
68
         if (g_file_test (buf, G_FILE_TEST_IS_DIR)) {
69
             return FALSE;
70
         } else {
71
             return TRUE;
72
+	}
73
+
74
+	} else {
75
+#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__)
76
+#ifdef __OpenBSD__
77
+            int min[6] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, pid, sizeof(struct kinfo_proc), 1};
78
+#else
79
+            int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, pid};
80
+#endif
81
+            size_t len = sizeof(struct kinfo_proc);
82
+            struct kinfo_proc kp;
83
+            if (sysctl(mib, sizeof(mib)/sizeof(mib[0]), &kp, &len, NULL, 0) != -1 && 
84
+	        len == sizeof(struct kinfo_proc)) {
85
+                return FALSE;        
86
+            } else {
87
+                return TRUE;
88
+            }
89
+#else
90
+	return FALSE;
91
+#endif
92
         }
93
     }
94
 }
95
@@ -877,6 +934,9 @@ int main (int argc, char **argv)
96
         exit (1);
97
     }
98
 
99
+#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__)
100
+    command_name = argv[0];
101
+#endif
102
     char *config_dir = DEFAULT_CONFIG_DIR;
103
     char *seafile_dir = NULL;
104
     char *logdir = NULL;
(-)net-mgmt/seafile-client/files/patch-daemon_Makefile.am (-8 / +8 lines)
Lines 1-6 Link Here
1
--- daemon/Makefile.am.orig	2016-04-15 23:08:45 UTC
1
--- daemon/Makefile.am.orig	2017-01-15 15:47:19 UTC
2
+++ daemon/Makefile.am
2
+++ daemon/Makefile.am
3
@@ -63,6 +63,10 @@ if LINUX
3
@@ -61,6 +61,10 @@ if LINUX
4
 wt_monitor_src = wt-monitor.c wt-monitor-linux.c wt-monitor-structs.c
4
 wt_monitor_src = wt-monitor.c wt-monitor-linux.c wt-monitor-structs.c
5
 endif
5
 endif
6
 
6
 
Lines 11-22 Link Here
11
 if WIN32
11
 if WIN32
12
 wt_monitor_src = wt-monitor.c wt-monitor-win32.c wt-monitor-structs.c
12
 wt_monitor_src = wt-monitor.c wt-monitor-win32.c wt-monitor-structs.c
13
 endif
13
 endif
14
@@ -126,6 +130,7 @@ seaf_daemon_LDADD = $(top_builddir)/lib/
14
@@ -124,6 +128,7 @@ seaf_daemon_LDADD = $(top_builddir)/lib/
15
 	@GLIB2_LIBS@  @GOBJECT_LIBS@ @SSL_LIBS@ @LIB_RT@ @LIB_UUID@ -lsqlite3 @LIBEVENT_LIBS@ \
15
 	@LIB_RT@ @LIB_UUID@ -lsqlite3 @LIBEVENT_LIBS@ \
16
 	$(top_builddir)/common/cdc/libcdc.la \
16
 	$(top_builddir)/common/cdc/libcdc.la \
17
 	$(top_builddir)/common/index/libindex.la @LIB_WS32@ @LIB_CRYPT32@ \
17
 	$(top_builddir)/common/index/libindex.la @LIB_WS32@ @LIB_CRYPT32@ \
18
-	@SEARPC_LIBS@ @CCNET_LIBS@ @GNOME_KEYRING_LIBS@ @JANSSON_LIBS@ @LIB_MAC@ @ZLIB_LIBS@ @CURL_LIBS@ @BPWRAPPER_LIBS@
18
-	@SEARPC_LIBS@ @CCNET_LIBS@ @JANSSON_LIBS@ @LIB_MAC@ @ZLIB_LIBS@ @CURL_LIBS@ @BPWRAPPER_LIBS@
19
+	@SEARPC_LIBS@ @CCNET_LIBS@ @GNOME_KEYRING_LIBS@ @JANSSON_LIBS@ \
19
+	@SEARPC_LIBS@ @CCNET_LIBS@ @JANSSON_LIBS@ @LIB_MAC@ \
20
+	@LIB_MAC@ @ZLIB_LIBS@ @CURL_LIBS@ @LIB_INOTIFY@ @BPWRAPPER_LIBS@
20
+	@ZLIB_LIBS@ @CURL_LIBS@ @LIB_INOTIFY@ @BPWRAPPER_LIBS@
21
 
21
 
22
 seaf_daemon_LDFLAGS = @STATIC_COMPILE@ @CONSOLE@
22
 seaf_daemon_LDFLAGS = @CONSOLE@
(-)net-mgmt/seafile-client/files/patch-daemon_vc-utils.c (-11 lines)
Lines 1-11 Link Here
1
--- daemon/vc-utils.c.orig	2016-12-03 06:02:47 UTC
2
+++ daemon/vc-utils.c
3
@@ -736,7 +736,7 @@ checkout_entry (struct cache_entry *ce,
4
     gboolean force_conflict = FALSE;
5
 
6
     path_in = g_build_path ("/", o->base, ce->name, NULL);
7
-#ifndef __linux__
8
+#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__DragonFly__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
9
     path = build_case_conflict_free_path (o->base, ce->name,
10
                                           conflict_hash, no_conflict_hash,
11
                                           &case_conflict,
(-)net-mgmt/seafile-client/files/patch-scripts_setup-seafile.sh (-15 lines)
Lines 1-15 Link Here
1
--- scripts/setup-seafile.sh.orig	2015-10-12 04:12:33 UTC
2
+++ scripts/setup-seafile.sh
3
@@ -340,7 +340,11 @@ fi
4
 }
5
 
6
 function copy_user_manuals() {
7
-    src_docs_dir=${INSTALLPATH}/seafile/docs/
8
+    if [ $(uname | grep -e BSD -e DragonFly | wc -l) == "1" ]; then
9
+        src_docs_dir=${INSTALLPATH}/seafile/share/doc/seafile/
10
+    else
11
+    	src_docs_dir=${INSTALLPATH}/seafile/docs/
12
+    fi
13
     library_template_dir=${seafile_data_dir}/library-template
14
     mkdir -p ${library_template_dir}
15
     cp -f ${src_docs_dir}/*.doc ${library_template_dir}
(-)net-mgmt/seafile-client/files/patch-scripts_upgrade_regenerate__secret__key.sh (-10 lines)
Lines 1-10 Link Here
1
--- scripts/upgrade/regenerate_secret_key.sh.orig	2016-01-29 17:25:05 UTC
2
+++ scripts/upgrade/regenerate_secret_key.sh
3
@@ -10,4 +10,6 @@ seahub_settings_py=${TOPDIR}/seahub_sett
4
 
5
 line="SECRET_KEY = \"$(python $seahub_secret_keygen)\""
6
 
7
-sed -i -e "/SECRET_KEY/c\\$line" $seahub_settings_py
8
+sed -i.bak -e "/SECRET_KEY/c\\
9
+$line
10
+" $seahub_settings_py
(-)net-mgmt/seafile-client/files/patch-server_access-file.c (-54 lines)
Lines 1-54 Link Here
1
--- server/access-file.c.orig	2015-11-12 02:40:40 UTC
2
+++ server/access-file.c
3
@@ -221,10 +221,10 @@ write_block_data_cb (struct bufferevent 
4
         bev->cbarg = data->saved_cb_arg;
5
 
6
         /* Resume reading incomming requests. */
7
-        evhtp_request_resume (data->req);
8
-
9
         evhtp_send_reply_end (data->req);
10
 
11
+	evhtp_request_resume (data->req);
12
+
13
         free_sendblock_data (data);
14
         return;
15
     }
16
@@ -306,10 +306,10 @@ next:
17
             bev->cbarg = data->saved_cb_arg;
18
 
19
             /* Resume reading incomming requests. */
20
-            evhtp_request_resume (data->req);
21
-
22
             evhtp_send_reply_end (data->req);
23
 
24
+	    evhtp_request_resume (data->req);
25
+
26
             free_sendfile_data (data);
27
             return;
28
         }
29
@@ -403,10 +403,10 @@ write_dir_data_cb (struct bufferevent *b
30
             bev->cbarg = data->saved_cb_arg;
31
 
32
             /* Resume reading incomming requests. */
33
-            evhtp_request_resume (data->req);
34
-
35
             evhtp_send_reply_end (data->req);
36
 
37
+	    evhtp_request_resume (data->req);
38
+
39
             free_senddir_data (data);
40
             return;
41
         }
42
@@ -710,10 +710,10 @@ finish_file_range_request (struct buffer
43
     bev->cbarg = data->saved_cb_arg;
44
 
45
     /* Resume reading incomming requests. */
46
-    evhtp_request_resume (data->req);
47
-
48
     evhtp_send_reply_end (data->req);
49
 
50
+    evhtp_request_resume (data->req);
51
+
52
     free_send_file_range_data (data);
53
 }
54
 
(-)net-mgmt/seafile-client/pkg-plist (-10 lines)
Lines 1-6 Link Here
1
bin/seaf-cli
1
bin/seaf-cli
2
bin/seaf-daemon
2
bin/seaf-daemon
3
include/seafile/monitor-rpc.h
4
include/seafile/seafile-object.h
3
include/seafile/seafile-object.h
5
include/seafile/seafile-rpc.h
4
include/seafile/seafile-rpc.h
6
include/seafile/seafile.h
5
include/seafile/seafile.h
Lines 14-28 Link Here
14
%%PYTHON_SITELIBDIR%%/seafile/rpcclient.py
13
%%PYTHON_SITELIBDIR%%/seafile/rpcclient.py
15
%%PYTHON_SITELIBDIR%%/seafile/rpcclient.pyc
14
%%PYTHON_SITELIBDIR%%/seafile/rpcclient.pyc
16
%%PYTHON_SITELIBDIR%%/seafile/rpcclient.pyo
15
%%PYTHON_SITELIBDIR%%/seafile/rpcclient.pyo
17
%%PYTHON_SITELIBDIR%%/seaserv/__init__.py
18
%%PYTHON_SITELIBDIR%%/seaserv/__init__.pyc
19
%%PYTHON_SITELIBDIR%%/seaserv/__init__.pyo
20
%%PYTHON_SITELIBDIR%%/seaserv/api.py
21
%%PYTHON_SITELIBDIR%%/seaserv/api.pyc
22
%%PYTHON_SITELIBDIR%%/seaserv/api.pyo
23
%%PYTHON_SITELIBDIR%%/seaserv/service.py
24
%%PYTHON_SITELIBDIR%%/seaserv/service.pyc
25
%%PYTHON_SITELIBDIR%%/seaserv/service.pyo
26
libdata/pkgconfig/libseafile.pc
16
libdata/pkgconfig/libseafile.pc
27
man/man1/seaf-cli.1.gz
17
man/man1/seaf-cli.1.gz
28
man/man1/seaf-daemon.1.gz
18
man/man1/seaf-daemon.1.gz

Return to bug 216348