Index: head/net-mgmt/seafile/Makefile =================================================================== --- head/net-mgmt/seafile/Makefile (revision 380218) +++ head/net-mgmt/seafile/Makefile (revision 380219) @@ -1,99 +1,99 @@ # $FreeBSD$ PORTNAME= seafile -PORTVERSION= 3.1.4 -PORTREVISION= 3 +PORTVERSION= 4.0.6 CATEGORIES= net-mgmt devel MAINTAINER= yan_jingfeng@yahoo.com COMMENT= Framework for writing networked applications LICENSE= GPLv3 BUILD_DEPENDS= valac:${PORTSDIR}/lang/vala LIB_DEPENDS= libsearpc.so:${PORTSDIR}/devel/libsearpc \ libevhtp.so:${PORTSDIR}/www/libevhtp \ libzdb.so:${PORTSDIR}/databases/libzdb \ libcrypto.so:${PORTSDIR}/security/openssl \ libarchive.so.13:${PORTSDIR}/archivers/libarchive \ + libcurl.so:${PORTSDIR}/ftp/curl \ libinotify.so:${PORTSDIR}/devel/libinotify \ libccnet.so:${PORTSDIR}/net-mgmt/ccnet RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}eggtestinfo>0:${PORTSDIR}/devel/py-eggtestinfo \ ${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3 \ ${PYTHON_PKGNAMEPREFIX}pillow>0:${PORTSDIR}/graphics/py-pillow \ bash:${PORTSDIR}/shells/bash USE_GITHUB= yes GH_ACCOUNT= haiwen -GH_TAGNAME= v3.1.4 -GH_COMMIT= ac58109 +GH_TAGNAME= v${PORTVERSION}-server +GH_COMMIT= adf9a87 USES= autoreconf iconv libtool pathfix pkgconfig python:2 shebangfix SHEBANG_FILES= scripts/*.sh scripts/upgrade/*.sh GNU_CONFIGURE= yes USE_OPENSSL= yes USE_LDCONFIG= yes WITH_OPENSSL_PORT= yes PATHFIX_MAKEFILEIN= Makefile.am CONFIGURE_ARGS= --enable-server INSTALL_TARGET= install-strip CPPFLAGS+= -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib HAIWENDIR= www/haiwen SEAFILE_SERVER= ${HAIWENDIR}/seafile-server SEABIN= ${SEAFILE_SERVER}/seafile/bin SEALIB= ${SEAFILE_SERVER}/seafile/lib SEAFILE_USERNAME?= www SEAFILE_GROUPNAME?= ${SEAFILE_USERNAME} PLIST_SUB= SEAFILE_USERNAME=${SEAFILE_USERNAME} \ SEAFILE_GROUPNAME=${SEAFILE_GROUPNAME} \ SEAFILE_SERVER=${SEAFILE_SERVER} \ HAIWENDIR=${HAIWENDIR} MAKE_JOBS_UNSAFE= yes OPTIONS_DEFINE= FUSE RIAK OPTIONS_SUB= yes FUSE_DESC= Use file system in userspace RIAK_DESC= Use distributed noSQL database FUSE_CONFIGURE_ENABLE= fuse FUSE_LIB_DEPENDS= libfuse.so:${PORTSDIR}/sysutils/fusefs-libs RIAK_CONFIGURE_ENABLE= riak RIAK_RUN_DEPENDS= riak:${PORTSDIR}/databases/riak OPTIONS_DEFAULT=FUSE .if defined(DFLYVERSION) OPTIONS_DEFAULT= .endif post-install: @${MKDIR} ${STAGEDIR}${PREFIX}/${SEABIN} ${STAGEDIR}${PREFIX}/${SEALIB}\ ${STAGEDIR}${PREFIX}/${SEAFILE_SERVER}/seafile/share/doc/seafile \ ${STAGEDIR}${PREFIX}/${SEAFILE_SERVER}/upgrade -.for SERVPROG in fileserver seaf-fsck seafserv-gc seaf-fuse seaf-migrate \ - seaf-server seaf-server-init seafile-controller seafserv-tool +.for SERVPROG in seaf-fsck seafserv-gc seaf-fuse seaf-migrate \ + seaf-server seaf-server-init seafile-controller if [ -e "${STAGEDIR}${PREFIX}/bin/${SERVPROG}" ]; then \ ${INSTALL_PROGRAM} ${STAGEDIR}${PREFIX}/bin/${SERVPROG} ${STAGEDIR}${PREFIX}/${SEABIN}; \ ${RM} ${STAGEDIR}${PREFIX}/bin/${SERVPROG}; \ fi .endfor (cd ${STAGEDIR}${PREFIX}/lib && \ ${COPYTREE_SHARE} ${PYTHON_VERSION} ${STAGEDIR}${PREFIX}/${SEALIB}) @${RM} -rf ${STAGEDIR}${PREFIX}/lib/${PYTHON_VERSION} ${INSTALL_SCRIPT} ${WRKSRC}/scripts/*.[ps][yh] ${STAGEDIR}${PREFIX}/${SEAFILE_SERVER} ${INSTALL_SCRIPT} ${WRKSRC}/scripts/upgrade/*.[ps][yh] \ ${STAGEDIR}${PREFIX}/${SEAFILE_SERVER}/upgrade ${INSTALL_DATA} ${WRKSRC}/doc/seafile-tutorial.doc \ ${STAGEDIR}${PREFIX}/${SEAFILE_SERVER}/seafile/share/doc/seafile/ (cd ${WRKSRC}/scripts/upgrade && \ ${COPYTREE_SHARE} sql ${STAGEDIR}${PREFIX}/${SEAFILE_SERVER}/upgrade) .include Index: head/net-mgmt/seafile/distinfo =================================================================== --- head/net-mgmt/seafile/distinfo (revision 380218) +++ head/net-mgmt/seafile/distinfo (revision 380219) @@ -1,2 +1,2 @@ -SHA256 (seafile-3.1.4.tar.gz) = 0ef5d6947ebc74ce5c37390d74b4c1ad7f0da7359f0c8d263963dd04dccf7306 -SIZE (seafile-3.1.4.tar.gz) = 1047684 +SHA256 (seafile-4.0.6.tar.gz) = af1b568905a85ba2da06593f93a70226526ad310320c071bd70356fb77106bc9 +SIZE (seafile-4.0.6.tar.gz) = 1082450 Index: head/net-mgmt/seafile/files/patch-lib_libseafile.pc.in =================================================================== --- head/net-mgmt/seafile/files/patch-lib_libseafile.pc.in (revision 380218) +++ head/net-mgmt/seafile/files/patch-lib_libseafile.pc.in (nonexistent) @@ -1,15 +0,0 @@ ---- lib/libseafile.pc.in.orig 2014-09-03 23:00:38.555065334 -0400 -+++ lib/libseafile.pc.in 2014-09-03 23:01:13.715468049 -0400 -@@ -3,9 +3,9 @@ - libdir=@libdir@ - includedir=@includedir@ - --Name: libccnet -+Name: libseafile - Description: Client library for accessing seafile service. - Version: @VERSION@ - Libs: -L${libdir} -lseafile @SEARPC_LIBS@ - Cflags: -I${includedir} @SEARPC_CFLAGS@ --Requires: gobject-2.0 glib-2.0 -\ No newline at end of file -+Requires: gobject-2.0 glib-2.0 Property changes on: head/net-mgmt/seafile/files/patch-lib_libseafile.pc.in ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/net-mgmt/seafile/files/patch-common_obj-backend-fs.c =================================================================== --- head/net-mgmt/seafile/files/patch-common_obj-backend-fs.c (revision 380218) +++ head/net-mgmt/seafile/files/patch-common_obj-backend-fs.c (revision 380219) @@ -1,20 +1,20 @@ ---- common/obj-backend-fs.c.orig 2014-08-30 10:00:33.108962525 -0400 -+++ common/obj-backend-fs.c 2014-08-30 10:03:02.405000733 -0400 +--- common/obj-backend-fs.c.orig 2015-01-28 02:14:45.000000000 -0500 ++++ common/obj-backend-fs.c 2015-01-28 02:15:58.000000000 -0500 @@ -101,7 +101,7 @@ static int fsync_obj_contents (int fd) { -#ifdef __linux__ +#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) /* Some file systems may not support fsync(). * In this case, just skip the error. */ @@ -153,7 +153,7 @@ static int rename_and_sync (const char *tmp_path, const char *obj_path) { -#ifdef __linux__ +#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) char *parent_dir; int ret = 0; Index: head/net-mgmt/seafile/files/patch-configure.ac =================================================================== --- head/net-mgmt/seafile/files/patch-configure.ac (revision 380218) +++ head/net-mgmt/seafile/files/patch-configure.ac (revision 380219) @@ -1,70 +1,117 @@ ---- configure.ac.orig 2014-08-05 01:28:35.000000000 -0400 -+++ configure.ac 2014-11-22 13:34:26.927863521 -0500 -@@ -88,7 +88,7 @@ - [compile_riak=$enableval],[compile_riak="no"]) +--- configure.ac.orig 2015-01-21 22:45:28.000000000 -0500 ++++ configure.ac 2015-01-28 14:01:20.000000000 -0500 +@@ -50,8 +50,16 @@ + AC_MSG_RESULT(no) + fi - AC_ARG_ENABLE(fuse, AC_HELP_STRING([--enable-fuse], [enable fuse virtual file system]), -- [compile_fuse=$enableval],[compile_fuse="yes"]) -+ [compile_fuse=$enableval],[compile_fuse="no"]) ++AC_MSG_CHECKING(for BSD) ++if test `uname | grep -e BSD -e DragonFly | wc -l` = "1"; then ++ bbsd=true ++ AC_MSG_RESULT(compile in BSD) ++else ++ AC_MSG_RESULT(no) ++fi ++ + AC_MSG_CHECKING(for Linux) +-if test "$bmac" != "true" -a "$bwin32" != "true"; then ++if test "$bmac" != "true" -a "$bwin32" != "true" -a "$bbsd" != "true"; then + blinux=true + AC_MSG_RESULT(compile in linux) + else +@@ -93,6 +101,11 @@ + [compile_fuse=$enableval],[compile_fuse="yes"]) fi ++if test "$bbsd" = true; then ++ AC_ARG_ENABLE(fuse, AC_HELP_STRING([--enable-fuse], [enable fuse virtual file system]), ++ [compile_fuse=$enableval],[compile_fuse="no"]) ++fi ++ AC_ARG_ENABLE(client, AC_HELP_STRING([--enable-client], [enable client]), -@@ -199,25 +199,28 @@ + [compile_client=$enableval],[compile_client="yes"]) + +@@ -148,6 +161,7 @@ + + AM_CONDITIONAL([WIN32], [test "$bwin32" = "true"]) + AM_CONDITIONAL([MACOS], [test "$bmac" = "true"]) ++AM_CONDITIONAL([BSD], [test "$bbsd" = "true"]) + AM_CONDITIONAL([LINUX], [test "$blinux" = "true"]) + + +@@ -192,6 +206,9 @@ + LIB_PSAPI=-lpsapi + LIB_MAC= + MSVC_CFLAGS="-D__MSVCRT__ -D__MSVCRT_VERSION__=0x0601" ++ ZLIB_LIBS= ++ LIB_INOTIFY= ++ LIB_KVM= + elif test "$bmac" = true ; then + LIB_WS32= LIB_GDI32= - LIB_RT= - LIB_INTL= -- LIB_RESOLV=-lresolv -+ LIB_RESOLV= - LIB_UUID=-luuid - LIB_IPHLPAPI= - LIB_SHELL32= +@@ -204,6 +221,24 @@ LIB_PSAPI= MSVC_CFLAGS= LIB_MAC="-framework CoreServices" ++ ZLIB_LIBS= ++ LIB_INOTIFY= ++ LIB_KVM= ++elif test "$bbsd" = true ; then ++ LIB_WS32= ++ LIB_GDI32= ++ LIB_RT= ++ LIB_INTL= ++ LIB_RESOLV= ++ LIB_UUID=-luuid ++ LIB_IPHLPAPI= ++ LIB_SHELL32= ++ LIB_PSAPI= ++ LIB_MAC= ++ MSVC_CFLAGS= + ZLIB_LIBS=-lz ++ LIB_INOTIFY=-linotify ++ LIB_KVM=-lkvm else LIB_WS32= LIB_GDI32= - LIB_RT= - LIB_INTL= -- LIB_RESOLV=-lresolv -+ LIB_RESOLV= - LIB_UUID=-luuid - LIB_IPHLPAPI= - LIB_SHELL32= +@@ -216,6 +251,9 @@ LIB_PSAPI= LIB_MAC= MSVC_CFLAGS= -+ ZLIB_LIBS=-lz ++ ZLIB_LIBS=-lz + LIB_INOTIFY=-linotify ++ LIB_KVM= fi AC_SUBST(LIB_WS32) -@@ -230,6 +233,8 @@ +@@ -228,6 +266,9 @@ AC_SUBST(LIB_SHELL32) AC_SUBST(LIB_PSAPI) AC_SUBST(LIB_MAC) +AC_SUBST(ZLIB_LIBS) +AC_SUBST(LIB_INOTIFY) ++AC_SUBST(LIB_KVM) AC_SUBST(MSVC_CFLAGS) -@@ -242,7 +247,6 @@ +@@ -240,7 +281,9 @@ #LIBNAUTILUS_EXTENSION_REQUIRED=2.30.1 CURL_REQUIRED=7.17 - FUSE_REQUIRED=2.8.6 --ZLIB_REQUIRED=1.2.0 + FUSE_REQUIRED=2.7.3 ++if test "$blinux" = true ; then + ZLIB_REQUIRED=1.2.0 ++fi - PKG_CHECK_MODULES(GLIB2, [glib-2.0 >= $GLIB_REQUIRED]) - AC_SUBST(GLIB2_CFLAGS) -@@ -268,10 +272,6 @@ + PKG_CHECK_MODULES(SSL, [openssl]) + AC_SUBST(SSL_CFLAGS) +@@ -270,9 +313,11 @@ AC_SUBST(LIBEVENT_CFLAGS) AC_SUBST(LIBEVENT_LIBS) --PKG_CHECK_MODULES(ZLIB, [zlib >= $ZLIB_REQUIRED]) --AC_SUBST(ZLIB_CFLAGS) --AC_SUBST(ZLIB_LIBS) -- ++if test "$blinux" = true ; then + PKG_CHECK_MODULES(ZLIB, [zlib >= $ZLIB_REQUIRED]) + AC_SUBST(ZLIB_CFLAGS) + AC_SUBST(ZLIB_LIBS) ++fi + if test x${compile_python} = xyes; then AM_PATH_PYTHON([2.6]) - Index: head/net-mgmt/seafile/files/patch-controller_seafile-controller.c =================================================================== --- head/net-mgmt/seafile/files/patch-controller_seafile-controller.c (revision 380218) +++ head/net-mgmt/seafile/files/patch-controller_seafile-controller.c (revision 380219) @@ -1,108 +1,104 @@ ---- controller/seafile-controller.c.orig 2014-08-05 01:28:35.000000000 -0400 -+++ controller/seafile-controller.c 2014-11-22 22:00:58.614945337 -0500 -@@ -18,10 +18,23 @@ +--- controller/seafile-controller.c.orig 2015-01-28 13:03:24.000000000 -0500 ++++ controller/seafile-controller.c 2015-01-28 13:15:05.000000000 -0500 +@@ -17,6 +17,19 @@ #include "log.h" #include "seafile-controller.h" +#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) +#include +#include +#include +#include + +#ifndef WITH_PROC_FS +#define WITH_PROC_FS g_file_test("/proc/curproc", G_FILE_TEST_EXISTS) +#endif + ++static char *command_name = NULL; +#endif + #define CHECK_PROCESS_INTERVAL 10 /* every 10 seconds */ SeafileController *ctl; - -+static char *command_name = NULL; - static char *controller_pidfile = NULL; - - char *bin_dir = NULL; -@@ -273,7 +286,20 @@ +@@ -247,7 +260,20 @@ init_seafile_path () { GError *error = NULL; +#if defined(__linux__) char *executable = g_file_read_link ("/proc/self/exe", &error); +#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) + /* + * seafile.sh starts the process using abs path -+ */ ++ */ + char executable[_POSIX_PATH_MAX]; + memset(executable, 0, _POSIX_PATH_MAX); + char * rc = realpath(command_name, executable); + if (!rc) { + seaf_warning ("failed to readpath: %s\n", executable); -+ return; ++ return; + } +#endif char *tmp = NULL; if (error != NULL) { seaf_warning ("failed to readlink: %s\n", error->message); -@@ -287,7 +313,9 @@ +@@ -261,7 +287,9 @@ topdir = g_path_get_dirname (installpath); +#if defined(__linux__) g_free (executable); +#endif g_free (tmp); } -@@ -427,12 +455,41 @@ +@@ -401,11 +429,40 @@ return FALSE; } else { char buf[256]; + gboolean with_procfs; +#if defined(__linux__) + with_procfs = g_file_test("/proc/self", G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR); +#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) + with_procfs = g_file_test("/proc/curproc", G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR); +#else + with_procfs = FALSE; +#endif + if (with_procfs) { snprintf (buf, sizeof(buf), "/proc/%d", pid); if (g_file_test (buf, G_FILE_TEST_IS_DIR)) { return FALSE; } else { return TRUE; -- } + } + + } else { +#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) +#ifdef __OpenBSD__ + int min[6] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, pid, sizeof(struct kinfo_proc), 1}; +#else + int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, pid}; +#endif + size_t len = sizeof(struct kinfo_proc); + struct kinfo_proc kp; + if (sysctl(mib, sizeof(mib)/sizeof(mib[0]), &kp, &len, NULL, 0) != -1 && + len == sizeof(struct kinfo_proc)) { + return FALSE; + } else { + return TRUE; + } +#else + return FALSE; +#endif -+ } + } } } - -@@ -892,6 +949,7 @@ +@@ -852,6 +909,9 @@ exit (1); } ++#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) + command_name = argv[0]; ++#endif char *config_dir = DEFAULT_CONFIG_DIR; char *seafile_dir = NULL; char *logdir = NULL; Index: head/net-mgmt/seafile/files/patch-daemon_Makefile.am =================================================================== --- head/net-mgmt/seafile/files/patch-daemon_Makefile.am (revision 380218) +++ head/net-mgmt/seafile/files/patch-daemon_Makefile.am (revision 380219) @@ -1,12 +1,23 @@ ---- daemon/Makefile.am.orig 2014-08-05 01:28:35.000000000 -0400 -+++ daemon/Makefile.am 2014-08-30 01:44:16.911202899 -0400 -@@ -125,7 +125,8 @@ - @GLIB2_LIBS@ @GOBJECT_LIBS@ -lssl @LIB_RT@ @LIB_UUID@ -lsqlite3 -levent \ +--- daemon/Makefile.am.orig 2015-01-28 13:48:56.000000000 -0500 ++++ daemon/Makefile.am 2015-01-28 13:55:22.000000000 -0500 +@@ -65,6 +65,10 @@ + wt_monitor_src = wt-monitor.c wt-monitor-linux.c wt-monitor-structs.c + endif + ++if BSD ++wt_monitor_src = wt-monitor.c wt-monitor-linux.c wt-monitor-structs.c ++endif ++ + if WIN32 + wt_monitor_src = wt-monitor.c wt-monitor-win32.c wt-monitor-structs.c + endif +@@ -127,7 +131,8 @@ + @GLIB2_LIBS@ @GOBJECT_LIBS@ @SSL_LIBS@ @LIB_RT@ @LIB_UUID@ -lsqlite3 @LIBEVENT_LIBS@ \ $(top_builddir)/common/cdc/libcdc.la \ $(top_builddir)/common/index/libindex.la ${LIB_WS32} \ -- @SEARPC_LIBS@ @CCNET_LIBS@ @GNOME_KEYRING_LIBS@ @JANSSON_LIBS@ @LIB_MAC@ @ZLIB_LIBS@ -+ @SEARPC_LIBS@ @CCNET_LIBS@ @GNOME_KEYRING_LIBS@ @JANSSON_LIBS@ @LIB_MAC@ \ -+ @ZLIB_LIBS@ @LIB_INOTIFY@ +- @SEARPC_LIBS@ @CCNET_LIBS@ @GNOME_KEYRING_LIBS@ @JANSSON_LIBS@ @LIB_MAC@ @ZLIB_LIBS@ @CURL_LIBS@ ++ @SEARPC_LIBS@ @CCNET_LIBS@ @GNOME_KEYRING_LIBS@ @JANSSON_LIBS@ @LIB_MAC@ @ZLIB_LIBS@ \ ++ @CURL_LIBS@ @LIB_INOTIFY@ seaf_daemon_LDFLAGS = @STATIC_COMPILE@ @CONSOLE@ Index: head/net-mgmt/seafile/files/patch-daemon_repo-mgr.c =================================================================== --- head/net-mgmt/seafile/files/patch-daemon_repo-mgr.c (revision 380218) +++ head/net-mgmt/seafile/files/patch-daemon_repo-mgr.c (revision 380219) @@ -1,50 +1,53 @@ ---- daemon/repo-mgr.c.orig 2014-08-30 02:03:22.367472662 -0400 -+++ daemon/repo-mgr.c 2014-08-30 02:10:42.071207749 -0400 -@@ -1720,12 +1720,12 @@ +--- daemon/repo-mgr.c.orig 2015-01-28 02:18:05.000000000 -0500 ++++ daemon/repo-mgr.c 2015-01-28 02:22:10.000000000 -0500 +@@ -2514,13 +2514,13 @@ gboolean force_conflict = FALSE; gboolean update_mode_only = FALSE; -#ifndef __linux__ +#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) + path = build_checkout_path (worktree, name, strlen(name)); +#else path = build_case_conflict_free_path (worktree, name, conflict_hash, no_conflict_hash, - &case_conflict); + &case_conflict, + FALSE); -#else - path = build_checkout_path (worktree, name, strlen(name)); #endif if (!path) -@@ -1858,12 +1858,12 @@ +@@ -2675,13 +2675,13 @@ char *path; gboolean case_conflict = FALSE; -#ifndef __linux__ +#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) + path = build_checkout_path (worktree, name, strlen(name)); +#else path = build_case_conflict_free_path (worktree, name, conflict_hash, no_conflict_hash, - &case_conflict); + &case_conflict, + FALSE); -#else - path = build_checkout_path (worktree, name, strlen(name)); #endif if (!path) -@@ -2088,12 +2088,12 @@ +@@ -2839,13 +2839,13 @@ + old_path = g_build_filename (worktree, de->name, NULL); - char *new_path; - gboolean case_conflict; + if (seaf_util_exists (old_path)) { -#ifndef __linux__ +#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) -+ new_path = build_checkout_path (worktree, de->new_name, strlen(de->new_name)); ++ new_path = build_checkout_path (worktree, de->new_name, strlen(de->new_name)); +#else - new_path = build_case_conflict_free_path (worktree, de->new_name, - conflict_hash, no_conflict_hash, - &case_conflict); + new_path = build_case_conflict_free_path (worktree, de->new_name, + conflict_hash, no_conflict_hash, + &case_conflict, + TRUE); -#else -- new_path = build_checkout_path (worktree, de->new_name, strlen(de->new_name)); +- new_path = build_checkout_path (worktree, de->new_name, strlen(de->new_name)); #endif - if (g_file_test (old_path, G_FILE_TEST_EXISTS) && + if (seaf_util_rename (old_path, new_path) < 0) { Index: head/net-mgmt/seafile/files/patch-daemon_vc-utils.c =================================================================== --- head/net-mgmt/seafile/files/patch-daemon_vc-utils.c (revision 380218) +++ head/net-mgmt/seafile/files/patch-daemon_vc-utils.c (revision 380219) @@ -1,27 +1,28 @@ ---- daemon/vc-utils.c.orig 2014-06-05 02:25:50.000000000 -0400 -+++ daemon/vc-utils.c 2014-07-27 01:10:00.000000000 -0400 -@@ -489,7 +489,7 @@ +--- daemon/vc-utils.c.orig 2015-01-28 02:24:19.000000000 -0500 ++++ daemon/vc-utils.c 2015-01-28 02:30:05.000000000 -0500 +@@ -664,7 +664,7 @@ #endif /* defined WIN32 || defined __APPLE__ */ -#ifdef __linux__ +#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) - static char * + char * build_checkout_path (const char *worktree, const char *ce_name, int len) -@@ -549,12 +549,12 @@ +@@ -724,13 +724,13 @@ gboolean force_conflict = FALSE; path_in = g_build_path ("/", o->base, ce->name, NULL); -#ifndef __linux__ +#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) + path = build_checkout_path (o->base, ce->name, ce_namelen(ce)); +#else path = build_case_conflict_free_path (o->base, ce->name, conflict_hash, no_conflict_hash, - &case_conflict); + &case_conflict, + FALSE); -#else - path = build_checkout_path (o->base, ce->name, ce_namelen(ce)); #endif g_free (path_in); Index: head/net-mgmt/seafile/files/patch-lib_Makfile.am =================================================================== --- head/net-mgmt/seafile/files/patch-lib_Makfile.am (revision 380218) +++ head/net-mgmt/seafile/files/patch-lib_Makfile.am (revision 380219) @@ -1,21 +1,29 @@ ---- lib/Makefile.am.orig 2014-11-11 10:47:33.631976054 -0500 -+++ lib/Makefile.am 2014-11-11 11:40:14.030311321 -0500 -@@ -55,7 +55,7 @@ +--- lib/Makefile.am.orig 2015-01-28 13:44:26.000000000 -0500 ++++ lib/Makefile.am 2015-01-28 13:48:00.000000000 -0500 +@@ -53,6 +53,7 @@ libseafile_common_la_LDFLAGS = -no-undefined - libseafile_common_la_LIBADD = @GLIB2_LIBS@ @GOBJECT_LIBS@ -lssl -lcrypto @LIB_GDI32@ \ + libseafile_common_la_LIBADD = @GLIB2_LIBS@ @GOBJECT_LIBS@ @SSL_LIBS@ -lcrypto @LIB_GDI32@ \ @LIB_UUID@ @LIB_WS32@ @LIB_PSAPI@ -lsqlite3 \ -- -levent @SEARPC_LIBS@ @LIB_SHELL32@ \ -+ -levent -lkvm @SEARPC_LIBS@ @LIB_SHELL32@ \ ++ @LIB_KVM@ \ + @LIBEVENT_LIBS@ @SEARPC_LIBS@ @LIB_SHELL32@ \ @ZLIB_LIBS@ - searpc_gen = searpc-signature.h searpc-marshal.h -@@ -72,8 +72,4 @@ - rm -f $(top_srcdir)/lib/rpc_table.pyc +@@ -74,7 +75,7 @@ + rm -f ${seafile_object_gen} + @rm -f vala.tmp + @touch vala.tmp +- valac -C --pkg posix $^ ++ valac -C --pkg posix ${seafile_object_define} + @mv -f vala.tmp $@ - install-data-local: --if MACOS -- sed -i '' -e "s|(DESTDIR)|${DESTDIR}|g" $(pcfiles) --else -- ${SED} -i "s|(DESTDIR)|${DESTDIR}|g" $(pcfiles) --endif -+ ${SED} -i '' "s|(DESTDIR)|${PREFIX}|g" $(pcfiles) + ${seafile_object_gen}: vala.stamp +@@ -90,5 +91,9 @@ + if MACOS + sed -i '' -e "s|(DESTDIR)|${DESTDIR}|g" $(pcfiles) + else ++if BSD ++ sed -i '' "s|(DESTDIR)|${PREFIX}|g" $(pcfiles) ++else + ${SED} -i "s|(DESTDIR)|${DESTDIR}|g" $(pcfiles) + endif ++endif Index: head/net-mgmt/seafile/files/patch-lib_net.c =================================================================== --- head/net-mgmt/seafile/files/patch-lib_net.c (revision 380218) +++ head/net-mgmt/seafile/files/patch-lib_net.c (revision 380219) @@ -1,11 +1,14 @@ ---- lib/net.c.orig 2014-09-02 21:09:59.708953392 -0400 -+++ lib/net.c 2014-09-02 21:10:22.959507209 -0400 -@@ -157,7 +157,7 @@ +--- lib/net.c.orig 2015-01-28 00:52:56.000000000 -0500 ++++ lib/net.c 2015-01-28 00:55:31.000000000 -0500 +@@ -157,7 +157,11 @@ snprintf (buf, sizeof(buf), "%d", port); -- if ( (n = getaddrinfo(NULL, buf, &hints, &res) ) != 0) { ++#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) + if ( (n = getaddrinfo("0.0.0.0", buf, &hints, &res) ) != 0) { ++#else + if ( (n = getaddrinfo(NULL, buf, &hints, &res) ) != 0) { ++#endif ccnet_warning ("getaddrinfo fails: %s\n", gai_strerror(n)); return -1; } Index: head/net-mgmt/seafile/files/patch-lib_utils.c =================================================================== --- head/net-mgmt/seafile/files/patch-lib_utils.c (revision 380218) +++ head/net-mgmt/seafile/files/patch-lib_utils.c (revision 380219) @@ -1,195 +1,195 @@ ---- lib/utils.c.orig 2014-08-05 05:28:35 UTC -+++ lib/utils.c -@@ -46,6 +46,15 @@ +--- lib/utils.c.orig 2015-01-28 01:03:42.000000000 -0500 ++++ lib/utils.c 2015-01-28 01:26:32.000000000 -0500 +@@ -56,6 +56,16 @@ #include +#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) ++#include +#include +#include +#include +#include +#include +#include +#endif + extern int inet_pton(int af, const char *src, void *dst); -@@ -1756,14 +1765,19 @@ wchar_from_utf8 (const char *utf8) +@@ -2097,14 +2107,19 @@ #endif /* ifdef WIN32 */ -#ifdef __linux__ /* read the link of /proc/123/exe and compare with `process_name' */ static int find_process_in_dirent(struct dirent *dir, const char *process_name) { char path[512]; /* fisrst construct a path like /proc/123/exe */ -+#ifdef __linux__ ++#if defined(__linux__) if (sprintf (path, "/proc/%s/exe", dir->d_name) < 0) { +#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) + if (sprintf (path, "/proc/%s/file", dir->d_name) < 0) { +#else -+ if (TRUE) { ++ if (1) { +#endif return -1; } -@@ -1787,7 +1801,8 @@ find_process_in_dirent(struct dirent *di +@@ -2128,7 +2143,8 @@ } /* read the /proc fs to determine whether some process is running */ -gboolean process_is_running (const char *process_name) +static gboolean +process_is_running_procfs (const char *process_name) { DIR *proc_dir = opendir("/proc"); if (!proc_dir) { -@@ -1812,7 +1827,8 @@ gboolean process_is_running (const char +@@ -2153,7 +2169,8 @@ return FALSE; } -int count_process(const char *process_name) +static int +count_process_procfs(const char *process_name) { int count = 0; DIR *proc_dir = opendir("/proc"); -@@ -1836,6 +1852,14 @@ int count_process(const char *process_na +@@ -2177,6 +2194,14 @@ return count; } +#ifdef __linux__ -+gboolean process_is_running (const char *process_name) { ++gboolean process_is_running(const char *process_name) { + return process_is_running_procfs(process_name); +} + +int count_process(const char *process_name) { + return count_process_procfs(process_name); +} #endif #ifdef __APPLE__ -@@ -1846,6 +1870,120 @@ gboolean process_is_running (const char +@@ -2187,6 +2212,119 @@ } #endif +#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) +#if defined(__FreeBSD__) +#define PSKIP(kp) ((kp)->ki_pid == mypid || \ + (!kthreads && ((kp)->ki_flag & P_KTHREAD) != 0)) +#define KVM_OPENFILES(exec, coref, buf) \ + kvm_openfiles(exec, coref, NULL, O_RDONLY, buf) +#define KVM_GETPROCS(kd, plist, nproc) \ + kvm_getprocs(kd, KERN_PROC_PROC, 0, &nproc) + +#elif defined(__DragonFly__) +#define PSKIP(kp) ((kp)->kp_pid == mypid || \ + (!kthreads && ((kp)->kp_flags & P_SYSTEM) != 0)) +#define KVM_OPENFILES(exec, coref, buf) \ + kvm_openfiles(exec, coref, NULL, O_RDONLY, buf) +#define KVM_GETPROCS(kd, plist, nproc) \ + kvm_getprocs(kd, KERN_PROC_ALL, 0, &nproc) + +#elif defined(__NetBSD__) +#define PSKIP(kp) ((kp)->kp_pid == mypid || \ + ((kp)->p_flag & P_SYSTEM) != 0) +#define KVM_OPENFILES(exec, coref, buf) \ + kvm_openfiles(exec, coref, NULL, KVM_NO_FILES, buf) +#define KVM_GETPROCS(kd, plist, nproc) \ + kvm_getprocs(kd, KERN_PROC_ALL, 0, sizeof(*plist), &nproc) + +#elif defined(__OpenBSD__) +#define PSKIP(kp) ((kp)->kp_pid == mypid || \ + ((kp)->p_flag & (P_SYSTEM | P_THREAD)) != 0) +#define KVM_OPENFILES(exec, coref, buf) \ + kvm_openfiles(exec, coref, NULL, KVM_NO_FILES, buf) +#define KVM_GETPROCS(kd, plist, nproc) \ + kvm_getprocs(kd, KERN_PROC_ALL, 0, sizeof(*plist), &nproc) + +#else +#define PSKIP(kp) 0 +#define KVM_OPENFILES(exec, coref, buf) 0 +#define KVM_GETPROCS(kd, plist, nproc) 0 +#endif + +#ifndef WITH_PROC_FS +#define WITH_PROC_FS g_file_test("/proc/curproc", G_FILE_TEST_EXISTS) +#endif + +static int +count_running_process_kvm(const char *process_name) { + + + static kvm_t *kd; + static struct kinfo_proc *plist; + static int nproc; + static pid_t mypid; + static int kthreads; + + char buf[_POSIX2_LINE_MAX]; + const char * execf, *coref; + char **pargv; + int i, selected_nproc; + struct kinfo_proc *kp; + + selected_nproc = 0; + execf = NULL; + coref = _PATH_DEVNULL; + + mypid = getpid(); + kd = KVM_OPENFILES(execf, coref, buf); + if (kd == NULL) { + fprintf(stderr, "Error: Cannot open kernel files (%s)", buf); + exit(1); + } + + plist = KVM_GETPROCS(kd, plist, nproc); + if (plist == NULL) { + fprintf(stderr, "Error: Cannot get process list (%s)", kvm_geterr(kd)); + exit(1); + } + + for(i = 0, kp = plist; i < nproc; i++, kp++) { + if (PSKIP(kp)) { + continue; + } + if ((pargv = kvm_getargv(kd, kp, 0)) != NULL) { + if (strstr(pargv[0], process_name) != NULL) { + selected_nproc += 1; + } + } + } + kvm_close(kd); + kvm_close(kd); + + return selected_nproc; +} + +gboolean +process_is_running(const char * process_name) { + if (WITH_PROC_FS) { + return process_is_running_procfs(process_name); + } + if (count_running_process_kvm(process_name) > 0) { + return TRUE; + } else { + return FALSE; + } +} + +int +count_process(const char * process_name) { + if (WITH_PROC_FS) { + return count_process_procfs(process_name); + } + return count_running_process_kvm(process_name); +} +#endif -+ + char* ccnet_object_type_from_id (const char *object_id) { Index: head/net-mgmt/seafile/files/patch-lib_utils.h =================================================================== --- head/net-mgmt/seafile/files/patch-lib_utils.h (revision 380218) +++ head/net-mgmt/seafile/files/patch-lib_utils.h (revision 380219) @@ -1,23 +1,23 @@ ---- lib/utils.h.orig 2014-08-05 01:28:35.000000000 -0400 -+++ lib/utils.h 2014-11-11 11:30:51.843637061 -0500 +--- lib/utils.h.orig 2015-01-28 00:57:13.000000000 -0500 ++++ lib/utils.h 2015-01-28 01:01:59.000000000 -0500 @@ -3,6 +3,9 @@ #ifndef CCNET_UTILS_H #define CCNET_UTILS_H +#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) +#include +#endif #include #include #include @@ -13,7 +16,9 @@ #include #include -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) -+#if defined(__FreeBSD__) || defined(__DragonFly__) ++#if defined(__FreeBSD__) || defined(__DragonFly__) +#include -+#elif (__NetBSD__) || defined(__OpenBSD__) ++#elif defined(__NetBSD__) || defined(__OpenBSD__) #include #else #include Index: head/net-mgmt/seafile/files/patch-scripts_setup-seafile.sh =================================================================== --- head/net-mgmt/seafile/files/patch-scripts_setup-seafile.sh (revision 380218) +++ head/net-mgmt/seafile/files/patch-scripts_setup-seafile.sh (revision 380219) @@ -1,11 +1,15 @@ ---- scripts/setup-seafile.sh.orig 2014-08-28 05:24:34.830623727 -0400 -+++ scripts/setup-seafile.sh 2014-08-28 05:27:43.095059196 -0400 -@@ -341,7 +341,7 @@ +--- scripts/setup-seafile.sh.orig 2015-01-28 00:37:17.000000000 -0500 ++++ scripts/setup-seafile.sh 2015-01-28 00:43:26.000000000 -0500 +@@ -339,7 +339,11 @@ } function copy_user_manuals() { - src_docs_dir=${INSTALLPATH}/seafile/docs/ -+ src_docs_dir=${INSTALLPATH}/seafile/share/doc/seafile/ ++ if [ $(uname | grep -e BSD -e DragonFly | wc -l) == "1" ]; then ++ src_docs_dir=${INSTALLPATH}/seafile/share/doc/seafile/ ++ else ++ src_docs_dir=${INSTALLPATH}/seafile/docs/ ++ fi library_template_dir=${seafile_data_dir}/library-template mkdir -p ${library_template_dir} cp -f ${src_docs_dir}/*.doc ${library_template_dir} Index: head/net-mgmt/seafile/pkg-plist =================================================================== --- head/net-mgmt/seafile/pkg-plist (revision 380218) +++ head/net-mgmt/seafile/pkg-plist (revision 380219) @@ -1,88 +1,84 @@ bin/seaf-cli bin/seaf-daemon -bin/seafile bin/seafile-admin include/seafile/monitor-rpc.h include/seafile/seafile-object.h include/seafile/seafile-rpc.h include/seafile/seafile.h lib/libseafile.a lib/libseafile.so lib/libseafile.so.0 lib/libseafile.so.0.0.0 libdata/pkgconfig/libseafile.pc -man/man1/ccnet.1.gz man/man1/seaf-cli.1.gz man/man1/seaf-daemon.1.gz -man/man1/seafile-applet.1.gz %%SEAFILE_SERVER%%/check_init_admin.py %%SEAFILE_SERVER%%/reset-admin.sh %%SEAFILE_SERVER%%/seaf-cli-wrapper.sh %%SEAFILE_SERVER%%/seaf-fuse.sh %%SEAFILE_SERVER%%/seaf-gc.sh %%SEAFILE_SERVER%%/seafile.sh -%%SEAFILE_SERVER%%/seafile/bin/fileserver %%SEAFILE_SERVER%%/seafile/bin/seaf-fsck %%SEAFILE_SERVER%%/seafile/bin/seaf-fuse %%SEAFILE_SERVER%%/seafile/bin/seaf-migrate %%SEAFILE_SERVER%%/seafile/bin/seaf-server %%SEAFILE_SERVER%%/seafile/bin/seaf-server-init %%SEAFILE_SERVER%%/seafile/bin/seafile-controller %%SEAFILE_SERVER%%/seafile/bin/seafserv-gc -%%SEAFILE_SERVER%%/seafile/bin/seafserv-tool %%SEAFILE_SERVER%%/seafile/%%PYTHON_SITELIBDIR%%/seafile/__init__.py %%SEAFILE_SERVER%%/seafile/%%PYTHON_SITELIBDIR%%/seafile/__init__.pyc %%SEAFILE_SERVER%%/seafile/%%PYTHON_SITELIBDIR%%/seafile/__init__.pyo %%SEAFILE_SERVER%%/seafile/%%PYTHON_SITELIBDIR%%/seafile/rpcclient.py %%SEAFILE_SERVER%%/seafile/%%PYTHON_SITELIBDIR%%/seafile/rpcclient.pyc %%SEAFILE_SERVER%%/seafile/%%PYTHON_SITELIBDIR%%/seafile/rpcclient.pyo %%SEAFILE_SERVER%%/seafile/%%PYTHON_SITELIBDIR%%/seaserv/__init__.py %%SEAFILE_SERVER%%/seafile/%%PYTHON_SITELIBDIR%%/seaserv/__init__.pyc %%SEAFILE_SERVER%%/seafile/%%PYTHON_SITELIBDIR%%/seaserv/__init__.pyo %%SEAFILE_SERVER%%/seafile/%%PYTHON_SITELIBDIR%%/seaserv/api.py %%SEAFILE_SERVER%%/seafile/%%PYTHON_SITELIBDIR%%/seaserv/api.pyc %%SEAFILE_SERVER%%/seafile/%%PYTHON_SITELIBDIR%%/seaserv/api.pyo %%SEAFILE_SERVER%%/seafile/%%PYTHON_SITELIBDIR%%/seaserv/service.py %%SEAFILE_SERVER%%/seafile/%%PYTHON_SITELIBDIR%%/seaserv/service.pyc %%SEAFILE_SERVER%%/seafile/%%PYTHON_SITELIBDIR%%/seaserv/service.pyo %%PORTDOCS%%%%SEAFILE_SERVER%%/seafile/%%DOCSDIR%%/seafile-tutorial.doc %%SEAFILE_SERVER%%/seahub.sh %%SEAFILE_SERVER%%/setup-seafile-mysql.py %%SEAFILE_SERVER%%/setup-seafile-mysql.sh %%SEAFILE_SERVER%%/setup-seafile.sh %%SEAFILE_SERVER%%/sqlite2mysql.py %%SEAFILE_SERVER%%/sqlite2mysql.sh %%SEAFILE_SERVER%%/upgrade/add_collate.sh %%SEAFILE_SERVER%%/upgrade/db_update_1.3_1.4.py %%SEAFILE_SERVER%%/upgrade/db_update_helper.py %%SEAFILE_SERVER%%/upgrade/minor-upgrade.sh %%SEAFILE_SERVER%%/upgrade/sql/1.6.0/mysql/seahub.sql %%SEAFILE_SERVER%%/upgrade/sql/1.6.0/sqlite3/seahub.sql %%SEAFILE_SERVER%%/upgrade/sql/1.7.0/mysql/seafile.sql %%SEAFILE_SERVER%%/upgrade/sql/1.7.0/mysql/seahub.sql %%SEAFILE_SERVER%%/upgrade/sql/1.7.0/sqlite3/seafile.sql %%SEAFILE_SERVER%%/upgrade/sql/1.7.0/sqlite3/seahub.sql %%SEAFILE_SERVER%%/upgrade/sql/1.8.0/mysql/ccnet.sql %%SEAFILE_SERVER%%/upgrade/sql/1.8.0/mysql/seahub.sql %%SEAFILE_SERVER%%/upgrade/sql/1.8.0/sqlite3/seahub.sql %%SEAFILE_SERVER%%/upgrade/sql/2.0.0/mysql/seahub.sql %%SEAFILE_SERVER%%/upgrade/sql/2.0.0/sqlite3/seahub.sql %%SEAFILE_SERVER%%/upgrade/sql/2.1.0/mysql/seahub.sql %%SEAFILE_SERVER%%/upgrade/sql/2.1.0/sqlite3/seahub.sql %%SEAFILE_SERVER%%/upgrade/sql/2.2.0/mysql/ccnet.sql %%SEAFILE_SERVER%%/upgrade/sql/3.0.0/mysql/seahub.sql %%SEAFILE_SERVER%%/upgrade/sql/3.0.0/sqlite3/seahub.sql %%SEAFILE_SERVER%%/upgrade/sql/3.1.0/mysql/seahub.sql %%SEAFILE_SERVER%%/upgrade/sql/3.1.0/sqlite3/seahub.sql %%SEAFILE_SERVER%%/upgrade/upgrade_1.2_1.3.sh %%SEAFILE_SERVER%%/upgrade/upgrade_1.3_1.4.sh %%SEAFILE_SERVER%%/upgrade/upgrade_1.4_1.5.sh %%SEAFILE_SERVER%%/upgrade/upgrade_1.5_1.6.sh %%SEAFILE_SERVER%%/upgrade/upgrade_1.6_1.7.sh %%SEAFILE_SERVER%%/upgrade/upgrade_1.7_1.8.sh %%SEAFILE_SERVER%%/upgrade/upgrade_1.8_2.0.sh %%SEAFILE_SERVER%%/upgrade/upgrade_2.0_2.1.sh %%SEAFILE_SERVER%%/upgrade/upgrade_2.1_2.2.sh %%SEAFILE_SERVER%%/upgrade/upgrade_2.2_3.0.sh %%SEAFILE_SERVER%%/upgrade/upgrade_3.0_3.1.sh +%%SEAFILE_SERVER%%/upgrade/upgrade_3.1_4.0.sh @dir(%%SEAFILE_USERNAME%%,%%SEAFILE_GROUPNAME%%,755) %%HAIWENDIR%%