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

Collapse All | Expand All

(-)UIDs (+1 lines)
Lines 257-262 Link Here
257
domoticz:*:847:847::0:0:domoticz user:/nonexistent:/usr/sbin/nologin
257
domoticz:*:847:847::0:0:domoticz user:/nonexistent:/usr/sbin/nologin
258
graylog:*:848:848::0:0:Graylog user:/nonexistent:/usr/sbin/nologin
258
graylog:*:848:848::0:0:Graylog user:/nonexistent:/usr/sbin/nologin
259
guacamole:*:899:899::0:0:Guacamole user:/nonexistent:/usr/sbin/nologin
259
guacamole:*:899:899::0:0:Guacamole user:/nonexistent:/usr/sbin/nologin
260
seafile:*:900:900::0:0:Seafile user:/nonexistent:/usr/bin/nologin
260
fossy:*:901:901::0:0:FOSSology user:/usr/local/share/fossology:/usr/local/bin/bash
261
fossy:*:901:901::0:0:FOSSology user:/usr/local/share/fossology:/usr/local/bin/bash
261
scanlogd:*:902:902::0:0:scanlogd user:/nonexistent:/usr/sbin/nologin
262
scanlogd:*:902:902::0:0:scanlogd user:/nonexistent:/usr/sbin/nologin
262
_ocserv:*:903:903::0:0:ocserv user:/nonexistent:/usr/sbin/nologin
263
_ocserv:*:903:903::0:0:ocserv user:/nonexistent:/usr/sbin/nologin
(-)GIDs (+1 lines)
Lines 246-251 Link Here
246
domoticz:*:847:
246
domoticz:*:847:
247
graylog:*:848:
247
graylog:*:848:
248
guacamole:*:899:
248
guacamole:*:899:
249
seafile:*:900:
249
fossy:*:901:www
250
fossy:*:901:www
250
scanlogd:*:902:
251
scanlogd:*:902:
251
_ocserv:*:903:
252
_ocserv:*:903:
(-)net-mgmt/seafile/Makefile (-17 / +49 lines)
Lines 1-16 Link Here
1
# $FreeBSD$
1
# $FreeBSD$
2
2
3
PORTNAME=	seafile
3
PORTNAME=	seafile
4
PORTVERSION=	4.0.6
4
PORTVERSION=	5.1.1
5
PORTREVISION=	3
6
DISTVERSIONPREFIX=	v
5
DISTVERSIONPREFIX=	v
7
DISTVERSIONSUFFIX=	-server
6
DISTVERSIONSUFFIX=	-server
8
CATEGORIES=	net-mgmt devel
7
CATEGORIES=	net-mgmt
9
8
10
MAINTAINER=	ultima1252@gmail.com
9
MAINTAINER=	ultima1252@gmail.com
11
COMMENT=	Framework for writing networked applications
10
COMMENT=	Open Source Cloud Storage (Server)
12
11
13
LICENSE=	GPLv3
12
LICENSE=	GPLv3
13
LICENSE_FILE=	${WRKSRC}/LICENSE.txt
14
14
15
BUILD_DEPENDS=	valac:lang/vala
15
BUILD_DEPENDS=	valac:lang/vala
16
LIB_DEPENDS=	libsearpc.so:devel/libsearpc \
16
LIB_DEPENDS=	libsearpc.so:devel/libsearpc \
Lines 19-36 Link Here
19
		libcurl.so:ftp/curl \
19
		libcurl.so:ftp/curl \
20
		libinotify.so:devel/libinotify \
20
		libinotify.so:devel/libinotify \
21
		libccnet.so:net-mgmt/ccnet
21
		libccnet.so:net-mgmt/ccnet
22
RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}eggtestinfo>0:devel/py-eggtestinfo \
22
RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3 \
23
		${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3 \
24
		${PYTHON_PKGNAMEPREFIX}pillow>0:graphics/py-pillow \
25
		bash:shells/bash
23
		bash:shells/bash
26
24
27
USE_GITHUB=	yes
25
USE_GITHUB=	yes
28
GH_ACCOUNT=	haiwen
26
GH_ACCOUNT=	haiwen
29
27
30
USES=		autoreconf iconv libarchive libtool pathfix pkgconfig python:2 \
28
USES=		autoreconf iconv libarchive libtool pathfix pkgconfig python:-2.7 \
31
		shebangfix
29
		shebangfix
32
SHEBANG_FILES=	scripts/*.sh scripts/upgrade/*.sh
30
SHEBANG_FILES=	scripts/*.sh scripts/upgrade/*.sh  tests/*.py tests/basic/*.sh \
31
		tests/sync-auto-test/*.template *.sh scripts/build/*.py \
32
		scripts/*.py *.py scripts/upgrade/*.py app/seaf-cli \
33
		tools/seafile-admin
33
GNU_CONFIGURE=	yes
34
GNU_CONFIGURE=	yes
35
USE_MYSQL=	client
34
USE_OPENSSL=	yes
36
USE_OPENSSL=	yes
35
USE_LDCONFIG=	yes
37
USE_LDCONFIG=	yes
36
CONFIGURE_ENV=	SSL_CFLAGS="${OPENSSLINC}" SSL_LIBS="-L${OPENSSLLIB} -lssl -lcrypto"
38
CONFIGURE_ENV=	SSL_CFLAGS="${OPENSSLINC}" SSL_LIBS="-L${OPENSSLLIB} -lssl -lcrypto"
Lines 47-61 Link Here
47
SEABIN=		${SEAFILE_SERVER}/seafile/bin
49
SEABIN=		${SEAFILE_SERVER}/seafile/bin
48
SEALIB=		${SEAFILE_SERVER}/seafile/lib
50
SEALIB=		${SEAFILE_SERVER}/seafile/lib
49
51
50
SEAFILE_USERNAME?=	www
52
USERS=		seafile
51
SEAFILE_GROUPNAME?=	${SEAFILE_USERNAME}
53
GROUPS=		${USERS}
52
54
53
USE_RC_SUBR=	${PORTNAME}
55
USE_RC_SUBR=	${PORTNAME}
54
PLIST_SUB=	SEAFILE_USERNAME=${SEAFILE_USERNAME} \
56
PLIST_SUB=	USERS=${USERS} \
55
		SEAFILE_GROUPNAME=${SEAFILE_GROUPNAME} \
57
		GROUPS=${GROUPS} \
56
		SEAFILE_SERVER=${SEAFILE_SERVER} \
58
		SEAFILE_SERVER=${SEAFILE_SERVER} \
57
		HAIWENDIR=${HAIWENDIR}
59
		HAIWENDIR=${HAIWENDIR}
58
60
61
SUB_FILES=	pkg-message
62
63
SUB_LIST+=	USERS=${USERS} \
64
		GROUPS=${GROUPS} \
65
		SEAFILE_SERVER=${SEAFILE_SERVER} \
66
		HAIWENDIR=${HAIWENDIR}
67
59
MAKE_JOBS_UNSAFE=	yes
68
MAKE_JOBS_UNSAFE=	yes
60
69
61
OPTIONS_DEFINE=		FUSE RIAK
70
OPTIONS_DEFINE=		FUSE RIAK
Lines 70-94 Link Here
70
RIAK_CONFIGURE_ENABLE=	riak
79
RIAK_CONFIGURE_ENABLE=	riak
71
RIAK_RUN_DEPENDS=	riak:databases/riak
80
RIAK_RUN_DEPENDS=	riak:databases/riak
72
81
73
OPTIONS_DEFAULT=FUSE
82
OPTIONS_DEFAULT=	FUSE
74
.if defined(DFLYVERSION)
83
.if defined(DFLYVERSION)
75
OPTIONS_DEFAULT=
84
OPTIONS_DEFAULT=
76
.endif
85
.endif
77
86
87
.include <bsd.port.options.mk>
88
89
post-patch:
90
# Fix P_KTHREAD r295435
91
.if ${OSVERSION} >= 1100097
92
	${REINPLACE_CMD} 's/P_KTHREAD/P_KPROC/' ${WRKSRC}/lib/utils.c
93
.endif
94
	${REINPLACE_CMD} 's/python/${PYTHON_VERSION}/' \
95
		${WRKSRC}/scripts/upgrade/regenerate_secret_key.sh
96
	${REINPLACE_CMD} -e 's|^INSTALL.*|INSTALLPATH="${PREFIX}/${SEAFILE_SERVER}/seafile"|' \
97
			${WRKSRC}/scripts/seaf-cli-wrapper.sh
98
	${REINPLACE_CMD} 's/<evhtp.h>/<evhtp\/evhtp.h>/' ${WRKSRC}/server/upload-file.c \
99
			${WRKSRC}/server/access-file.c ${WRKSRC}/server/http-server.c
78
post-install:
100
post-install:
79
	@${MKDIR} ${STAGEDIR}${PREFIX}/${SEABIN} ${STAGEDIR}${PREFIX}/${SEALIB}\
101
	@${MKDIR} ${STAGEDIR}${PREFIX}/${SEABIN} ${STAGEDIR}${PREFIX}/${SEALIB} \
80
		${STAGEDIR}${PREFIX}/${SEAFILE_SERVER}/seafile/share/doc/seafile \
102
		${STAGEDIR}${PREFIX}/${SEAFILE_SERVER}/seafile/share/doc/seafile \
81
		${STAGEDIR}${PREFIX}/${SEAFILE_SERVER}/upgrade
103
		${STAGEDIR}${PREFIX}/${SEAFILE_SERVER}/upgrade
82
.for SERVPROG in seaf-fsck seafserv-gc seaf-fuse seaf-migrate \
104
.for SERVPROG in seaf-fsck seafserv-gc seaf-fuse seaf-migrate \
83
	seaf-server seaf-server-init seafile-controller
105
		seaf-server seaf-server-init seafile-controller
84
	if [ -e "${STAGEDIR}${PREFIX}/bin/${SERVPROG}" ]; then \
106
	if [ -e "${STAGEDIR}${PREFIX}/bin/${SERVPROG}" ]; then \
85
		${INSTALL_PROGRAM} ${STAGEDIR}${PREFIX}/bin/${SERVPROG} ${STAGEDIR}${PREFIX}/${SEABIN}; \
107
		${INSTALL_PROGRAM} ${STAGEDIR}${PREFIX}/bin/${SERVPROG} ${STAGEDIR}${PREFIX}/${SEABIN}; \
86
		${RM} ${STAGEDIR}${PREFIX}/bin/${SERVPROG}; \
108
		${RM} ${STAGEDIR}${PREFIX}/bin/${SERVPROG}; \
87
	fi
109
	fi
88
.endfor
110
.endfor
111
.for SERVPROG in seafile-controller seaf-server
112
	${LN} -s ${PREFIX}/${SEABIN}/${SERVPROG} ${STAGEDIR}${PREFIX}/bin/
113
.endfor
114
115
	${INSTALL_SCRIPT} ${STAGEDIR}${PREFIX}/bin/seaf-cli ${STAGEDIR}${PREFIX}/${SEABIN}/seaf-cli.py
116
	${INSTALL_SCRIPT} ${WRKSRC}/scripts/seaf-cli-wrapper.sh ${STAGEDIR}${PREFIX}/bin/seaf-cli
89
	(cd ${STAGEDIR}${PREFIX}/lib && \
117
	(cd ${STAGEDIR}${PREFIX}/lib && \
90
		${COPYTREE_SHARE} ${PYTHON_VERSION} ${STAGEDIR}${PREFIX}/${SEALIB})
118
		${COPYTREE_SHARE} ${PYTHON_VERSION} ${STAGEDIR}${PREFIX}/${SEALIB})
91
	@${RM} -rf ${STAGEDIR}${PREFIX}/lib/${PYTHON_VERSION}
119
	@${RM} -rf ${STAGEDIR}${PREFIX}/lib/${PYTHON_VERSION} \
120
		${WRKSRC}/scripts/seaf-cli-wrapper.sh \
121
		${WRKSRC}/scripts/sqlite2mysql.[ps][yh] \
122
		${WRKSRC}/scripts/setup-seafile.sh \
123
		${STAGEDIR}${PREFIX}/bin/seafile-admin
92
	${INSTALL_SCRIPT} ${WRKSRC}/scripts/*.[ps][yh] ${STAGEDIR}${PREFIX}/${SEAFILE_SERVER}
124
	${INSTALL_SCRIPT} ${WRKSRC}/scripts/*.[ps][yh] ${STAGEDIR}${PREFIX}/${SEAFILE_SERVER}
93
	${INSTALL_SCRIPT} ${WRKSRC}/scripts/upgrade/*.[ps][yh] \
125
	${INSTALL_SCRIPT} ${WRKSRC}/scripts/upgrade/*.[ps][yh] \
94
		${STAGEDIR}${PREFIX}/${SEAFILE_SERVER}/upgrade
126
		${STAGEDIR}${PREFIX}/${SEAFILE_SERVER}/upgrade
(-)net-mgmt/seafile/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (haiwen-seafile-v4.0.6-server_GH0.tar.gz) = 3f9aacc53c67aa165c66a4546a6f8c7ad3a002f741578a538b0c0965a73317bf
1
SHA256 (haiwen-seafile-v5.1.1-server_GH0.tar.gz) = 60b5bf6cfc3f65359eada827733eb4c4720535db3c6dc1a37be1c3470f7c7030
2
SIZE (haiwen-seafile-v4.0.6-server_GH0.tar.gz) = 1082453
2
SIZE (haiwen-seafile-v5.1.1-server_GH0.tar.gz) = 1137616
(-)net-mgmt/seafile/files/patch-common_obj-backend-fs.c (-4 / +4 lines)
Lines 1-6 Link Here
1
--- common/obj-backend-fs.c.orig	2015-01-28 02:14:45.000000000 -0500
1
--- common/obj-backend-fs.c.orig	2015-09-21 03:42:11 UTC
2
+++ common/obj-backend-fs.c	2015-01-28 02:15:58.000000000 -0500
2
+++ common/obj-backend-fs.c
3
@@ -101,7 +101,7 @@
3
@@ -101,7 +101,7 @@ obj_backend_fs_read (ObjBackend *bend,
4
 static int
4
 static int
5
 fsync_obj_contents (int fd)
5
 fsync_obj_contents (int fd)
6
 {
6
 {
Lines 9-15 Link Here
9
     /* Some file systems may not support fsync().
9
     /* Some file systems may not support fsync().
10
      * In this case, just skip the error.
10
      * In this case, just skip the error.
11
      */
11
      */
12
@@ -153,7 +153,7 @@
12
@@ -153,7 +153,7 @@ fsync_obj_contents (int fd)
13
 static int
13
 static int
14
 rename_and_sync (const char *tmp_path, const char *obj_path)
14
 rename_and_sync (const char *tmp_path, const char *obj_path)
15
 {
15
 {
(-)net-mgmt/seafile/files/patch-configure.ac (-16 / +17 lines)
Lines 1-6 Link Here
1
--- configure.ac.orig	2015-01-21 22:45:28.000000000 -0500
1
--- configure.ac.orig	2015-09-21 03:42:11 UTC
2
+++ configure.ac	2015-01-28 14:01:20.000000000 -0500
2
+++ configure.ac
3
@@ -50,8 +50,16 @@
3
@@ -50,8 +50,16 @@ else
4
   AC_MSG_RESULT(no)
4
   AC_MSG_RESULT(no)
5
 fi
5
 fi
6
 
6
 
Lines 18-24 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 @@
21
@@ -93,6 +101,11 @@ if test "$bwin32" != true; then
22
       [compile_fuse=$enableval],[compile_fuse="yes"])
22
       [compile_fuse=$enableval],[compile_fuse="yes"])
23
 fi
23
 fi
24
 
24
 
Lines 30-36 Link Here
30
 AC_ARG_ENABLE(client, AC_HELP_STRING([--enable-client], [enable client]),
30
 AC_ARG_ENABLE(client, AC_HELP_STRING([--enable-client], [enable client]),
31
    [compile_client=$enableval],[compile_client="yes"])
31
    [compile_client=$enableval],[compile_client="yes"])
32
 
32
 
33
@@ -148,6 +161,7 @@
33
@@ -148,6 +161,7 @@ AM_CONDITIONAL([COMPILE_FUSE], [test "${
34
 
34
 
35
 AM_CONDITIONAL([WIN32], [test "$bwin32" = "true"])
35
 AM_CONDITIONAL([WIN32], [test "$bwin32" = "true"])
36
 AM_CONDITIONAL([MACOS], [test "$bmac" = "true"])
36
 AM_CONDITIONAL([MACOS], [test "$bmac" = "true"])
Lines 38-47 Link Here
38
 AM_CONDITIONAL([LINUX], [test "$blinux" = "true"])
38
 AM_CONDITIONAL([LINUX], [test "$blinux" = "true"])
39
 
39
 
40
 
40
 
41
@@ -192,6 +206,9 @@
41
@@ -193,6 +207,9 @@ if test "$bwin32" = true; then
42
   LIB_PSAPI=-lpsapi
43
   LIB_MAC=
42
   LIB_MAC=
44
   MSVC_CFLAGS="-D__MSVCRT__ -D__MSVCRT_VERSION__=0x0601"
43
   MSVC_CFLAGS="-D__MSVCRT__ -D__MSVCRT_VERSION__=0x0601"
44
   LIB_CRYPT32=-lcrypt32
45
+  ZLIB_LIBS=
45
+  ZLIB_LIBS=
46
+  LIB_INOTIFY=
46
+  LIB_INOTIFY=
47
+  LIB_KVM=
47
+  LIB_KVM=
Lines 48-57 Link Here
48
 elif test "$bmac" = true ; then
48
 elif test "$bmac" = true ; then
49
   LIB_WS32=
49
   LIB_WS32=
50
   LIB_GDI32=
50
   LIB_GDI32=
51
@@ -204,6 +221,24 @@
51
@@ -206,6 +223,25 @@ elif test "$bmac" = true ; then
52
   LIB_PSAPI=
53
   MSVC_CFLAGS=
52
   MSVC_CFLAGS=
54
   LIB_MAC="-framework CoreServices"
53
   LIB_MAC="-framework CoreServices"
54
   LIB_CRYPT32=
55
+  ZLIB_LIBS=
55
+  ZLIB_LIBS=
56
+  LIB_INOTIFY=
56
+  LIB_INOTIFY=
57
+  LIB_KVM=
57
+  LIB_KVM=
Lines 59-65 Link Here
59
+  LIB_WS32=
59
+  LIB_WS32=
60
+  LIB_GDI32=
60
+  LIB_GDI32=
61
+  LIB_RT=
61
+  LIB_RT=
62
+  LIB_INTL=
62
+  LIB_INTL=                                                                        
63
+  LIB_RESOLV=
63
+  LIB_RESOLV=
64
+  LIB_UUID=-luuid
64
+  LIB_UUID=-luuid
65
+  LIB_IPHLPAPI=
65
+  LIB_IPHLPAPI=
Lines 67-72 Link Here
67
+  LIB_PSAPI=
67
+  LIB_PSAPI=
68
+  LIB_MAC=
68
+  LIB_MAC=
69
+  MSVC_CFLAGS=
69
+  MSVC_CFLAGS=
70
+  LIB_CRYPT32=
70
+  ZLIB_LIBS=-lz
71
+  ZLIB_LIBS=-lz
71
+  LIB_INOTIFY=-linotify
72
+  LIB_INOTIFY=-linotify
72
+  LIB_KVM=-lkvm
73
+  LIB_KVM=-lkvm
Lines 73-82 Link Here
73
 else
74
 else
74
   LIB_WS32=
75
   LIB_WS32=
75
   LIB_GDI32=
76
   LIB_GDI32=
76
@@ -216,6 +251,9 @@
77
@@ -219,6 +255,9 @@ else
77
   LIB_PSAPI=
78
   LIB_MAC=
78
   LIB_MAC=
79
   MSVC_CFLAGS=
79
   MSVC_CFLAGS=
80
   LIB_CRYPT32=
80
+  ZLIB_LIBS=-lz
81
+  ZLIB_LIBS=-lz
81
+  LIB_INOTIFY=-linotify
82
+  LIB_INOTIFY=-linotify
82
+  LIB_KVM=
83
+  LIB_KVM=
Lines 83-89 Link Here
83
 fi
84
 fi
84
 
85
 
85
 AC_SUBST(LIB_WS32)
86
 AC_SUBST(LIB_WS32)
86
@@ -228,6 +266,9 @@
87
@@ -231,6 +270,9 @@ AC_SUBST(LIB_IPHLPAPI)
87
 AC_SUBST(LIB_SHELL32)
88
 AC_SUBST(LIB_SHELL32)
88
 AC_SUBST(LIB_PSAPI)
89
 AC_SUBST(LIB_PSAPI)
89
 AC_SUBST(LIB_MAC)
90
 AC_SUBST(LIB_MAC)
Lines 91-99 Link Here
91
+AC_SUBST(LIB_INOTIFY)
92
+AC_SUBST(LIB_INOTIFY)
92
+AC_SUBST(LIB_KVM)
93
+AC_SUBST(LIB_KVM)
93
 AC_SUBST(MSVC_CFLAGS)
94
 AC_SUBST(MSVC_CFLAGS)
95
 AC_SUBST(LIB_CRYPT32)
94
 
96
 
95
 
97
@@ -244,7 +286,9 @@ ZDB_REQUIRED=2.10
96
@@ -240,7 +281,9 @@
97
 #LIBNAUTILUS_EXTENSION_REQUIRED=2.30.1
98
 #LIBNAUTILUS_EXTENSION_REQUIRED=2.30.1
98
 CURL_REQUIRED=7.17
99
 CURL_REQUIRED=7.17
99
 FUSE_REQUIRED=2.7.3
100
 FUSE_REQUIRED=2.7.3
Lines 103-109 Link Here
103
 
104
 
104
 PKG_CHECK_MODULES(SSL, [openssl])
105
 PKG_CHECK_MODULES(SSL, [openssl])
105
 AC_SUBST(SSL_CFLAGS)
106
 AC_SUBST(SSL_CFLAGS)
106
@@ -270,9 +313,11 @@
107
@@ -274,9 +318,11 @@ PKG_CHECK_MODULES(LIBEVENT, [libevent >=
107
 AC_SUBST(LIBEVENT_CFLAGS)
108
 AC_SUBST(LIBEVENT_CFLAGS)
108
 AC_SUBST(LIBEVENT_LIBS)
109
 AC_SUBST(LIBEVENT_LIBS)
109
 
110
 
(-)net-mgmt/seafile/files/patch-controller_seafile-controller.c (-6 / +6 lines)
Lines 1-5 Link Here
1
--- controller/seafile-controller.c.orig	2015-01-28 13:03:24.000000000 -0500
1
--- controller/seafile-controller.c.orig	2015-09-21 03:42:11 UTC
2
+++ controller/seafile-controller.c	2015-01-28 13:15:05.000000000 -0500
2
+++ controller/seafile-controller.c
3
@@ -17,6 +17,19 @@
3
@@ -17,6 +17,19 @@
4
 #include "log.h"
4
 #include "log.h"
5
 #include "seafile-controller.h"
5
 #include "seafile-controller.h"
Lines 20-26 Link Here
20
 #define CHECK_PROCESS_INTERVAL 10        /* every 10 seconds */
20
 #define CHECK_PROCESS_INTERVAL 10        /* every 10 seconds */
21
 
21
 
22
 SeafileController *ctl;
22
 SeafileController *ctl;
23
@@ -247,7 +260,20 @@
23
@@ -247,7 +260,20 @@ static void
24
 init_seafile_path ()
24
 init_seafile_path ()
25
 {
25
 {
26
     GError *error = NULL;
26
     GError *error = NULL;
Lines 41-47 Link Here
41
     char *tmp = NULL;
41
     char *tmp = NULL;
42
     if (error != NULL) {
42
     if (error != NULL) {
43
         seaf_warning ("failed to readlink: %s\n", error->message);
43
         seaf_warning ("failed to readlink: %s\n", error->message);
44
@@ -261,7 +287,9 @@
44
@@ -261,7 +287,9 @@ init_seafile_path ()
45
 
45
 
46
     topdir = g_path_get_dirname (installpath);
46
     topdir = g_path_get_dirname (installpath);
47
 
47
 
Lines 51-57 Link Here
51
     g_free (tmp);
51
     g_free (tmp);
52
 }
52
 }
53
 
53
 
54
@@ -401,11 +429,40 @@
54
@@ -402,11 +430,40 @@ need_restart (int which)
55
         return FALSE;
55
         return FALSE;
56
     } else {
56
     } else {
57
         char buf[256];
57
         char buf[256];
Lines 92-98 Link Here
92
         }
92
         }
93
     }
93
     }
94
 }
94
 }
95
@@ -852,6 +909,9 @@
95
@@ -877,6 +934,9 @@ int main (int argc, char **argv)
96
         exit (1);
96
         exit (1);
97
     }
97
     }
98
 
98
 
(-)net-mgmt/seafile/files/patch-daemon_Makefile.am (-9 / +8 lines)
Lines 1-6 Link Here
1
--- daemon/Makefile.am.orig	2015-01-28 13:48:56.000000000 -0500
1
--- daemon/Makefile.am.orig	2016-04-15 23:08:45 UTC
2
+++ daemon/Makefile.am	2015-01-28 13:55:22.000000000 -0500
2
+++ daemon/Makefile.am
3
@@ -65,6 +65,10 @@
3
@@ -63,6 +63,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-23 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
@@ -127,7 +131,8 @@
14
@@ -126,6 +130,7 @@ seaf_daemon_LDADD = $(top_builddir)/lib/
15
 	@GLIB2_LIBS@  @GOBJECT_LIBS@ @SSL_LIBS@ @LIB_RT@ @LIB_UUID@ -lsqlite3 @LIBEVENT_LIBS@ \
15
 	@GLIB2_LIBS@  @GOBJECT_LIBS@ @SSL_LIBS@ @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} \
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@
18
-	@SEARPC_LIBS@ @CCNET_LIBS@ @GNOME_KEYRING_LIBS@ @JANSSON_LIBS@ @LIB_MAC@ @ZLIB_LIBS@ @CURL_LIBS@ @BPWRAPPER_LIBS@
19
+	@SEARPC_LIBS@ @CCNET_LIBS@ @GNOME_KEYRING_LIBS@ @JANSSON_LIBS@ @LIB_MAC@ @ZLIB_LIBS@ \
19
+	@SEARPC_LIBS@ @CCNET_LIBS@ @GNOME_KEYRING_LIBS@ @JANSSON_LIBS@ \
20
+	@CURL_LIBS@ @LIB_INOTIFY@
20
+	@LIB_MAC@ @ZLIB_LIBS@ @CURL_LIBS@ @LIB_INOTIFY@ @BPWRAPPER_LIBS@
21
 
21
 
22
 seaf_daemon_LDFLAGS = @STATIC_COMPILE@ @CONSOLE@
22
 seaf_daemon_LDFLAGS = @STATIC_COMPILE@ @CONSOLE@
23
 
(-)net-mgmt/seafile/files/patch-daemon_http-tx-mgr.c (+25 lines)
Line 0 Link Here
1
--- daemon/http-tx-mgr.c.orig	2015-09-21 03:42:11 UTC
2
+++ daemon/http-tx-mgr.c
3
@@ -58,6 +58,22 @@
4
 #define USER_AGENT_OS "Linux"
5
 #endif
6
 
7
+#ifdef __FreeBSD__
8
+#define USER_AGENT_OS "FreeBSD"
9
+#endif
10
+
11
+#ifdef __DragonFly__
12
+#define USER_AGENT_OS "DragonFly"
13
+#endif
14
+
15
+#ifdef __NetBSD__
16
+#define USER_AGENT_OS "NetBSD"
17
+#endif
18
+
19
+#ifdef __OpenBSD__
20
+#define USER_AGENT_OS "OpenBSD"
21
+#endif
22
+
23
 struct _Connection {
24
     CURL *curl;
25
     gint64 ctime;               /* Used to clean up unused connection. */
(-)net-mgmt/seafile/files/patch-daemon_repo-mgr.c (-32 / +26 lines)
Lines 1-53 Link Here
1
--- daemon/repo-mgr.c.orig	2015-01-28 02:18:05.000000000 -0500
1
--- daemon/repo-mgr.c.orig	2016-04-15 23:11:05 UTC
2
+++ daemon/repo-mgr.c	2015-01-28 02:22:10.000000000 -0500
2
+++ daemon/repo-mgr.c
3
@@ -2514,13 +2514,13 @@
3
@@ -4382,7 +4382,7 @@ checkout_file (const char *repo_id,
4
     gboolean force_conflict = FALSE;
4
     gboolean force_conflict = FALSE;
5
     gboolean update_mode_only = FALSE;
5
     gboolean update_mode_only = FALSE;
6
 
6
 
7
-#ifndef __linux__
7
-#ifndef __linux__
8
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__)
8
+#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__DragonFly__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
9
+    path = build_checkout_path (worktree, name, strlen(name));
10
+#else
11
     path = build_case_conflict_free_path (worktree, name,
9
     path = build_case_conflict_free_path (worktree, name,
12
                                           conflict_hash, no_conflict_hash,
10
                                           conflict_hash, no_conflict_hash,
13
                                           &case_conflict,
11
                                           &case_conflict,
14
                                           FALSE);
12
@@ -4558,7 +4558,7 @@ checkout_empty_dir (const char *worktree
15
-#else
16
-    path = build_checkout_path (worktree, name, strlen(name));
17
 #endif
18
 
19
     if (!path)
20
@@ -2675,13 +2675,13 @@
21
     char *path;
13
     char *path;
22
     gboolean case_conflict = FALSE;
14
     gboolean case_conflict = FALSE;
23
 
15
 
24
-#ifndef __linux__
16
-#ifndef __linux__
25
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__)
17
+#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__DragonFly__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
26
+    path = build_checkout_path (worktree, name, strlen(name));
27
+#else
28
     path = build_case_conflict_free_path (worktree, name,
18
     path = build_case_conflict_free_path (worktree, name,
29
                                           conflict_hash, no_conflict_hash,
19
                                           conflict_hash, no_conflict_hash,
30
                                           &case_conflict,
20
                                           &case_conflict,
31
                                           FALSE);
21
@@ -4972,7 +4972,7 @@ schedule_file_fetch (GThreadPool *tpool,
32
-#else
22
         new_ce = TRUE;
33
-    path = build_checkout_path (worktree, name, strlen(name));
23
     }
34
 #endif
35
 
24
 
36
     if (!path)
25
-#ifndef __linux__
37
@@ -2839,13 +2839,13 @@
26
+#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__DragonFly__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
27
     gboolean case_conflict = FALSE;
28
     path = build_case_conflict_free_path (worktree, de->name,
29
                                           conflict_hash, no_conflict_hash,
30
@@ -5117,7 +5117,7 @@ checkout_file_http (FileTxData *data,
31
      * A.txt to checkout, we can only detect case conflict after one file is checkecd
32
      * out. So we need to generate a new one here.
33
      */
34
-#ifndef __linux__
35
+#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__DragonFly__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
36
     path = build_case_conflict_free_path (worktree, de->name,
37
                                           conflict_hash, no_conflict_hash,
38
                                           &case_conflict,
39
@@ -5487,7 +5487,7 @@ do_rename_in_worktree (DiffEntry *de, co
38
     old_path = g_build_filename (worktree, de->name, NULL);
40
     old_path = g_build_filename (worktree, de->name, NULL);
39
 
41
 
40
     if (seaf_util_exists (old_path)) {
42
     if (seaf_util_exists (old_path)) {
41
-#ifndef __linux__
43
-#ifndef __linux__
42
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__)
44
+#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__DragonFly__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
43
+        new_path = build_checkout_path (worktree, de->new_name, strlen(de->new_name));
45
         gboolean case_conflict;
44
+#else
45
         new_path = build_case_conflict_free_path (worktree, de->new_name,
46
         new_path = build_case_conflict_free_path (worktree, de->new_name,
46
                                                   conflict_hash, no_conflict_hash,
47
                                                   conflict_hash, no_conflict_hash,
47
                                                   &case_conflict,
48
                                                   TRUE);
49
-#else
50
-        new_path = build_checkout_path (worktree, de->new_name, strlen(de->new_name));
51
 #endif
52
 
53
         if (seaf_util_rename (old_path, new_path) < 0) {
(-)net-mgmt/seafile/files/patch-daemon_vc-utils.c (-13 / +5 lines)
Lines 1-6 Link Here
1
--- daemon/vc-utils.c.orig	2015-01-28 02:24:19.000000000 -0500
1
--- daemon/vc-utils.c.orig	2016-04-05 08:38:26 UTC
2
+++ daemon/vc-utils.c	2015-01-28 02:30:05.000000000 -0500
2
+++ daemon/vc-utils.c
3
@@ -664,7 +664,7 @@
3
@@ -664,7 +664,7 @@ error:
4
 
4
 
5
 #endif  /* defined WIN32 || defined __APPLE__ */
5
 #endif  /* defined WIN32 || defined __APPLE__ */
6
 
6
 
Lines 9-28 Link Here
9
 
9
 
10
 char *
10
 char *
11
 build_checkout_path (const char *worktree, const char *ce_name, int len)
11
 build_checkout_path (const char *worktree, const char *ce_name, int len)
12
@@ -724,13 +724,13 @@
12
@@ -724,7 +724,7 @@ checkout_entry (struct cache_entry *ce,
13
     gboolean force_conflict = FALSE;
13
     gboolean force_conflict = FALSE;
14
 
14
 
15
     path_in = g_build_path ("/", o->base, ce->name, NULL);
15
     path_in = g_build_path ("/", o->base, ce->name, NULL);
16
-#ifndef __linux__
16
-#ifndef __linux__
17
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__)
17
+#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__DragonFly__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
18
+    path = build_checkout_path (o->base, ce->name, ce_namelen(ce));
19
+#else
20
     path = build_case_conflict_free_path (o->base, ce->name,
18
     path = build_case_conflict_free_path (o->base, ce->name,
21
                                           conflict_hash, no_conflict_hash,
19
                                           conflict_hash, no_conflict_hash,
22
                                           &case_conflict,
20
                                           &case_conflict,
23
                                           FALSE);
24
-#else
25
-    path = build_checkout_path (o->base, ce->name, ce_namelen(ce));
26
 #endif
27
 
28
     g_free (path_in);
(-)net-mgmt/seafile/files/patch-lib_Makefile.am (+29 lines)
Line 0 Link Here
1
--- lib/Makefile.am.orig	2015-10-12 04:12:33 UTC
2
+++ lib/Makefile.am
3
@@ -53,6 +53,7 @@ libseafile_common_la_SOURCES = ${seafile
4
 libseafile_common_la_LDFLAGS = -no-undefined
5
 libseafile_common_la_LIBADD = @GLIB2_LIBS@  @GOBJECT_LIBS@ @SSL_LIBS@ -lcrypto @LIB_GDI32@ \
6
 				     @LIB_UUID@ @LIB_WS32@ @LIB_PSAPI@ -lsqlite3 \
7
+				@LIB_KVM@ \
8
 					 @LIBEVENT_LIBS@ @SEARPC_LIBS@ @LIB_SHELL32@ \
9
 	@ZLIB_LIBS@
10
 
11
@@ -74,7 +75,7 @@ vala.stamp: ${seafile_object_define}
12
 	rm -f ${seafile_object_gen}
13
 	@rm -f vala.tmp
14
 	@touch vala.tmp
15
-	valac -C --pkg posix $^
16
+	valac -C --pkg posix ${seafile_object_define}
17
 	@mv -f vala.tmp $@
18
 
19
 ${seafile_object_gen}: vala.stamp
20
@@ -90,5 +91,9 @@ install-data-local:
21
 if MACOS
22
 	sed -i '' -e "s|(DESTDIR)|${DESTDIR}|g" $(pcfiles)
23
 else
24
+if BSD
25
+	sed -i '' "s|(DESTDIR)|${PREFIX}|g" $(pcfiles)
26
+else
27
 	${SED} -i "s|(DESTDIR)|${DESTDIR}|g" $(pcfiles)
28
 endif
29
+endif
(-)net-mgmt/seafile/files/patch-lib_Makfile.am (-29 lines)
Lines 1-29 Link Here
1
--- lib/Makefile.am.orig	2015-01-28 13:44:26.000000000 -0500
2
+++ lib/Makefile.am	2015-01-28 13:48:00.000000000 -0500
3
@@ -53,6 +53,7 @@
4
 libseafile_common_la_LDFLAGS = -no-undefined
5
 libseafile_common_la_LIBADD = @GLIB2_LIBS@  @GOBJECT_LIBS@ @SSL_LIBS@ -lcrypto @LIB_GDI32@ \
6
 				     @LIB_UUID@ @LIB_WS32@ @LIB_PSAPI@ -lsqlite3 \
7
+				@LIB_KVM@ \
8
 					 @LIBEVENT_LIBS@ @SEARPC_LIBS@ @LIB_SHELL32@ \
9
 	@ZLIB_LIBS@
10
 
11
@@ -74,7 +75,7 @@
12
 	rm -f ${seafile_object_gen}
13
 	@rm -f vala.tmp
14
 	@touch vala.tmp
15
-	valac -C --pkg posix $^
16
+	valac -C --pkg posix ${seafile_object_define}
17
 	@mv -f vala.tmp $@
18
 
19
 ${seafile_object_gen}: vala.stamp
20
@@ -90,5 +91,9 @@
21
 if MACOS
22
 	sed -i '' -e "s|(DESTDIR)|${DESTDIR}|g" $(pcfiles)
23
 else
24
+if BSD
25
+	sed -i '' "s|(DESTDIR)|${PREFIX}|g" $(pcfiles)
26
+else
27
 	${SED} -i "s|(DESTDIR)|${DESTDIR}|g" $(pcfiles)
28
 endif
29
+endif
(-)net-mgmt/seafile/files/patch-lib_net.c (-3 / +3 lines)
Lines 1-6 Link Here
1
--- lib/net.c.orig	2015-01-28 00:52:56.000000000 -0500
1
--- lib/net.c.orig	2015-09-21 03:42:11 UTC
2
+++ lib/net.c	2015-01-28 00:55:31.000000000 -0500
2
+++ lib/net.c
3
@@ -157,7 +157,11 @@
3
@@ -157,7 +157,11 @@ ccnet_net_bind_tcp (int port, int nonblo
4
 
4
 
5
     snprintf (buf, sizeof(buf), "%d", port);
5
     snprintf (buf, sizeof(buf), "%d", port);
6
 
6
 
(-)net-mgmt/seafile/files/patch-lib_utils.c (-7 / +7 lines)
Lines 1-5 Link Here
1
--- lib/utils.c.orig	2015-01-28 01:03:42.000000000 -0500
1
--- lib/utils.c.orig	2015-09-21 03:42:11 UTC
2
+++ lib/utils.c	2015-01-28 01:26:32.000000000 -0500
2
+++ lib/utils.c
3
@@ -56,6 +56,16 @@
3
@@ -56,6 +56,16 @@
4
 
4
 
5
 #include <zlib.h>
5
 #include <zlib.h>
Lines 17-23 Link Here
17
 extern int inet_pton(int af, const char *src, void *dst);
17
 extern int inet_pton(int af, const char *src, void *dst);
18
 
18
 
19
 
19
 
20
@@ -2097,14 +2107,19 @@
20
@@ -2112,14 +2122,19 @@ wchar_from_utf8 (const char *utf8)
21
 
21
 
22
 #endif  /* ifdef WIN32 */
22
 #endif  /* ifdef WIN32 */
23
 
23
 
Lines 38-44 Link Here
38
         return -1;
38
         return -1;
39
     }
39
     }
40
 
40
 
41
@@ -2128,7 +2143,8 @@
41
@@ -2143,7 +2158,8 @@ find_process_in_dirent(struct dirent *di
42
 }
42
 }
43
 
43
 
44
 /* read the /proc fs to determine whether some process is running */
44
 /* read the /proc fs to determine whether some process is running */
Lines 48-54 Link Here
48
 {
48
 {
49
     DIR *proc_dir = opendir("/proc");
49
     DIR *proc_dir = opendir("/proc");
50
     if (!proc_dir) {
50
     if (!proc_dir) {
51
@@ -2153,7 +2169,8 @@
51
@@ -2168,7 +2184,8 @@ gboolean process_is_running (const char 
52
     return FALSE;
52
     return FALSE;
53
 }
53
 }
54
 
54
 
Lines 58-64 Link Here
58
 {
58
 {
59
     int count = 0;
59
     int count = 0;
60
     DIR *proc_dir = opendir("/proc");
60
     DIR *proc_dir = opendir("/proc");
61
@@ -2177,6 +2194,14 @@
61
@@ -2192,6 +2209,14 @@ int count_process(const char *process_na
62
     return count;
62
     return count;
63
 }
63
 }
64
 
64
 
Lines 73-79 Link Here
73
 #endif
73
 #endif
74
 
74
 
75
 #ifdef __APPLE__
75
 #ifdef __APPLE__
76
@@ -2187,6 +2212,119 @@
76
@@ -2202,6 +2227,119 @@ gboolean process_is_running (const char 
77
 }
77
 }
78
 #endif
78
 #endif
79
 
79
 
(-)net-mgmt/seafile/files/patch-lib_utils.h (-2 / +2 lines)
Lines 1-5 Link Here
1
--- lib/utils.h.orig	2015-01-28 00:57:13.000000000 -0500
1
--- lib/utils.h.orig	2015-09-21 03:42:11 UTC
2
+++ lib/utils.h	2015-01-28 01:01:59.000000000 -0500
2
+++ lib/utils.h
3
@@ -3,6 +3,9 @@
3
@@ -3,6 +3,9 @@
4
 #ifndef CCNET_UTILS_H
4
 #ifndef CCNET_UTILS_H
5
 #define CCNET_UTILS_H
5
 #define CCNET_UTILS_H
(-)net-mgmt/seafile/files/patch-scripts_setup-seafile.sh (-3 / +3 lines)
Lines 1-6 Link Here
1
--- scripts/setup-seafile.sh.orig	2015-01-28 00:37:17.000000000 -0500
1
--- scripts/setup-seafile.sh.orig	2015-10-12 04:12:33 UTC
2
+++ scripts/setup-seafile.sh	2015-01-28 00:43:26.000000000 -0500
2
+++ scripts/setup-seafile.sh
3
@@ -339,7 +339,11 @@
3
@@ -340,7 +340,11 @@ fi
4
 }
4
 }
5
 
5
 
6
 function copy_user_manuals() {
6
 function copy_user_manuals() {
(-)net-mgmt/seafile/files/patch-scripts_upgrade_regenerate__secret__key.sh (+10 lines)
Line 0 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/files/patch-server_access-file.c (+54 lines)
Line 0 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/files/pkg-message.in (+7 lines)
Line 0 Link Here
1
For an existing config, or creating a new one, fix the UID/GID.
2
Do not change %%PREFIX%%/%%SEAFILE_SERVER%% unless your front
3
end is using the seafile UID/GID as well.
4
5
chown -R seafile:seafile %%PREFIX%%/%%HAIWENDIR%%/conf \
6
	%%PREFIX%%/%%HAIWENDIR%%/ccnet %%PREFIX%%/%%HAIWENDIR%%/seafile-data \
7
	%%PREFIX%%/%%HAIWENDIR%%/pids %%PREFIX%%/%%HAIWENDIR%%/logs
(-)net-mgmt/seafile/files/seafile.in (-26 / +114 lines)
Lines 4-10 Link Here
4
#
4
#
5
5
6
# PROVIDE: seafile
6
# PROVIDE: seafile
7
# REQUIRE: LOGIN cleanvar
7
# REQUIRE: LOGIN cleanvar mysql
8
# KEYWORD: shutdown
8
# KEYWORD: shutdown
9
#
9
#
10
10
Lines 13-59 Link Here
13
#
13
#
14
# seafile_enable (bool):	Set to "NO" by default.
14
# seafile_enable (bool):	Set to "NO" by default.
15
#				Set it to "YES" to enable seafile.
15
#				Set it to "YES" to enable seafile.
16
# seafile_user (str):		User to run seafile as
17
#				Default to "%%SEAFILE_USERNAME%%" created by the port
18
# seafile_group (str):		Group to run seafile as
19
#				Default to "%%SEAFILE_GROUPNAME%%" created by the port
16
# seafile_path (str):		Set to "" by default will use the path
20
# seafile_path (str):		Set to "" by default will use the path
17
#				/usr/local/www/haiwen/seafile-server.
21
#				%%PREFIX%%/%%SEAFILE_SERVER%%.
18
#				Set it to a different path. 
22
#				Set it to a different path.
23
# seafile_ccnet (str):		Set to "" by default will use the path
24
#				%%PREFIX%%/%%HAIWENDIR%%/ccnet.
25
#				Set it to a different path.
26
# seafile_conf (str):		Set to "" by default will use the path
27
#				%%PREFIX%%/%%HAIWENDIR%%/conf.
28
#				Set it to a different path.
29
# seafile_datadir (str):	Set to "" by default will use the path
30
#				in file %%PREFIX%%/%%HAIWENDIR%%/ccnet/seafile.ini.
31
#				Set it to a different path.
32
# seafile_logdir (str):		Set to "" by default will use the path
33
#				%%PREFIX%%/%%HAIWENDIR%%/logs
34
#				Set it to a different path.
35
# seafile_loglevel (str):	Set to "info" by default.
36
#				Possible values are debug, warning, info.
19
37
20
. /etc/rc.subr
38
. /etc/rc.subr
21
39
22
name="seafile"
40
name="seafile"
23
rcvar=seafile_enable
41
rcvar="seafile_enable"
24
42
25
load_rc_config $name
43
load_rc_config $name
26
44
27
start_cmd="${name}_start"
45
start_cmd="seafile_start"
28
restart_cmd="${name}_restart"
46
restart_cmd="seafile_restart"
29
stop_cmd="${name}_stop"
47
stop_cmd="seafile_stop"
30
48
31
: ${seafile_path:=%%PREFIX%%/www/haiwen/seafile-server}
49
: ${seafile_enable="NO"}
50
: ${seafile_user:="%%SEAFILE_USERNAME%%"}
51
: ${seafile_group:="%%SEAFILE_GROUPNAME%%"}
52
: ${seafile_path:="%%PREFIX%%/%%SEAFILE_SERVER%%"}
53
: ${seafile_ccnet:="%%PREFIX%%/%%HAIWENDIR%%/ccnet"}
54
: ${seafile_conf:="%%PREFIX%%/%%HAIWENDIR%%/conf"}
55
: ${seafile_datadir:="`cat ${seafile_ccnet}/seafile.ini 2>/dev/null`"}
56
: ${seafile_logdir:="%%PREFIX%%/%%HAIWENDIR%%/logs"}
57
: ${seafile_loglevel:="info"}
32
58
33
command="$seafile_path/seafile.sh"
59
command="%%PREFIX%%/%%SEAFILE_SERVER%%/seafile/bin/seafile-controller"
60
command_args="-c \"${seafile_ccnet}\" -d \"${seafile_datadir}\" -F \"${seafile_conf}\" -L \"${seafile_logdir}\" -g \"${seafile_loglevel}\" -G \"${seafile_loglevel}\""
34
61
35
seafile_start()
62
required_dirs="${seafile_ccnet} ${seafile_conf} ${seafile_datadir}"
36
{
63
required_files="${seafile_ccnet}/seafile.ini"
37
	if checkyesno ${name}_enable; then
64
38
		start_script="${seafile_path}/seafile.sh"	
65
test_config() {
39
		echo "Starting seafile service"
66
	if ! su -m ${seafile_user} -c "${command} -t ${command_args}" ; then
40
		$command start
67
		exit 1;
41
	else
42
		return 0 
43
	fi
68
	fi
44
}
69
}
45
70
46
seafile_stop()
71
check_component_running() {
47
{
72
	name=$1
48
	echo "Stoping seafile service"
73
	cmd=$2
49
	$command stop
74
	if pid=$(pgrep -f "$cmd" 2>/dev/null); then
75
		echo "{$name} is running, pid $pid. You can stop it by: "
76
		echo
77
		echo "        kill $pid"
78
		echo 
79
		echo "Stop it and try again."
80
		echo 
81
		exit 
82
	fi
50
}
83
}
51
84
52
seafile_restart()
85
validate_already_running() {
53
{
86
	if pid=$(pgrep -f "seafile-controller -c ${seafile_ccnet}" 2>/dev/null); then
54
	echo "Restart seafile service"
87
		echo "Seafile controller is already running, pid $pid"
55
	$command restart
88
		echo
89
		exit 1;
90
	fi
91
92
	check_component_running "ccnet-server" "ccnet-server -c ${seafile_ccnet}"
93
	check_component_running "seaf-server" "seaf-server -c ${seafile_ccnet}"
94
	check_component_running "fileserver" "fileserver -c ${seafile_ccnet}"
95
	check_component_running "seafdav" "wsgidav.server.run_server"
56
}
96
}
57
97
58
load_rc_config $name
98
prepare_env() {
99
export PATH=${seafile_path}/seafile/bin:$PATH
100
export LD_LIBRARY_PATH=${seafile_path}/seafile/lib/:${seafile_path}/seafile/lib64:${LD_LIBRARY_PATH}
101
}
102
103
seafile_start() {
104
	check_required_before;
105
	validate_already_running;
106
	test_config;
107
108
	echo "Starting seafile server, please wait ..."
109
110
	su -m "${seafile_user}" -c "mkdir -p $seafile_logdir"
111
	su -m "${seafile_user}" -c "$command $command_args"
112
113
	sleep 3
114
115
	# check if seafile server started successfully
116
	if ! pgrep -f "seafile-controller -c ${seafile_ccnet}" 2>/dev/null 1>&2; then
117
	echo "Failed to start seafile server"
118
	exit 1;
119
	fi
120
121
	echo "Seafile server started"
122
	echo
123
}
124
        
125
seafile_stop() {
126
	if ! pgrep -f "seafile-controller -c ${seafile_ccnet}" 2>/dev/null 1>&2; then
127
		echo "Seafile is not running"
128
	return 1;
129
	fi
130
 
131
	echo "Stopping ${name}."
132
	pkill -SIGTERM -f "seafile-controller -c ${seafile_ccnet}"
133
	pkill -f "ccnet-server -c ${seafile_ccnet}"
134
	pkill -f "seaf-server -c ${seafile_ccnet}"
135
	pkill -f "fileserver -c ${seafile_ccnet}"
136
	pkill -f "soffice.*--invisible --nocrashreport"
137
	pkill -f  "wsgidav.server.run_server"
138
	return 0
139
}
140
141
seafile_restart() {
142
	seafile_stop;
143
	sleep 2
144
	seafile_start;
145
}
146
59
run_rc_command "$1"
147
run_rc_command "$1"
(-)net-mgmt/seafile/pkg-plist (-7 / +33 lines)
Lines 1-6 Link Here
1
bin/seaf-cli
1
bin/seaf-cli
2
bin/seaf-daemon
2
bin/seaf-daemon
3
bin/seafile-admin
3
bin/seafile-controller
4
bin/seaf-server
4
include/seafile/monitor-rpc.h
5
include/seafile/monitor-rpc.h
5
include/seafile/seafile-object.h
6
include/seafile/seafile-object.h
6
include/seafile/seafile-rpc.h
7
include/seafile/seafile-rpc.h
Lines 14-25 Link Here
14
man/man1/seaf-daemon.1.gz
15
man/man1/seaf-daemon.1.gz
15
%%SEAFILE_SERVER%%/check_init_admin.py
16
%%SEAFILE_SERVER%%/check_init_admin.py
16
%%SEAFILE_SERVER%%/reset-admin.sh
17
%%SEAFILE_SERVER%%/reset-admin.sh
17
%%SEAFILE_SERVER%%/seaf-cli-wrapper.sh
18
%%SEAFILE_SERVER%%/seaf-fuse.sh
18
%%SEAFILE_SERVER%%/seaf-fuse.sh
19
%%SEAFILE_SERVER%%/seaf-gc.sh
19
%%SEAFILE_SERVER%%/seaf-gc.sh
20
%%SEAFILE_SERVER%%/seafile.sh
20
%%SEAFILE_SERVER%%/seafile.sh
21
%%SEAFILE_SERVER%%/seafile/bin/seaf-fsck
21
%%SEAFILE_SERVER%%/seafile/bin/seaf-fsck
22
%%SEAFILE_SERVER%%/seafile/bin/seaf-fuse
22
%%FUSE%%%%SEAFILE_SERVER%%/seafile/bin/seaf-fuse
23
%%SEAFILE_SERVER%%/seafile/bin/seaf-cli.py
23
%%SEAFILE_SERVER%%/seafile/bin/seaf-migrate
24
%%SEAFILE_SERVER%%/seafile/bin/seaf-migrate
24
%%SEAFILE_SERVER%%/seafile/bin/seaf-server
25
%%SEAFILE_SERVER%%/seafile/bin/seaf-server
25
%%SEAFILE_SERVER%%/seafile/bin/seaf-server-init
26
%%SEAFILE_SERVER%%/seafile/bin/seaf-server-init
Lines 41-56 Link Here
41
%%SEAFILE_SERVER%%/seafile/%%PYTHON_SITELIBDIR%%/seaserv/service.pyc
42
%%SEAFILE_SERVER%%/seafile/%%PYTHON_SITELIBDIR%%/seaserv/service.pyc
42
%%SEAFILE_SERVER%%/seafile/%%PYTHON_SITELIBDIR%%/seaserv/service.pyo
43
%%SEAFILE_SERVER%%/seafile/%%PYTHON_SITELIBDIR%%/seaserv/service.pyo
43
%%PORTDOCS%%%%SEAFILE_SERVER%%/seafile/%%DOCSDIR%%/seafile-tutorial.doc
44
%%PORTDOCS%%%%SEAFILE_SERVER%%/seafile/%%DOCSDIR%%/seafile-tutorial.doc
45
%%SEAFILE_SERVER%%/breakpad.py
44
%%SEAFILE_SERVER%%/seahub.sh
46
%%SEAFILE_SERVER%%/seahub.sh
45
%%SEAFILE_SERVER%%/setup-seafile-mysql.py
47
%%SEAFILE_SERVER%%/setup-seafile-mysql.py
46
%%SEAFILE_SERVER%%/setup-seafile-mysql.sh
48
%%SEAFILE_SERVER%%/setup-seafile-mysql.sh
47
%%SEAFILE_SERVER%%/setup-seafile.sh
48
%%SEAFILE_SERVER%%/sqlite2mysql.py
49
%%SEAFILE_SERVER%%/sqlite2mysql.sh
50
%%SEAFILE_SERVER%%/upgrade/add_collate.sh
49
%%SEAFILE_SERVER%%/upgrade/add_collate.sh
51
%%SEAFILE_SERVER%%/upgrade/db_update_1.3_1.4.py
50
%%SEAFILE_SERVER%%/upgrade/db_update_1.3_1.4.py
52
%%SEAFILE_SERVER%%/upgrade/db_update_helper.py
51
%%SEAFILE_SERVER%%/upgrade/db_update_helper.py
53
%%SEAFILE_SERVER%%/upgrade/minor-upgrade.sh
52
%%SEAFILE_SERVER%%/upgrade/minor-upgrade.sh
53
%%SEAFILE_SERVER%%/seaf-fsck.sh
54
%%SEAFILE_SERVER%%/upgrade/fix_mysql_user.py
55
%%SEAFILE_SERVER%%/upgrade/regenerate_secret_key.sh
54
%%SEAFILE_SERVER%%/upgrade/sql/1.6.0/mysql/seahub.sql
56
%%SEAFILE_SERVER%%/upgrade/sql/1.6.0/mysql/seahub.sql
55
%%SEAFILE_SERVER%%/upgrade/sql/1.6.0/sqlite3/seahub.sql
57
%%SEAFILE_SERVER%%/upgrade/sql/1.6.0/sqlite3/seahub.sql
56
%%SEAFILE_SERVER%%/upgrade/sql/1.7.0/mysql/seafile.sql
58
%%SEAFILE_SERVER%%/upgrade/sql/1.7.0/mysql/seafile.sql
Lines 69-74 Link Here
69
%%SEAFILE_SERVER%%/upgrade/sql/3.0.0/sqlite3/seahub.sql
71
%%SEAFILE_SERVER%%/upgrade/sql/3.0.0/sqlite3/seahub.sql
70
%%SEAFILE_SERVER%%/upgrade/sql/3.1.0/mysql/seahub.sql
72
%%SEAFILE_SERVER%%/upgrade/sql/3.1.0/mysql/seahub.sql
71
%%SEAFILE_SERVER%%/upgrade/sql/3.1.0/sqlite3/seahub.sql
73
%%SEAFILE_SERVER%%/upgrade/sql/3.1.0/sqlite3/seahub.sql
74
%%SEAFILE_SERVER%%/upgrade/sql/4.1.0/mysql/ccnet.sql
75
%%SEAFILE_SERVER%%/upgrade/sql/4.1.0/mysql/seafile.sql
76
%%SEAFILE_SERVER%%/upgrade/sql/4.1.0/sqlite3/ccnet/groupmgr.sql
77
%%SEAFILE_SERVER%%/upgrade/sql/4.1.0/sqlite3/seafile.sql
78
%%SEAFILE_SERVER%%/upgrade/sql/4.2.0/mysql/seafile.sql
79
%%SEAFILE_SERVER%%/upgrade/sql/4.2.0/mysql/seahub.sql
80
%%SEAFILE_SERVER%%/upgrade/sql/4.2.0/sqlite3/seafile.sql
81
%%SEAFILE_SERVER%%/upgrade/sql/4.2.0/sqlite3/seahub.sql
82
%%SEAFILE_SERVER%%/upgrade/sql/4.3.0/mysql/.gitkeep
83
%%SEAFILE_SERVER%%/upgrade/sql/4.3.0/sqlite3/.gitkeep
84
%%SEAFILE_SERVER%%/upgrade/sql/4.4.0/mysql/.gitkeep
85
%%SEAFILE_SERVER%%/upgrade/sql/4.4.0/sqlite3/.gitkeep
72
%%SEAFILE_SERVER%%/upgrade/upgrade_1.2_1.3.sh
86
%%SEAFILE_SERVER%%/upgrade/upgrade_1.2_1.3.sh
73
%%SEAFILE_SERVER%%/upgrade/upgrade_1.3_1.4.sh
87
%%SEAFILE_SERVER%%/upgrade/upgrade_1.3_1.4.sh
74
%%SEAFILE_SERVER%%/upgrade/upgrade_1.4_1.5.sh
88
%%SEAFILE_SERVER%%/upgrade/upgrade_1.4_1.5.sh
Lines 81-84 Link Here
81
%%SEAFILE_SERVER%%/upgrade/upgrade_2.2_3.0.sh
95
%%SEAFILE_SERVER%%/upgrade/upgrade_2.2_3.0.sh
82
%%SEAFILE_SERVER%%/upgrade/upgrade_3.0_3.1.sh
96
%%SEAFILE_SERVER%%/upgrade/upgrade_3.0_3.1.sh
83
%%SEAFILE_SERVER%%/upgrade/upgrade_3.1_4.0.sh
97
%%SEAFILE_SERVER%%/upgrade/upgrade_3.1_4.0.sh
84
@dir(%%SEAFILE_USERNAME%%,%%SEAFILE_GROUPNAME%%,755) %%HAIWENDIR%%
98
%%SEAFILE_SERVER%%/upgrade/upgrade_4.0_4.1.sh
99
%%SEAFILE_SERVER%%/upgrade/upgrade_4.1_4.2.sh
100
%%SEAFILE_SERVER%%/upgrade/upgrade_4.2_4.3.sh
101
%%SEAFILE_SERVER%%/upgrade/upgrade_4.3_4.4.sh
102
%%SEAFILE_SERVER%%/upgrade/sql/5.0.0/mysql/seahub.sql
103
%%SEAFILE_SERVER%%/upgrade/sql/5.0.0/sqlite3/seahub.sql
104
%%SEAFILE_SERVER%%/upgrade/sql/5.1.0/mysql/seafile.sql
105
%%SEAFILE_SERVER%%/upgrade/sql/5.1.0/mysql/seahub.sql
106
%%SEAFILE_SERVER%%/upgrade/sql/5.1.0/sqlite3/seafile.sql
107
%%SEAFILE_SERVER%%/upgrade/sql/5.1.0/sqlite3/seahub.sql
108
%%SEAFILE_SERVER%%/upgrade/upgrade_5.0_5.1.sh
109
%%SEAFILE_SERVER%%/upgrade/upgrade_4.4_5.0.sh
110
@dir(%%USERS%%,%%GROUPS%%,755) %%HAIWENDIR%%

Return to bug 203933