Index: head/net-mgmt/seafile-server/Makefile =================================================================== --- head/net-mgmt/seafile-server/Makefile (revision 557030) +++ head/net-mgmt/seafile-server/Makefile (revision 557031) @@ -1,135 +1,136 @@ # $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 \ libonig.so:devel/oniguruma 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 compiler:c11 gnome iconv libarchive libtool localbase mysql \ pathfix pgsql pkgconfig python:3.6+ shebangfix sqlite ssl USE_GITHUB= yes GH_ACCOUNT= haiwen USE_GNOME= glib20 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" PKG_CONFIG_PATH="${WRKDIR}/pkgconfig" 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 _PKGCONFIGDIR= ${WRKDIR}/pkgconfig post-patch: # Fix P_KTHREAD r295435 ${REINPLACE_CMD} 's/P_KTHREAD/P_KPROC/' ${WRKSRC}/lib/utils.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 # Fix python hardcodings ${REINPLACE_CMD} 's/python3\.[0-9]/${PYTHON_VERSION}/g; s/python3 /${PYTHON_VERSION} / ; \ s/PYTHON=python3/PYTHON=${PYTHON_VERSION}/' \ ${WRKSRC}/controller/seafile-controller.c ${WRKSRC}/scripts/reset-admin.sh \ ${WRKSRC}/scripts/upgrade/upgrade_7.0_7.1.sh \ ${WRKSRC}/scripts/seahub.sh ${WRKSRC}/scripts/setup-seafile.sh \ ${WRKSRC}/scripts/setup-seafile-mysql.sh \ ${WRKSRC}/scripts/setup-seafile-mysql.py ${REINPLACE_CMD} 's/python/${PYTHON_VERSION}/' \ ${WRKSRC}/scripts/upgrade/regenerate_secret_key.sh @${MKDIR} ${_PKGCONFIGDIR} .if ${MYSQL_FLAVOUR} == mariadb # If mariadb is the selected flavor, link the pc file as # mysqlclient so PKG_CHECK_MODULES can find it. Mariadb # doesn't supply this file in the same way other flavours do. @${LN} -sf ${LOCALBASE}/libdata/pkgconfig/libmariadb.pc \ ${_PKGCONFIGDIR}/mysqlclient.pc .elif ${SSL_DEFAULT} == base # Add bogus pc file to satisfy mysqlclient depend for ssl=base @${PRINTF} 'Name:\nDescription:\nVersion:' \ >${_PKGCONFIGDIR}/openssl.pc .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 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 && \ ${COPYTREE_SHARE} "sql upgrade/sql" ${STAGEDIR}${PREFIX}/${SEAFILE_SERVER}) 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/seafile.in =================================================================== --- head/net-mgmt/seafile-server/files/seafile.in (revision 557030) +++ head/net-mgmt/seafile-server/files/seafile.in (revision 557031) @@ -1,147 +1,153 @@ #!/bin/sh # # $FreeBSD$ # # PROVIDE: seafile # REQUIRE: LOGIN cleanvar mysql # KEYWORD: shutdown # # # Add the following lines to /etc/rc.conf to enable seafile: # # seafile_enable (bool): Set to "NO" by default. # Set it to "YES" to enable seafile. # seafile_user (str): User to run seafile as # Default to "%%USERS%%" created by the port # seafile_group (str): Group to run seafile as # Default to "%%GROUPS%%" created by the port # seafile_path (str): Set to "" by default will use the path # %%PREFIX%%/%%SEAFILE_SERVER%%. # Set it to a different path. # seafile_ccnet (str): Set to "" by default will use the path # %%PREFIX%%/%%HAIWENDIR%%/ccnet. # Set it to a different path. # seafile_conf (str): Set to "" by default will use the path # %%PREFIX%%/%%HAIWENDIR%%/conf. # Set it to a different path. # seafile_datadir (str): Set to "" by default will use the path # in file %%PREFIX%%/%%HAIWENDIR%%/ccnet/seafile.ini. # Set it to a different path. # seafile_logdir (str): Set to "" by default will use the path # %%PREFIX%%/%%HAIWENDIR%%/logs # Set it to a different path. # seafile_loglevel (str): Set to "info" by default. # Possible values are debug, warning, info. . /etc/rc.subr name="seafile" rcvar="seafile_enable" load_rc_config $name start_cmd="seafile_start" restart_cmd="seafile_restart" stop_cmd="seafile_stop" : ${seafile_enable="NO"} : ${seafile_user:="%%USERS%%"} : ${seafile_group:="%%GROUPS%%"} : ${seafile_path:="%%PREFIX%%/%%SEAFILE_SERVER%%"} : ${seafile_ccnet:="%%PREFIX%%/%%HAIWENDIR%%/ccnet"} : ${seafile_conf:="%%PREFIX%%/%%HAIWENDIR%%/conf"} : ${seafile_datadir:="%%PREFIX%%/%%HAIWENDIR%%/seafile-data"} : ${seafile_logdir:="%%PREFIX%%/%%HAIWENDIR%%/logs"} : ${seafile_loglevel:="info"} command="%%PREFIX%%/%%SEAFILE_SERVER%%/seafile/bin/seafile-controller" command_args="-c \"${seafile_ccnet}\" -d \"${seafile_datadir}\" -F \"${seafile_conf}\" -l \"${seafile_logdir}\" -g \"${seafile_loglevel}\" -G \"${seafile_loglevel}\"" required_dirs="${seafile_ccnet} ${seafile_conf} ${seafile_datadir}" test_config() { if ! su -m ${seafile_user} -c "${command} -t ${command_args}" ; then exit 1; fi } check_component_running() { name=$1 cmd=$2 if pid=$(pgrep -f "$cmd" 2>/dev/null); then echo "{$name} is running, pid $pid. You can stop it by: " echo echo " kill $pid" echo echo "Stop it and try again." echo exit fi } validate_already_running() { if pid=$(pgrep -f "seafile-controller -c ${seafile_ccnet}" 2>/dev/null); then echo "Seafile controller is already running, pid $pid" echo exit 1; fi check_component_running "ccnet-server" "ccnet-server -c ${seafile_ccnet}" check_component_running "seaf-server" "seaf-server -c ${seafile_ccnet}" check_component_running "fileserver" "fileserver -c ${seafile_ccnet}" check_component_running "seafdav" "wsgidav.server.run_server" } prepare_env() { export PATH=${seafile_path}/seafile/bin:$PATH export LD_LIBRARY_PATH=${seafile_path}/seafile/lib/:${seafile_path}/seafile/lib64:${LD_LIBRARY_PATH} +export CCNET_CONF_DIR=${seafile_ccnet} +export SEAFILE_CONF_DIR=${seafile_datadir} +export SEAFILE_CENTRAL_CONF_DIR=${seafile_conf} +export PYTHON=%%PREFIX%%/bin/%%PYTHON%% +export PYTHONPATH=${seafile_path}/seafile/lib/%%PYTHON%%/site-packages:${seafile_path}/seafile/lib64/%%PYTHON%%/site-packages:${seafile_path}/seahub/thirdpart:$PYTHONPATH +export SEAFILE_RPC_PIPE_PATH=${seafile_path}/runtime } seafile_start() { check_required_before; validate_already_running; prepare_env; test_config; echo "Starting seafile server, please wait ..." su -m "${seafile_user}" -c "mkdir -p $seafile_logdir" su -m "${seafile_user}" -c "$command $command_args" sleep 3 # check if seafile server started successfully if ! pgrep -f "seafile-controller -c ${seafile_ccnet}" 2>/dev/null 1>&2; then echo "Failed to start seafile server" exit 1; fi echo "Seafile server started" echo } seafile_stop() { if ! pgrep -f "seafile-controller -c ${seafile_ccnet}" 2>/dev/null 1>&2; then echo "Seafile is not running" return 1; fi echo "Stopping ${name}." pkill -SIGTERM -f "seafile-controller -c ${seafile_ccnet}" pkill -f "ccnet-server -c ${seafile_ccnet}" pkill -f "seaf-server -c ${seafile_ccnet}" pkill -f "fileserver -c ${seafile_ccnet}" pkill -f "soffice.*--invisible --nocrashreport" pkill -f "wsgidav.server.run_server" return 0 } seafile_restart() { seafile_stop; sleep 2 seafile_start; } run_rc_command "$1" Index: head/www/py-seafdav/Makefile =================================================================== --- head/www/py-seafdav/Makefile (revision 557030) +++ head/www/py-seafdav/Makefile (revision 557031) @@ -1,48 +1,48 @@ # $FreeBSD$ PORTNAME= seafdav DISTVERSIONPREFIX= v DISTVERSION= ${SEAHUB_VER} DISTVERSIONSUFFIX= -pro CATEGORIES= www python PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= ultima@FreeBSD.org COMMENT= Python library for accessing seafile data model LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}defusedxml>=0.5:devel/py-defusedxml@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}Jinja2>=2.10:devel/py-Jinja2@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}jsmin>=2.2:devel/py-jsmin@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}json5>=0.8.5:devel/py-json5@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}python-pam>=1.8:security/py-python-pam@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}yaml>=5.1:devel/py-yaml@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}six>=1.12:devel/py-six@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}lxml>=0:devel/py-lxml@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}sqlalchemy13>=0:databases/py-sqlalchemy13@${PY_FLAVOR} USES= python:3.6+ shebangfix USE_GITHUB= yes GH_ACCOUNT= haiwen USE_PYTHON= flavors SHEBANG_FILES= *.py *.template wsgidav/dc/*.py NO_ARCH= yes NO_BUILD= yes do-install: @${MKDIR} ${STAGEDIR}${PREFIX}/${SITEPACKAGEDIR}/wsgidav (cd ${WRKSRC}/wsgidav && \ ${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py \ -d ${WRKSRC}/wsgidav \ -f ${WRKSRC}/wsgidav && \ ${PYTHON_CMD} -O ${PYTHON_LIBDIR}/compileall.py \ -d ${WRKSRC}/wsgidav \ -f ${WRKSRC}/wsgidav) (cd ${WRKSRC}/wsgidav && \ ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/${SITEPACKAGEDIR}/wsgidav) .include "${.CURDIR}/../../net-mgmt/seafile-server/Makefile.include" .include