Index: www/collaboraonline/Makefile =================================================================== --- /dev/null +++ www/collaboraonline/Makefile @@ -0,0 +1,220 @@ +PORTNAME= collaboraonline +DISTVERSION= 21.11.1-4 +CATEGORIES= www editors +MASTER_SITES= LOCAL/arrowd/:node_modules \ + https://dev-www.libreoffice.org/src/:dtoa \ + https://dev-www.libreoffice.org/extern/:ext +DISTFILES= collabora_node_modules.tar.gz:node_modules \ + dtoa-20180411.tgz:dtoa \ + f543e6e2d7275557a839a164941c0a86e5f2c3f2a0042bfc434c88c6dde9e140-opens___.ttf:ext +EXTRACT_ONLY= ${GH_ACCOUNT}-${GH_PROJECT}-${DISTVERSION}-${GH_TAGNAME}_GH0.tar.gz \ + collabora_node_modules.tar.gz \ + LibreOffice-core-${COLLABORAOFFICE_HASH}_GH0.tar.gz +DIST_SUBDIR= libreoffice + +MAINTAINER= arrowd@FreeBSD.org +COMMENT= Implementation of the Web Application Open Platform Interface + +LICENSE= MPL20 + +# Uses pre-compiled native node modules +ONLY_FOR_ARCHS= amd64 + +BUILD_DEPENDS= bash:shells/bash \ + npm:www/npm \ + fc-cache:x11-fonts/fontconfig \ + gperf:devel/gperf \ + ucpp:devel/ucpp \ + flex>=0.26:textproc/flex \ + mdds>=1.7:devel/mdds \ + zip:archivers/zip \ + ${LOCALBASE}/libdata/pkgconfig/cppunit.pc:devel/cppunit \ + ${LOCALBASE}/include/glm/glm.hpp:math/glm \ + ${LOCALBASE}/include/sane/sane.h:graphics/sane-backends \ + ${LOCALBASE}/include/sqlext.h:databases/unixODBC \ + ${PYTHON_PKGNAMEPREFIX}lxml>=0:devel/py-lxml \ + ${PYTHON_PKGNAMEPREFIX}polib>=0:devel/py-polib +LIB_DEPENDS= libPocoNet.so:devel/poco \ + libpng.so:graphics/png \ + libabw-0.1.so:textproc/libabw \ + libapr-1.so:devel/apr1 \ + libbox2d.so:misc/box2d \ + libcmis-0.5.so:net/libcmis \ + libcdr-0.1.so:graphics/libcdr01 \ + libclucene-core.so:textproc/clucene \ + libe-book-0.1.so:textproc/libe-book \ + libepoxy.so:graphics/libepoxy \ + libepubgen-0.1.so:textproc/libepubgen \ + libetonyek-0.1.so:graphics/libetonyek01 \ + libexttextcat-2.0.so:textproc/libexttextcat \ + libfreehand-0.1.so:graphics/libfreehand \ + libgraphite2.so:graphics/graphite2 \ + libharfbuzz-icu.so:print/harfbuzz-icu \ + libhunspell-1.7.so:textproc/hunspell \ + libhyphen.so:textproc/hyphen \ + libicutu.so:devel/icu \ + libmspub-0.1.so:print/libmspub01 \ + libmwaw-0.3.so:textproc/libmwaw03 \ + libmythes-1.2.so:textproc/mythes \ + libnumbertext-1.0.so:textproc/libnumbertext \ + libodfgen-0.1.so:textproc/libodfgen01 \ + liborcus-0.16.so:devel/liborcus \ + libpagemaker-0.0.so:print/libpagemaker \ + libpoppler.so:graphics/poppler \ + libqrcodegencpp.so:graphics/qr-code-generator \ + libqxp-0.0.so:textproc/libqxp \ + libraptor2.so:textproc/raptor2 \ + librdf.so:textproc/redland \ + librevenge-0.0.so:textproc/librevenge \ + libserf-1.so:www/serf \ + libstaroffice-0.0.so:textproc/libstaroffice \ + libvisio-0.1.so:textproc/libvisio01 \ + libwpd-0.10.so:textproc/libwpd010 \ + libwpg-0.3.so:graphics/libwpg03 \ + libwps-0.4.so:textproc/libwps \ + libxmlsec1-nss.so:security/xmlsec1 \ + libzmf-0.0.so:graphics/libzmf +RUN_DEPENDS= bash:shells/bash \ + # TODO: get rid of this dependency \ + gcp:sysutils/coreutils + +USES= autoreconf:build bison gettext-tools gmake gnome jpeg libtool localbase:ldflags pkgconfig python:build +# TODO: remove this? +USES+= iconv:wchar_t + +USE_GNOME= cairo +USE_OPENLDAP= yes +USE_RC_SUBR= collaboraonline +SUB_FILES= pkg-message + +USE_GITHUB= yes +GH_ACCOUNT= arrowd LibreOffice:lo +GH_PROJECT= online core:lo +GH_TAGNAME= devfs ${COLLABORAOFFICE_HASH}:lo + +GNU_CONFIGURE= yes +CONFIGURE_ARGS= --with-lo-path=${COLLABORAOFFICE_PATH} \ + --with-lokit-path=${WRKSRC_lo}/include +CONFIGURE_ENV= FLEX=${LOCALBASE}/bin/flex + +OPTIONS_DEFINE= DOCS +OPTIONS_DEFAULT= DOCS + +BINARY_ALIAS= python3=${PYTHON_CMD} +ETCDIR= ${PREFIX}/etc/coolwsd +DOCSDIR= ${PREFIX}/share/doc/coolwsd +DATADIR= ${PREFIX}/share/coolwsd + +# For the hash see https://github.com/LibreOffice/core/commits/distro/collabora/co-2021 +COLLABORAOFFICE_HASH= 8f0115345509b078b2983f3b03822fc1afdc6a9d +# For the version see configure.ac on the ${COLLABORAOFFICE_HASH} commit +COLLABORAOFFICE_VER= 21.06.13.1 +COLLABORAOFFICE_PATH= ${PREFIX}/lib/collaboraoffice/ +# We have to set suid bit on the coolforkit program, which calls +# dlopen(${COLLABORAOFFICE_PATH}/program/libsofficeapp.so) +# However, suid executables ignore LD_LIBRARY_PATH for security reasons, so we +# need to use RPATH to point libsofficeapp.so to its dependencies +#COLLABORAOFFICE_LDFLAGS= ${LDFLAGS} -rpath ${COLLABORAOFFICE_PATH}/program + +# Inspired by https://github.com/LibreOffice/core/blob/distro/collabora/co-2021/distro-configs/CPLinux-LOKit.conf +COLLABORAOFFICE_CONFIGURE_ARGS= --disable-fetch-external \ + --with-vendor="FreeBSD ports" \ + --with-build-version="FreeBSD ports ${PKGVERSION}" \ + --with-external-dict-dir=${LOCALBASE}/share/hunspell \ + --with-external-hyph-dir=${LOCALBASE}/share/hyphen \ + --with-external-tar=${DISTDIR}/${DIST_SUBDIR} \ + --with-external-thes-dir=${LOCALBASE}/share/mythes \ + --with-os-version=${OSVERSION} \ + --with-system-ucpp \ + --disable-pdfium \ + --disable-coinmp \ + --disable-epm \ + --disable-mergelibs \ + --without-myspell-dicts \ + --without-fonts \ + --with-parallelism=${MAKE_JOBS_NUMBER} \ + --prefix=${PREFIX} \ + \ + --enable-mpl-subset \ + --disable-community-flavor \ + --with-branding=icon-themes/galaxy/brand_cp \ + --with-system-dicts \ + --with-system-libs \ + --without-system-coinmp \ + --without-java \ + --without-junit \ + --without-help \ + --enable-noto-font \ + --with-galleries=no \ + --with-theme="colibre colibre_svg" \ + --disable-dbus \ + --enable-extension-integration \ + --disable-odk \ + --disable-kf5 \ + --disable-gtk3 \ + --disable-qt5 \ + --disable-gstreamer-1-0 \ + --disable-evolution2 \ + --disable-gio \ + --disable-gui \ + --disable-scripting-beanshell \ + --disable-scripting-javascript \ + --disable-ext-wiki-publisher \ + --disable-report-builder \ + --disable-ext-nlpsolver \ + --disable-sdremote \ + --disable-sdremote-bluetooth \ + --disable-postgresql-sdbc \ + --disable-firebird-sdbc \ + --disable-randr \ + --disable-ext-numbertext \ + --disable-ext-ct2n \ + --disable-online-update \ + --disable-dconf \ + --enable-release-build \ + --with-webdav=serf \ + --disable-lotuswordpro \ + --disable-lpsolve \ + --enable-sal-log + +post-extract: + ${LN} -s ${WRKDIR}/node_modules ${WRKSRC}/browser/node_modules + ${ECHO_CMD} lo_sources_ver=${COLLABORAOFFICE_VER} > ${WRKSRC_lo}/sources.ver + +pre-configure: + cd ${WRKSRC_lo} && ./autogen.sh --help + cd ${WRKSRC_lo} && ${SETENV} CC="${CC}" CPP="${CPP}" CXX="${CXX}" \ + CFLAGS="${CFLAGS} -g0" CPPFLAGS="${CPPFLAGS}" CXXFLAGS="${CXXFLAGS} -g0" \ + LDFLAGS="${LDFLAGS}" LIBS="${LIBS}" \ + INSTALL="/usr/bin/install -c" \ + INSTALL_DATA="${INSTALL_DATA}" \ + INSTALL_LIB="${INSTALL_LIB}" \ + INSTALL_PROGRAM="${INSTALL_PROGRAM}" \ + INSTALL_SCRIPT="${INSTALL_SCRIPT}" \ + ${CONFIGURE_ENV} ${CONFIGURE_CMD} ${COLLABORAOFFICE_CONFIGURE_ARGS} + + cd ${WRKSRC} && ${AUTORECONF} -f -i + +pre-build: + cd ${WRKSRC_lo} && gmake + +pre-install: + cd ${WRKSRC_lo} && gmake install-strip DESTDIR=${STAGEDIR} + +post-install: + ${MV} ${STAGEDIR}${ETCDIR}/coolwsd.xml ${STAGEDIR}${ETCDIR}/coolwsd.xml.sample + ${MV} ${STAGEDIR}${ETCDIR}/coolkitconfig.xcu ${STAGEDIR}${ETCDIR}/coolkitconfig.xcu.sample + + ${MKDIR} ${STAGEDIR}${PREFIX}/etc/apache24/Includes/ + ${MV} ${STAGEDIR}${PREFIX}/etc/apache2/conf-available/coolwsd.conf ${STAGEDIR}${PREFIX}/etc/apache24/Includes/ + ${RM} -rf ${STAGEDIR}${PREFIX}/etc/apache2 + + ${MKDIR} ${STAGEDIR}${PREFIX}/etc/pam.d + ${ECHO_CMD} "auth required pam_unix.so" > ${STAGEDIR}${PREFIX}/etc/pam.d/coolwsd + ${ECHO_CMD} "account required pam_unix.so" >> ${STAGEDIR}${PREFIX}/etc/pam.d/coolwsd + + ${MKDIR} ${STAGEDIR}${PREFIX}/etc/rc.d + + ${RM} -rf ${STAGEDIR}/gid_Module_* + +.include Index: www/collaboraonline/distinfo =================================================================== --- /dev/null +++ www/collaboraonline/distinfo @@ -0,0 +1,11 @@ +TIMESTAMP = 1643214036 +SHA256 (libreoffice/collabora_node_modules.tar.gz) = 40b6f2eb153511ba7d02d652205f0e9627b1db15d3a6549b7632f644ba64b1d4 +SIZE (libreoffice/collabora_node_modules.tar.gz) = 20843056 +SHA256 (libreoffice/dtoa-20180411.tgz) = 0082d0684f7db6f62361b76c4b7faba19e0c7ce5cb8e36c4b65fea8281e711b4 +SIZE (libreoffice/dtoa-20180411.tgz) = 48893 +SHA256 (libreoffice/f543e6e2d7275557a839a164941c0a86e5f2c3f2a0042bfc434c88c6dde9e140-opens___.ttf) = f543e6e2d7275557a839a164941c0a86e5f2c3f2a0042bfc434c88c6dde9e140 +SIZE (libreoffice/f543e6e2d7275557a839a164941c0a86e5f2c3f2a0042bfc434c88c6dde9e140-opens___.ttf) = 207992 +SHA256 (libreoffice/arrowd-online-21.11.1-4-devfs_GH0.tar.gz) = 65e62920fd4437db823c6e6046046d4518f46d2267e000a84828625dfa1e37dc +SIZE (libreoffice/arrowd-online-21.11.1-4-devfs_GH0.tar.gz) = 43898313 +SHA256 (libreoffice/LibreOffice-core-8f0115345509b078b2983f3b03822fc1afdc6a9d_GH0.tar.gz) = 42568d9364aea04e7b70d8e76d59178a33b26780a526210ff18ccf270f0045ef +SIZE (libreoffice/LibreOffice-core-8f0115345509b078b2983f3b03822fc1afdc6a9d_GH0.tar.gz) = 298451227 Index: www/collaboraonline/files/collaboraonline.in =================================================================== --- /dev/null +++ www/collaboraonline/files/collaboraonline.in @@ -0,0 +1,64 @@ +#!/bin/sh + +# PROVIDE: collaboraonline +# REQUIRE: DAEMON +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf to enable this service: +# +# collaboraonline_enable: Set to NO by default. Set it to YES to enable it. +# collaboraonline_flags: Additional command line flags to pass to coolwsd +# + +. /etc/rc.subr + +name=collaboraonline +desc="Collabora Online Web Sockets Server" +rcvar=collaboraonline_enable + +start_cmd="${name}_start" +start_precmd="${name}_prestart" +stop_cmd="${name}_stop" +status_cmd="${name}_status" + +extra_commands="status" + +load_rc_config $name + +: ${collaboraonline_enable:=NO} +: ${collaboraonline_flags=""} + +collabora_home="/var/db/collaboraonline" +pidfile="/var/run/coolwsd.pid" +flags="--o:sys_template_path=$collabora_home/systemplate --o:child_root_path=$collabora_home/child-roots --o:file_server_root_path=%%PREFIX%%/share/coolwsd --o:logging.file[@enable]=true --o:logging.file.property[@path]=/var/log/coolwsd.log --disable-ssl --disable-cool-user-checking" + +collaboraonline_prestart() +{ + if [ ! -d ${collabora_home} ]; then + mkdir -m 700 ${collabora_home} + fi +} + +collaboraonline_start() +{ + check_startmsgs && echo "Starting ${name}." +# su -l cool -c "exec %%PREFIX%%/bin/coolwsd ${flags} ${collaboraonline_flags}" + cd $collabora_home && /usr/sbin/daemon -p $pidfile ${command} \ + %%PREFIX%%/bin/coolwsd ${flags} ${collaboraonline_flags} 2>&1 > /dev/null +} + +collaboraonline_stop() +{ + [ -f $pidfile ] \ + && /bin/kill -INT `cat $pidfile` \ + || echo ${name} not running? \(check ${pidfile}\) +} + +collaboraonline_status() +{ + [ -f $pidfile ] \ + && echo ${name} is running as pid `cat $pidfile` \ + || echo ${name} is not running. +} + +run_rc_command "$1" Index: www/collaboraonline/files/patch-common_security.h =================================================================== --- /dev/null +++ www/collaboraonline/files/patch-common_security.h @@ -0,0 +1,10 @@ +--- common/security.h.orig 2021-12-02 15:17:49 UTC ++++ common/security.h +@@ -61,6 +61,7 @@ inline int isInContainer() + + inline int hasCorrectUID(const char *appName) + { ++ return 1; + #if ENABLE_DEBUG + (void)appName; + return 1; // insecure but easy to use. Index: www/collaboraonline/files/patch-lo-Makefile.in =================================================================== --- /dev/null +++ www/collaboraonline/files/patch-lo-Makefile.in @@ -0,0 +1,20 @@ +--- ../core-8f0115345509b078b2983f3b03822fc1afdc6a9d/Makefile.in.orig 2020-11-22 14:05:28 UTC ++++ ../core-8f0115345509b078b2983f3b03822fc1afdc6a9d/Makefile.in +@@ -268,7 +268,7 @@ endif + # + # Bootstrap + # +-bootstrap: check-if-root compilerplugins ++bootstrap: compilerplugins + + # + # Build +@@ -393,7 +393,7 @@ else + @exit 1 + endif + +-distro-pack-install: install ++distro-pack-install: install-strip + $(SRCDIR)/bin/distro-install-clean-up + $(SRCDIR)/bin/distro-install-desktop-integration + $(SRCDIR)/bin/distro-install-sdk Index: www/collaboraonline/files/patch-lo-configure.ac =================================================================== --- /dev/null +++ www/collaboraonline/files/patch-lo-configure.ac @@ -0,0 +1,20 @@ +--- ../core-8f0115345509b078b2983f3b03822fc1afdc6a9d/configure.ac.orig 2021-11-24 23:57:52.000000000 +0300 ++++ ../core-8f0115345509b078b2983f3b03822fc1afdc6a9d/configure.ac 2021-11-29 17:55:51.014058000 +0300 +@@ -10146,7 +10146,7 @@ + dnl =================================================================== + dnl Check for system mdds + dnl =================================================================== +-libo_CHECK_SYSTEM_MODULE([mdds], [MDDS], [mdds-1.5 >= 1.5.0], ["-I${WORKDIR}/UnpackedTarball/mdds/include"]) ++libo_CHECK_SYSTEM_MODULE([mdds], [MDDS], [mdds-1.7 >= 1.7.0], ["-I${WORKDIR}/UnpackedTarball/mdds/include"]) + + dnl =================================================================== + dnl Check for system glm +@@ -11167,7 +11167,7 @@ + fi + + dnl On Solaris or macOS, check if --with-gnu-patch was used +-if test "$_os" = "SunOS" -o "$_os" = "Darwin" -o "$_os" = "FreeBSD"; then ++if test "$_os" = "SunOS" -o "$_os" = "Darwin"; then + if test -z "$with_gnu_patch"; then + GNUPATCH=$PATCH + else Index: www/collaboraonline/files/patch-tools_mount.cpp =================================================================== --- /dev/null +++ www/collaboraonline/files/patch-tools_mount.cpp @@ -0,0 +1,10 @@ +--- tools/mount.cpp.orig 2021-12-02 15:17:49 UTC ++++ tools/mount.cpp +@@ -218,6 +218,7 @@ int main(int argc, char** argv) + } + else if (strcmp(option, "-r") == 0) // Readonly Mount. + { ++ return EX_OK; + // Now we need to set read-only and other flags with a remount. + int retval = MOUNT(source, target, nullptr, + (MS_BIND | MS_REC | MS_REMOUNT | MS_NOATIME | MS_NODEV | MS_NOSUID Index: www/collaboraonline/files/pkg-message.in =================================================================== --- /dev/null +++ www/collaboraonline/files/pkg-message.in @@ -0,0 +1,29 @@ +[ +{ type: install, + message: <=20:www/nextcloud@${PHP_FLAVOR} + +USES= cpe php:flavors +NO_BUILD= yes +NO_ARCH= yes +CPE_VENDOR= nextcloud + +WWWDIR= ${PREFIX}/www/nextcloud/apps-pkg/${PORTNAME} + +do-install: + @${MKDIR} ${STAGEDIR}${WWWDIR} + @(cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}${WWWDIR}) + @(cd ${WRKSRC}; ${FIND} . -not -type d) | ${SORT} | \ + ${SED} -e 's,^\.,${WWWDIR_REL},' >> ${TMPPLIST} + +.include Index: www/nextcloud-richdocuments/distinfo =================================================================== --- /dev/null +++ www/nextcloud-richdocuments/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1639592134 +SHA256 (nextcloud/richdocuments-5.0.0/richdocuments.tar.gz) = 068f670c4808e98d50cfeffb93a4c298ed4165371bdc5642e52445927d7e3570 +SIZE (nextcloud/richdocuments-5.0.0/richdocuments.tar.gz) = 2937133 Index: www/nextcloud-richdocuments/pkg-descr =================================================================== --- /dev/null +++ www/nextcloud-richdocuments/pkg-descr @@ -0,0 +1,5 @@ +Collabora Online is a powerful LibreOffice-based online office suite with +collaborative editing. This application allows connecting to a Collabora +Online (or other WOPI-like) server from the Nextcloud instance. + +WWW: https://github.com/nextcloud/richdocuments