Index: head/net-mgmt/seafile-server/Makefile =================================================================== --- head/net-mgmt/seafile-server/Makefile (revision 458045) +++ head/net-mgmt/seafile-server/Makefile (revision 458046) @@ -1,115 +1,113 @@ # $FreeBSD$ PORTNAME= seafile-server DISTVERSIONPREFIX= v DISTVERSION= ${SEAFILE_VER} DISTVERSIONSUFFIX= -server +PORTREVISION= 1 CATEGORIES= net-mgmt MAINTAINER= ultima@FreeBSD.org COMMENT= Open Source Cloud Storage (Server) LICENSE= GPLv3 LICENSE_FILE= ${WRKSRC}/LICENSE.txt BUILD_DEPENDS= valac:lang/vala LIB_DEPENDS= libsearpc.so:devel/libsearpc \ libevhtp.so:www/libevhtp \ libzdb.so:databases/libzdb \ libcurl.so:ftp/curl \ libinotify.so:devel/libinotify \ libccnet.so:net-mgmt/ccnet-server \ libevent.so:devel/libevent \ libuuid.so:misc/e2fsprogs-libuuid \ libjansson.so:devel/jansson RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}urllib3>0:net/py-urllib3@${PY_FLAVOR} \ bash:shells/bash CONFLICTS= seafile-[0-9]* USES= autoreconf iconv libarchive libtool localbase mysql \ pathfix pgsql pkgconfig python:-2.7 shebangfix sqlite ssl USE_GITHUB= yes GH_ACCOUNT= haiwen USE_GNOME= glib20 -USE_LDCONFIG= yes USE_RC_SUBR= seafile SHEBANG_FILES= scripts/*.sh scripts/upgrade/*.sh *.sh scripts/build/*.py \ scripts/*.py scripts/upgrade/*.py tools/seafile-admin GNU_CONFIGURE= yes CONFIGURE_ENV= SSL_CFLAGS="${OPENSSLINC}" SSL_LIBS="-L${OPENSSLLIB} -lssl -lcrypto" PATHFIX_MAKEFILEIN= Makefile.am INSTALL_TARGET= install-strip CPPFLAGS+= -I${LOCALBASE}/include/evhtp SUB_FILES= pkg-message MAKE_JOBS_UNSAFE= yes OPTIONS_DEFINE= FUSE NLS OPTIONS_DEFAULT= FUSE OPTIONS_EXCLUDE_DragonFly= FUSE OPTIONS_SUB= yes FUSE_DESC= Use file system in userspace FUSE_CONFIGURE_ENABLE= fuse FUSE_LIB_DEPENDS= libfuse.so:sysutils/fusefs-libs NLS_USES= gettext .include post-patch: # Fix P_KTHREAD r295435 .if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1100097 ${REINPLACE_CMD} 's/P_KTHREAD/P_KPROC/' ${WRKSRC}/lib/utils.c .endif ${REINPLACE_CMD} 's/python/${PYTHON_VERSION}/' \ ${WRKSRC}/scripts/upgrade/regenerate_secret_key.sh ${REINPLACE_CMD} -e 's|^INSTALL.*|INSTALLPATH="${PREFIX}/${SEAFILE_SERVER}/seafile"|' \ ${WRKSRC}/scripts/seaf-cli-wrapper.sh - ${REINPLACE_CMD} 's///' ${WRKSRC}/server/upload-file.c \ - ${WRKSRC}/server/access-file.c ${WRKSRC}/server/http-server.c ${REINPLACE_CMD} -E 's/stat.+\$$/stat -f %Su $$/' ${WRKSRC}/scripts/seafile.sh ${REINPLACE_CMD} 's/%%SEAFILE_USER%%/${USERS:[1]}/ ; s/%%SEAFILE_GROUP%%/${GROUPS:[1]}/' \ ${WRKSRC}/scripts/setup-seafile.sh ${WRKSRC}/scripts/setup-seafile-mysql.py 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 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 .for SERVPROG in seafile-controller seaf-server ${LN} -s "../${SEABIN}/${SERVPROG}" ${STAGEDIR}${PREFIX}/bin/${SERVPROG} .endfor (cd ${STAGEDIR}${PREFIX}/lib && \ ${COPYTREE_SHARE} ${PYTHON_VERSION} ${STAGEDIR}${PREFIX}/${SEALIB}) @${RM} -rf ${STAGEDIR}${PREFIX}/lib/${PYTHON_VERSION} \ ${STAGEDIR}${PREFIX}/bin/seafile-admin ${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) makesum-all: .for PORT in net-mgmt/ccnet-server net-mgmt/seafile-server www/py-seafdav www/py-seafobj www/seahub ${MAKE} -C "${PORTSDIR}/${PORT}" makesum .endfor .include "${.CURDIR}/Makefile.include" .include Index: head/net-mgmt/seafile-server/files/patch-configure.ac =================================================================== --- head/net-mgmt/seafile-server/files/patch-configure.ac (revision 458045) +++ head/net-mgmt/seafile-server/files/patch-configure.ac (revision 458046) @@ -1,92 +1,116 @@ ---- configure.ac.orig 2016-12-27 07:02:58 UTC +--- configure.ac.orig 2017-11-03 09:11:19 UTC +++ configure.ac @@ -51,8 +51,16 @@ else AC_MSG_RESULT(no) fi +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 @@ -78,6 +86,11 @@ if test "$bwin32" != true; then [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(python, AC_HELP_STRING([--enable-python],[build seafile python binding]), [compile_python=$enableval], -@@ -89,6 +102,7 @@ AM_CONDITIONAL([COMPILE_FUSE], [test "${ +@@ -89,6 +102,7 @@ AM_CONDITIONAL([COMPILE_FUSE], [test "${compile_fuse}" AM_CONDITIONAL([WIN32], [test "$bwin32" = "true"]) AM_CONDITIONAL([MACOS], [test "$bmac" = "true"]) +AM_CONDITIONAL([BSD], [test "$bbsd" = "true"]) AM_CONDITIONAL([LINUX], [test "$blinux" = "true"]) @@ -134,6 +148,8 @@ if test "$bwin32" = true; then LIB_MAC= MSVC_CFLAGS="-D__MSVCRT__ -D__MSVCRT_VERSION__=0x0601" LIB_CRYPT32=-lcrypt32 + LIB_INOTIFY= + LIB_KVM= LIB_ICONV=-liconv elif test "$bmac" = true ; then LIB_WS32= -@@ -149,6 +166,24 @@ elif test "$bmac" = true ; then +@@ -149,6 +165,24 @@ elif test "$bmac" = true ; then LIB_MAC="-framework CoreServices" LIB_CRYPT32= LIB_ICONV=-liconv + 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= + LIB_CRYPT32= + LIB_ICONV=-liconv + LIB_INOTIFY=-linotify + LIB_KVM=-lkvm else LIB_WS32= LIB_GDI32= -@@ -162,6 +199,8 @@ else +@@ -162,6 +196,8 @@ else LIB_MAC= MSVC_CFLAGS= LIB_CRYPT32= + LIB_INOTIFY=-linotify + LIB_KVM= fi AC_SUBST(LIB_WS32) -@@ -174,6 +214,8 @@ AC_SUBST(LIB_IPHLPAPI) +@@ -174,6 +210,8 @@ AC_SUBST(LIB_IPHLPAPI) AC_SUBST(LIB_SHELL32) AC_SUBST(LIB_PSAPI) AC_SUBST(LIB_MAC) +AC_SUBST(LIB_INOTIFY) +AC_SUBST(LIB_KVM) AC_SUBST(MSVC_CFLAGS) AC_SUBST(LIB_CRYPT32) AC_SUBST(LIB_ICONV) +@@ -189,6 +227,8 @@ ZDB_REQUIRED=2.10 + CURL_REQUIRED=7.17 + FUSE_REQUIRED=2.7.3 + ZLIB_REQUIRED=1.2.0 ++LIBEVHTP_REQUIRED=1.2.10 ++ONIGURUMA_REQUIRED=5.9.2 + + PKG_CHECK_MODULES(SSL, [openssl]) + AC_SUBST(SSL_CFLAGS) +@@ -221,6 +261,14 @@ AC_SUBST(LIBEVENT_LIBS) + PKG_CHECK_MODULES(ZLIB, [zlib >= $ZLIB_REQUIRED]) + AC_SUBST(ZLIB_CFLAGS) + AC_SUBST(ZLIB_LIBS) ++ ++PKG_CHECK_MODULES(LIBEVHTP, [evhtp >= $LIBEVHTP_REQUIRED]) ++AC_SUBST(LIBEVHTP_CFLAGS) ++AC_SUBST(LIBEVHTP_LIBS) ++ ++PKG_CHECK_MODULES(ONIGURUMA, [oniguruma >= $ONIGURUMA_REQUIRED]) ++AC_SUBST(ONIGURUMA_CFLAGS) ++AC_SUBST(ONIGURUMA_LIBS) + + if test x${compile_python} = xyes; then + AM_PATH_PYTHON([2.6]) Index: head/net-mgmt/seafile-server/files/patch-server_Makefile.am =================================================================== --- head/net-mgmt/seafile-server/files/patch-server_Makefile.am (nonexistent) +++ head/net-mgmt/seafile-server/files/patch-server_Makefile.am (revision 458046) @@ -0,0 +1,11 @@ +--- server/Makefile.am.orig 2018-01-04 05:04:59 UTC ++++ server/Makefile.am +@@ -114,7 +114,7 @@ seaf_server_SOURCES = \ + + seaf_server_LDADD = @CCNET_LIBS@ \ + $(top_builddir)/lib/libseafile_common.la \ +- @GLIB2_LIBS@ @GOBJECT_LIBS@ @SSL_LIBS@ @LIB_RT@ @LIB_UUID@ -lsqlite3 @LIBEVENT_LIBS@ -levhtp \ ++ @ONIGURUMA_LIBS@ @GLIB2_LIBS@ @GOBJECT_LIBS@ @SSL_LIBS@ @LIB_RT@ @LIB_UUID@ -lsqlite3 @LIBEVENT_LIBS@ @LIBEVHTP_LIBS@ \ + $(top_builddir)/common/cdc/libcdc.la \ + $(top_builddir)/common/db-wrapper/libdbwrapper.la \ + @SEARPC_LIBS@ @JANSSON_LIBS@ ${LIB_WS32} @ZLIB_LIBS@ \ Property changes on: head/net-mgmt/seafile-server/files/patch-server_Makefile.am ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net-mgmt/seafile-server/files/patch-server_access-file.c =================================================================== --- head/net-mgmt/seafile-server/files/patch-server_access-file.c (revision 458045) +++ head/net-mgmt/seafile-server/files/patch-server_access-file.c (revision 458046) @@ -1,54 +1,38 @@ ---- server/access-file.c.orig 2016-10-09 09:30:49 UTC +--- server/access-file.c.orig 2018-01-04 08:07:23 UTC +++ server/access-file.c -@@ -224,10 +224,10 @@ write_block_data_cb (struct bufferevent - bev->cbarg = data->saved_cb_arg; +@@ -618,7 +618,7 @@ do_file(evhtp_request_t *req, SeafRepo *repo, const ch + /* Block any new request from this connection before finish + * handling this request. + */ +- evhtp_request_pause (req); ++ bufferevent_disable(bev, EV_READ); - /* Resume reading incomming requests. */ -- evhtp_request_resume (data->req); -- - evhtp_send_reply_end (data->req); + /* Kick start data transfer by sending out http headers. */ + evhtp_send_reply_start(req, EVHTP_RES_OK); +@@ -967,7 +967,7 @@ do_file_range (evhtp_request_t *req, SeafRepo *repo, c + /* Block any new request from this connection before finish + * handling this request. + */ +- evhtp_request_pause (req); ++ bufferevent_disable(bev, EV_READ); -+ evhtp_request_resume (data->req); -+ - free_sendblock_data (data); - return; - } -@@ -309,10 +309,10 @@ next: - bev->cbarg = data->saved_cb_arg; + /* Kick start data transfer by sending out http headers. */ + evhtp_send_reply_start(req, EVHTP_RES_PARTIAL); +@@ -1037,7 +1037,7 @@ start_download_zip_file (evhtp_request_t *req, const c + /* Block any new request from this connection before finish + * handling this request. + */ +- evhtp_request_pause (req); ++ bufferevent_disable(bev, EV_READ); - /* Resume reading incomming requests. */ -- evhtp_request_resume (data->req); -- - evhtp_send_reply_end (data->req); + /* Kick start data transfer by sending out http headers. */ + evhtp_send_reply_start(req, EVHTP_RES_OK); +@@ -1365,7 +1365,7 @@ do_block(evhtp_request_t *req, SeafRepo *repo, const c + /* Block any new request from this connection before finish + * handling this request. + */ +- evhtp_request_pause (req); ++ bufferevent_disable(bev, EV_READ); -+ evhtp_request_resume (data->req); -+ - free_sendfile_data (data); - return; - } -@@ -406,10 +406,10 @@ write_dir_data_cb (struct bufferevent *b - bev->cbarg = data->saved_cb_arg; - - /* Resume reading incomming requests. */ -- evhtp_request_resume (data->req); -- - evhtp_send_reply_end (data->req); - -+ evhtp_request_resume (data->req); -+ - free_senddir_data (data); - return; - } -@@ -697,10 +697,10 @@ finish_file_range_request (struct buffer - bev->cbarg = data->saved_cb_arg; - - /* Resume reading incomming requests. */ -- evhtp_request_resume (data->req); -- - evhtp_send_reply_end (data->req); - -+ evhtp_request_resume (data->req); -+ - free_send_file_range_data (data); - } - + /* Kick start data transfer by sending out http headers. */ + evhtp_send_reply_start(req, EVHTP_RES_OK); Index: head/net-mgmt/seafile-server/files/patch-server_http-server.c =================================================================== --- head/net-mgmt/seafile-server/files/patch-server_http-server.c (nonexistent) +++ head/net-mgmt/seafile-server/files/patch-server_http-server.c (revision 458046) @@ -0,0 +1,11 @@ +--- server/http-server.c.orig 2018-01-03 02:47:07 UTC ++++ server/http-server.c +@@ -2122,7 +2122,7 @@ http_server_run (void *arg) + + http_request_init (server); + +- evhtp_use_threads (priv->evhtp, NULL, server->worker_threads, NULL); ++ evhtp_use_threads_wexit (priv->evhtp, NULL, NULL, server->worker_threads, NULL); + + struct timeval tv; + tv.tv_sec = CLEANING_INTERVAL_SEC; Property changes on: head/net-mgmt/seafile-server/files/patch-server_http-server.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net-mgmt/seafile-server/files/patch-server_upload-file.c =================================================================== --- head/net-mgmt/seafile-server/files/patch-server_upload-file.c (nonexistent) +++ head/net-mgmt/seafile-server/files/patch-server_upload-file.c (revision 458046) @@ -0,0 +1,93 @@ +--- server/upload-file.c.orig 2017-11-03 09:11:19 UTC ++++ server/upload-file.c +@@ -2048,12 +2048,12 @@ upload_read_cb (evhtp_request_t *req, evbuf_t *buf, vo + out: + if (res != EVHTP_RES_OK) { + /* Don't receive any data before the connection is closed. */ +- evhtp_request_pause (req); ++ bufferevent_disable(evhtp_request_get_bev(req), EV_READ); + + /* Set keepalive to 0. This will cause evhtp to close the + * connection after sending the reply. + */ +- req->keepalive = 0; ++ evhtp_request_set_keepalive(req, 0); + + fsm->state = RECV_ERROR; + } +@@ -2254,8 +2254,8 @@ upload_headers_cb (evhtp_request_t *req, evhtp_headers + } + + /* Set up per-request hooks, so that we can read file data piece by piece. */ +- evhtp_set_hook (&req->hooks, evhtp_hook_on_read, upload_read_cb, fsm); +- evhtp_set_hook (&req->hooks, evhtp_hook_on_request_fini, upload_finish_cb, fsm); ++ evhtp_request_set_hook (req, evhtp_hook_on_read, upload_read_cb, fsm); ++ evhtp_request_set_hook (req, evhtp_hook_on_request_fini, upload_finish_cb, fsm); + /* Set arg for upload_cb or update_cb. */ + req->cbarg = fsm; + +@@ -2265,12 +2265,12 @@ upload_headers_cb (evhtp_request_t *req, evhtp_headers + + err: + /* Don't receive any data before the connection is closed. */ +- evhtp_request_pause (req); ++ bufferevent_disable(evhtp_request_get_bev(req), EV_READ); + + /* Set keepalive to 0. This will cause evhtp to close the + * connection after sending the reply. + */ +- req->keepalive = 0; ++ evhtp_request_set_keepalive(req, 0); + send_error_reply (req, EVHTP_RES_BADREQ, err_msg); + + g_free (repo_id); +@@ -2339,38 +2339,38 @@ upload_file_init (evhtp_t *htp, const char *http_temp_ + + cb = evhtp_set_regex_cb (htp, "^/upload/.*", upload_cb, NULL); + /* upload_headers_cb() will be called after evhtp parsed all http headers. */ +- evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL); ++ evhtp_callback_set_hook(cb, evhtp_hook_on_headers, upload_headers_cb, NULL); + + cb = evhtp_set_regex_cb (htp, "^/upload-api/.*", upload_api_cb, NULL); +- evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL); ++ evhtp_callback_set_hook(cb, evhtp_hook_on_headers, upload_headers_cb, NULL); + + cb = evhtp_set_regex_cb (htp, "^/upload-raw-blks-api/.*", + upload_raw_blks_api_cb, NULL); +- evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL); ++ evhtp_callback_set_hook(cb, evhtp_hook_on_headers, upload_headers_cb, NULL); + + cb = evhtp_set_regex_cb (htp, "^/upload-blks-api/.*", upload_blks_api_cb, NULL); +- evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL); ++ evhtp_callback_set_hook(cb, evhtp_hook_on_headers, upload_headers_cb, NULL); + + cb = evhtp_set_regex_cb (htp, "^/upload-blks-aj/.*", upload_blks_ajax_cb, NULL); +- evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL); ++ evhtp_callback_set_hook(cb, evhtp_hook_on_headers, upload_headers_cb, NULL); + + cb = evhtp_set_regex_cb (htp, "^/upload-aj/.*", upload_ajax_cb, NULL); +- evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL); ++ evhtp_callback_set_hook(cb, evhtp_hook_on_headers, upload_headers_cb, NULL); + + cb = evhtp_set_regex_cb (htp, "^/update/.*", update_cb, NULL); +- evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL); ++ evhtp_callback_set_hook(cb, evhtp_hook_on_headers, upload_headers_cb, NULL); + + cb = evhtp_set_regex_cb (htp, "^/update-api/.*", update_api_cb, NULL); +- evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL); ++ evhtp_callback_set_hook(cb, evhtp_hook_on_headers, upload_headers_cb, NULL); + + cb = evhtp_set_regex_cb (htp, "^/update-blks-api/.*", update_blks_api_cb, NULL); +- evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL); ++ evhtp_callback_set_hook(cb, evhtp_hook_on_headers, upload_headers_cb, NULL); + + cb = evhtp_set_regex_cb (htp, "^/update-blks-aj/.*", update_blks_ajax_cb, NULL); +- evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL); ++ evhtp_callback_set_hook(cb, evhtp_hook_on_headers, upload_headers_cb, NULL); + + cb = evhtp_set_regex_cb (htp, "^/update-aj/.*", update_ajax_cb, NULL); +- evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL); ++ evhtp_callback_set_hook(cb, evhtp_hook_on_headers, upload_headers_cb, NULL); + + evhtp_set_regex_cb (htp, "^/upload_progress.*", upload_progress_cb, NULL); + Property changes on: head/net-mgmt/seafile-server/files/patch-server_upload-file.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property