Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109915402
D30323.id89936.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
7 KB
Referenced Files
None
Subscribers
None
D30323.id89936.diff
View Options
Index: GIDs
===================================================================
--- GIDs
+++ GIDs
@@ -230,7 +230,7 @@
ntopng:*:288:
victoria-metrics:*:289:
_gmid:*:290:
-# free: 291
+pydio:*:291:
# free: 292
# free: 293
# free: 294
Index: UIDs
===================================================================
--- UIDs
+++ UIDs
@@ -235,7 +235,7 @@
ntopng:*:288:288::0:0:ntopng daemon user:/nonexistent:/usr/sbin/nologin
victoria-metrics:*:289:289::0:0:VictoriaMetrics user:/nonexistent:/usr/sbin/nologin
_gmid:*:290:290::0:0:gmid daemon user:/var/empty:/usr/sbin/nologin
-# free: 291
+pydio:*:291:291::0:0:pydio cells user:/var/pydio:/bin/sh
# free: 292
# free: 293
# free: 294
Index: www/pydio-cells/Makefile
===================================================================
--- www/pydio-cells/Makefile
+++ www/pydio-cells/Makefile
@@ -1,6 +1,7 @@
PORTNAME= cells
-PORTVERSION= 2.2.7
DISTVERSIONPREFIX= v
+DISTVERSION= 2.2.7
+PORTREVISION= 1
CATEGORIES= www
PKGNAMEPREFIX= pydio-
@@ -10,20 +11,57 @@
LICENSE= AGPLv3
LICENSE_FILE= ${WRKSRC}/LICENSE
-USES= go
+NOT_FOR_ARCHS= i386
+NOT_FOR_ARCHS_REASON= Not supported on i386
-GO_PKGNAME= github.com/pydio/cells
+BUILD_DEPENDS= pydio-packr:devel/pydio-packr
+
+USES= go gmake
+USE_RC_SUBR= ${PORTNAME}
USE_GITHUB= yes
GH_ACCOUNT= pydio
+GO_PKGNAME= github.com/pydio/cells
+GO_BUILDFLAGS= -ldflags "-X github.com/pydio/cells/common.version=${DISTVERSION}"
+
+USERS= pydio
+GROUPS= pydio
PLIST_FILES= bin/cells
-PORTDOCS= README.md
-OPTIONS_DEFINE= DOCS
-DOCS_DESC= Install pydio-cells README file
+OPTIONS_DEFINE= BASH ZSH
+OPTIONS_DEFAULT= BASH ZSH
+
+BASH_PLIST_FILES= etc/bash_completion.d/${PORTNAME}
+ZSH_PLIST_FILES= share/zsh/site-functions/_${PORTNAME}
+
+post-patch:
+ ${REINPLACE_CMD} -e "s|\$${GOPATH}/bin/packr|${LOCALBASE}/bin/pydio-packr|g" \
+ ${WRKSRC}/Makefile
+
+pre-build:
+ @cd ${WRKSRC} && \
+ ${MAKE_CMD} generate
+
+post-build-BASH-on:
+ ${SETENV} CELLS_WORKING_DIR=${WRKDIR}/wrkdir \
+ ${GO_WRKDIR_BIN}/${PORTNAME} tools completion bash \
+ > ${WRKDIR}/bash_completions
+ @${REINPLACE_CMD} -e 's|${GO_WRKDIR_BIN}/||g' ${WRKDIR}/bash_completions
+
+post-build-ZSH-on:
+ ${SETENV} CELLS_WORKING_DIR=${WRKDIR}/wrkdir \
+ ${GO_WRKDIR_BIN}/${PORTNAME} tools completion zsh \
+ > ${WRKDIR}/zsh_completions
+ @${REINPLACE_CMD} -e 's|${GO_WRKDIR_BIN}/||g' ${WRKDIR}/zsh_completions
+
+post-install-BASH-on:
+ @${MKDIR} ${STAGEDIR}${PREFIX}/etc/bash_completion.d
+ ${INSTALL_DATA} ${WRKDIR}/bash_completions \
+ ${STAGEDIR}${PREFIX}/etc/bash_completion.d/${PORTNAME}
-do-install-DOCS-on:
- ${MKDIR} ${STAGEDIR}${DOCSDIR}
- ${INSTALL_DATA} ${WRKSRC}/${PORTDOCS} ${STAGEDIR}${DOCSDIR}
+post-install-ZSH-on:
+ @${MKDIR} ${STAGEDIR}${PREFIX}/share/zsh/site-functions
+ ${INSTALL_DATA} ${WRKDIR}/zsh_completions \
+ ${STAGEDIR}${PREFIX}/share/zsh/site-functions/_${PORTNAME}
.include <bsd.port.mk>
Index: www/pydio-cells/files/cells.in
===================================================================
--- /dev/null
+++ www/pydio-cells/files/cells.in
@@ -0,0 +1,85 @@
+#!/bin/sh
+
+# PROVIDE: cells
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following line to /etc/rc.conf to enable Pydio Cells:
+#
+# cells_enable (bool): Set to "NO" by default.
+# Set to "YES" to enable Pydio Cells.
+# cells_user (str): Default to "pydio".
+# cells_group (str): Default to "pydio".
+# User and group to run Pydio Cells with.
+# cells_flags (str): Additional flags to append to "cells start" command.
+# Read `cells help start` for more information.
+# cells_workingdir (str): Default to "/var/pydio/.config/pydio/cells".
+# Application directory.
+# cells_logdir (str): Default to "${cells_workingdir}/logs".
+# Directory for application logs.
+
+. /etc/rc.subr
+
+name=cells
+rcvar=cells_enable
+desc="Pydio Cells"
+
+load_rc_config cells
+
+: ${cells_enable:=NO}
+: ${cells_user:=pydio}
+: ${cells_group:=pydio}
+: ${cells_workingdir=/var/pydio/.config/pydio/cells}
+: ${cells_logdir="${cells_workingdir}/logs"}
+
+_envvars="CELLS_WORKING_DIR=${cells_workingdir} CELLS_LOG_DIR=${cells_logdir}"
+_sucmd=/usr/bin/su
+
+extra_commands=cli
+pidfile=/var/run/${name}/${name}.pid
+cli_precmd=cells_precmd
+cli_cmd="cells_cli $@"
+start_precmd=cells_precmd
+stop_cmd=cells_stop
+procname="%%PREFIX%%/bin/cells"
+command=/usr/sbin/daemon
+command_args="-p ${pidfile} -o ${cells_logdir}/cells.log env ${_envvars} ${procname} start ${cells_flags}"
+
+cells_precmd()
+{
+ # Create PID file directory
+ install -d -o ${cells_user} -g ${cells_group} -m 0755 "$(dirname ${pidfile})"
+
+ # Remove default flags, they're added in `command_args` manually
+ rc_flags=""
+}
+
+cells_cli()
+{
+ shift 1
+ ${_sucmd} -l ${cells_user} -c "exec env ${_envvars} ${procname} $*"
+}
+
+cells_stop()
+{
+ # Copy-paste from rc.subr
+ if [ -z "${rc_pid}" ]; then
+ [ -n "${rc_fast}" ] && return 0
+ _run_rc_notrunning
+ return 1
+ fi
+ _children_pids=$(pgrep -P ${rc_pid})
+
+ echo "Stopping ${name}."
+ _run_rc_doit "kill -TERM ${rc_pid}" || return 1
+
+ # Stopping children is unreliable, so re-send TERM to them
+ # and wait for both the parent and the children
+ for _pid in ${_children_pids}; do
+ kill -TERM ${_pid}
+ done
+
+ wait_for_pids ${rc_pid} ${children_pids}
+}
+
+run_rc_command "$1"
Index: www/pydio-cells/files/patch-cmd_start.go
===================================================================
--- /dev/null
+++ www/pydio-cells/files/patch-cmd_start.go
@@ -0,0 +1,15 @@
+--- cmd/start.go.orig 2021-05-06 12:02:02 UTC
++++ cmd/start.go
+@@ -289,7 +289,11 @@ ENVIRONMENT
+ if (process == nil || len(process.Services) == 0) && len(childrenProcesses) == 0 {
+ return nil
+ }
+- log.Info("Services are still running ", zap.Any("services", process.Services))
++ // Already fixed upstream, should be in the next version after 2.2.7:
++ // https://github.com/pydio/cells/issues/325
++ if (process != nil) {
++ log.Info("Services are still running ", zap.Any("services", process.Services))
++ }
+ continue
+ case <-timeout:
+ return nil
Index: www/pydio-cells/files/patch-common_config_dirs.go
===================================================================
--- /dev/null
+++ www/pydio-cells/files/patch-common_config_dirs.go
@@ -0,0 +1,19 @@
+--- common/config/dirs.go.orig 2021-05-06 12:02:02 UTC
++++ common/config/dirs.go
+@@ -54,9 +54,14 @@ func ApplicationWorkingDir(dirType ...ApplicationDirTy
+ } else if d == ApplicationDirServices && os.Getenv("CELLS_SERVICES_DIR") != "" {
+ f = os.Getenv("CELLS_SERVICES_DIR")
+ } else {
+- vendor := "Pydio"
+- if runtime.GOOS == "linux" {
++ // Pull request upstream:
++ // https://github.com/pydio/cells/pull/326
++ var vendor string
++ switch runtime.GOOS {
++ case "linux", "freebsd":
+ vendor = "pydio"
++ default:
++ vendor = "Pydio"
+ }
+ appName := "cells"
+ configDirs := configdir.New(vendor, appName)
Index: www/pydio-cells/pkg-message
===================================================================
--- /dev/null
+++ www/pydio-cells/pkg-message
@@ -0,0 +1,24 @@
+[
+{ type: install
+ message: <<EOM
+To configure and start Pydio Cells:
+
+1. Enable cells in rc.conf:
+ # sysrc cells_enable=YES
+
+2. (optional) Set the custom working and log directories:
+ # sysrc cells_workingdir=<working_dir>
+ # sysrc cells_logdir=<log_dir>
+
+3. Run the configuration
+ # service cells cli configure --exit_after_install
+
+4. When the configuration master finishes - start the cells
+ # service cells start
+
+To control your installation you can use cells CLI
+with workingdir and logdir set by running:
+# service cells cli ...
+EOM
+}
+]
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Feb 12, 4:12 AM (13 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16605780
Default Alt Text
D30323.id89936.diff (7 KB)
Attached To
Mode
D30323: www/pydio-cells: Fix build and overhaul
Attached
Detach File
Event Timeline
Log In to Comment