diff --git a/www/onlyoffice-documentserver/Makefile b/www/onlyoffice-documentserver/Makefile index 9a7379657084..1cf9c135bd32 100644 --- a/www/onlyoffice-documentserver/Makefile +++ b/www/onlyoffice-documentserver/Makefile @@ -1,241 +1,252 @@ PORTNAME= onlyoffice-documentserver DISTVERSIONPREFIX= v DISTVERSION= 7.5.1.23 CATEGORIES= www MASTER_SITES+= LOCAL/mikael/v8/:source1 \ LOCAL/mikael/onlyoffice/:source2 \ https://nodejs.org/dist/v${NODE_VERSION_PKGFETCH}/:source3 \ SF/optipng/OptiPNG/optipng-0.7.7/:source4 DISTFILES+= v8-8.9.255.25_all.tar.gz:source1 \ node-v${NODE_VERSION_PKGFETCH}.tar.gz:source3 \ optipng-0.7.7.tar.gz:source4 \ ${PORTNAME}-${DISTVERSION}-npm-cache.tar.gz:source2 MAINTAINER= mikael@FreeBSD.org COMMENT= Secure office and productivity apps WWW= https://www.onlyoffice.com/ LICENSE= AGPLv3 LICENSE_FILE= ${WRKSRC}/LICENSE.txt BROKEN_i386= fails to build BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}Jinja2>=0:devel/py-Jinja2@${PY_FLAVOR} \ boost-libs>0:devel/boost-libs \ glib>=2.54:devel/glib20 \ gn:devel/gn \ java:java/openjdk11 \ ninja:devel/ninja \ npm:www/npm-node18 \ ${LOCALBASE}/lib/libcrypto.a:security/openssl LIB_DEPENDS= libboost_regex.so:devel/boost-libs \ libcurl.so:ftp/curl \ libharfbuzz.so:print/harfbuzz \ libiconv.so:converters/libiconv \ libicutu.so:devel/icu RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}supervisor>0:sysutils/py-supervisor@${PY_FLAVOR} \ gsed:textproc/gsed \ nginx:www/nginx \ pwgen:sysutils/pwgen \ rabbitmq>0:net/rabbitmq \ webfonts>=0:x11-fonts/webfonts USES= autoreconf:build dos2unix fakeroot gmake gnome iconv localbase nodejs:18,build pkgconfig \ python:3.9+,build qt:5 trigger USE_QT= qmake:build USE_GITHUB= yes GH_ACCOUNT= ONLYOFFICE GH_PROJECT= DocumentServer GH_TAGNAME= v${DISTVERSION:C/^([0-9]+\.[0-9]+\.[0-9]+).*/\1/} GH_TUPLE= ONLYOFFICE:core:v${DISTVERSION}:core/core \ ONLYOFFICE:core-fonts:v${DISTVERSION}:corefonts/core-fonts \ ONLYOFFICE:dictionaries:v${DISTVERSION}:dictionaries/dictionaries \ ONLYOFFICE:document-server-integration:v${DISTVERSION}:dsi/document-server-integration \ ONLYOFFICE:document-templates:v${DISTVERSION}:dt/document-templates \ ONLYOFFICE:sdkjs:v${DISTVERSION}:sdkjs/sdkjs \ ONLYOFFICE:server:v${DISTVERSION}:server/server \ ONLYOFFICE:web-apps:v${DISTVERSION}:webapps/web-apps \ ONLYOFFICE:build_tools:v${DISTVERSION}:buildtools/build_tools \ ONLYOFFICE:DocumentBuilder:626d1e44db3d06ceb8298215a67ef0475912d89a:document_builder/DocumentBuilder \ ONLYOFFICE:onlyoffice.github.io:b26d001664d771df4f663d2d3ba7dd4a188b6cab:sdkjs_plugins_v1/onlyoffice.github.io \ ONLYOFFICE:document-server-package:v${DISTVERSION}:dsp/document-server-package \ jasenhuang:katana-parser:be6df45:jasenhuang_katana/core/Common/3dParty/html/katana-parser \ google:gumbo-parser:aa91b27:google_gumbo/core/Common/3dParty/html/gumbo-parser \ hunspell:hyphen:73dd296:hunspell_hyphen/core/Common/3dParty/hyphen/hyphen OPTIONS_SINGLE= DB OPTIONS_SINGLE_DB= MYSQL PGSQL OPTIONS_DEFAULT= PGSQL MYSQL_USES+= mysql:client PGSQL_USES+= pgsql PGSQL_VARS= WANT_PGSQL=client BINARY_ALIAS= python=${PYTHON_CMD} USE_LDCONFIG= yes WWWDIR= ${PREFIX}/www/onlyoffice ETCDIR= ${PREFIX}/etc/onlyoffice DS_USERNAME= onlyoffice DS_GROUPNAME= onlyoffice USERS= ${DS_USERNAME} GROUPS= ${DS_GROUPNAME} PLIST_SUB= DS_GROUPNAME=${DS_GROUPNAME} \ DS_USERNAME=${DS_USERNAME} SUB_FILES= pkg-message \ onlyoffice.newsyslog.sample SUB_LIST= DS_GROUPNAME=${DS_GROUPNAME} \ DS_USERNAME=${DS_USERNAME} \ ETCDIR=${ETCDIR} \ PREFIX=${PREFIX} \ WWWDIR=${WWWDIR} # node version used with "npm install @yao-pkg/pkg@5.11.1" # keep in sync with patch-build__tools_scripts_build__server.py and patch-document-server-package_Makefile NODE_VERSION_PKGFETCH= 18.18.2 MAKE_ENV= BUILD_NUMBER="36" \ PKG_CACHE_PATH=${WRKDIR}/.pkg-cache \ PRODUCT_VERSION=${DISTVERSION:C/^([0-9]+\.[0-9]+\.[0-9]+).*/\1/} \ BUILD_NUMBER=${DISTVERSION:C/^[0-9]+\.[0-9]+\.[0-9]+\.([0-9]+)/\1/} # Don't create __pycache__ directory when executing node-gyp # This is a workaround to avoid filesystem violations during poudriere build MAKE_ENV+= PYTHONDONTWRITEBYTECODE=1 DOS2UNIX_FILES= document-server-package/common/documentserver/nginx/includes/http-common.conf.m4 CONFLICTS_BUILD=devel/googletest +.include +.if ${ARCH} == aarch64 +BUILD_DEPENDS+= clang${LLVM_DEFAULT}:devel/llvm${LLVM_DEFAULT} +BINARY_ALIAS+= cpp=${LOCALBASE}/bin/clang-cpp${LLVM_DEFAULT} \ + cc=${LOCALBASE}/bin/clang${LLVM_DEFAULT} \ + c++=${LOCALBASE}/bin/clang++${LLVM_DEFAULT} \ + ar=${LOCALBASE}/bin/llvm-ar${LLVM_DEFAULT} \ + nm=${LOCALBASE}/bin/llvm-nm${LLVM_DEFAULT} \ + ld=${LOCALBASE}/bin/ld.lld${LLVM_DEFAULT} +.endif + post-extract: @${MV} ${WRKDIR}/v8 ${WRKSRC}/core/Common/3dParty/v8_89 @${MKDIR} ${WRKDIR}/.pkg-cache/node @${CP} ${DISTDIR}/node-v${NODE_VERSION_PKGFETCH}.tar.gz ${WRKDIR}/.pkg-cache/node @${MKDIR} ${WRKSRC}/sdkjs-plugins/v1 @${CP} ${WRKSRC}/onlyoffice.github.io/sdkjs-plugins/v1/* ${WRKSRC}/sdkjs-plugins/v1 @${MV} ${WRKSRC}/server/Common/config/production-linux.json ${WRKSRC}/server/Common/config/production-freebsd.json @${MV} ${WRKSRC}/server/Common/config/development-linux.json ${WRKSRC}/server/Common/config/development-freebsd.json # linux has moved to systemd init files, continue to using supervisord for now ${MKDIR} ${WRKSRC}/document-server-package/common/documentserver/supervisor .for i in ds-converter.conf ds-docservice.conf ds-metrics.conf ds.conf ${CP} ${FILESDIR}/${i} \ ${WRKSRC}/document-server-package/common/documentserver/supervisor .endfor post-patch: @${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|' \ ${WRKSRC}/build_tools/tools/freebsd/automate.py \ ${WRKSRC}/core/Common/3dParty/boost/boost.pri \ ${WRKSRC}/core/Common/3dParty/icu/icu.pri \ ${WRKSRC}/core/Common/3dParty/openssl/openssl.pri \ ${WRKSRC}/core/Common/3dParty/v8_89/v8/build/toolchain/gcc_toolchain.gni \ ${WRKSRC}/core/Common/3dParty/v8_89/v8/buildtools/third_party/libc++/BUILD.gn \ ${WRKSRC}/core/DesktopEditor/fontengine/ApplicationFonts.cpp \ ${WRKSRC}/document-server-package/common/documentserver/bin/documentserver-generate-allfonts.sh.m4 \ ${WRKSRC}/document-server-package/common/documentserver/bin/documentserver-jwt-status.sh.m4 \ ${WRKSRC}/document-server-package/common/documentserver/bin/documentserver-pluginsmanager.sh.m4 \ ${WRKSRC}/document-server-package/common/documentserver/bin/documentserver-static-gzip.sh.m4 \ ${WRKSRC}/document-server-package/common/documentserver/bin/documentserver-update-securelink.sh.m4 \ ${WRKSRC}/document-server-package/common/documentserver/supervisor/ds-converter.conf \ ${WRKSRC}/document-server-package/common/documentserver/supervisor/ds-docservice.conf \ ${WRKSRC}/document-server-package/common/documentserver/supervisor/ds-metrics.conf @${REINPLACE_CMD} -e 's|%%CC%%|${CC}|' -e 's|%%CXX%%|${CXX}|' \ ${WRKSRC}/core/Common/3dParty/v8_89/v8/build/toolchain/gcc_toolchain.gni \ ${WRKSRC}/core/Common/base.pri @${REINPLACE_CMD} 's|%%WRKDIR%%|${WRKDIR}|' \ ${WRKSRC}/document-server-package/Makefile @${REINPLACE_CMD} 's|%%WRKSRC%%|${WRKSRC}|' \ ${WRKSRC}/build_tools/scripts/build_js.py \ ${WRKSRC}/build_tools/scripts/build_server.py \ ${WRKSRC}/document-server-package/Makefile @${REINPLACE_CMD} -e 's|/var/lib|/var/db|' -e 's|/var/www|${LOCALBASE}/www|' \ -e 's|/usr/share|${LOCALBASE}/share|' -e 's|/etc|${LOCALBASE}/etc|' \ ${WRKSRC}/server/Common/config/production-freebsd.json \ ${WRKSRC}/server/Common/config/development-freebsd.json @${REINPLACE_CMD} 's|%%DISTDIR%%|${DISTDIR}|' \ ${WRKSRC}/web-apps/build/patches/optipng-bin+5.1.0.patch @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' -e 's|%%ETCDIR%%|${ETCDIR}|' \ ${WRKSRC}/document-server-package/Makefile @${RM} ${WRKSRC}/web-apps/build/patches/optipng-bin+5.1.0.patch.orig @${FIND} ${WRKSRC}/server -type f -name npm-shrinkwrap.json -delete @${ECHO} "# Generated from 'DEPS'" > ${WRKSRC}/core/Common/3dParty/v8_89/v8/build/config/gclient_args.gni @${ECHO} "checkout_google_benchmark = false" >> ${WRKSRC}/core/Common/3dParty/v8_89/v8/build/config/gclient_args.gni do-build: ${INSTALL_SCRIPT} ${FILESDIR}/npm ${BINARY_LINKDIR}/npm @${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|' ${WRKDIR}/.bin/npm @cd ${WRKSRC}/web-apps/build ; ${SETENV} ${MAKE_ENV} npm install patch-package @cd ${WRKSRC}/web-apps/build ; ${SETENV} ${MAKE_ENV} npm install optipng-bin@5.1.0 @cd ${WRKSRC}/web-apps/build ; node_modules/.bin/patch-package @cd ${WRKSRC}/web-apps/build/node_modules/optipng-bin ; ${SETENV} ${MAKE_ENV} npm run postinstall optipng-bin @cd ${WRKSRC}/server ; ${SETENV} ${MAKE_ENV} npm install grunt-cli @cd ${WRKSRC}/server ; ${SETENV} ${MAKE_ENV} npm install grunt @cd ${WRKSRC}/server ; ${SETENV} ${MAKE_ENV} npm install @yao-pkg/pkg@5.11.1 @cd ${WRKSRC}/sdkjs ; ${SETENV} ${MAKE_ENV} npm install grunt-cli @cd ${WRKSRC}/sdkjs ; ${SETENV} ${MAKE_ENV} npm install grunt @cd ${WRKSRC} && ${PATCH} -N -s -i ${FILESDIR}/extra-patch-pkg-fetch_lib-es5_build.js || ${TRUE} @cd ${WRKSRC} && ${PATCH} -N -s -i ${FILESDIR}/extra-patch-pkg-fetch_patches_node.v${NODE_VERSION_PKGFETCH}.cpp.patch || ${TRUE} cd ${WRKSRC}/build_tools/tools/freebsd ; ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} automate.py cd ${WRKSRC}/document-server-package ; ${SETENV} ${MAKE_ENV} ${GMAKE} freebsd do-install: # install the project # do not strip docservice, converter, metrics and json cd ${WRKSRC}/document-server-package/common/documentserver/home && ${COPYTREE_SHARE} . ${STAGEDIR}${WWWDIR}/documentserver ${INSTALL_SCRIPT} ${WRKSRC}/document-server-package/common/documentserver/bin/*.sh ${STAGEDIR}${PREFIX}/bin ${INSTALL_PROGRAM} ${WRKSRC}/document-server-package/common/documentserver/home/server/tools/all* ${STAGEDIR}${WWWDIR}/documentserver/server/tools ${INSTALL_PROGRAM} ${WRKSRC}/document-server-package/common/documentserver/home/server/FileConverter/bin/x2t ${STAGEDIR}${WWWDIR}/documentserver/server/FileConverter/bin ${INSTALL_PROGRAM} ${WRKSRC}/document-server-package/common/documentserver/home/server/FileConverter/bin/docbuilder ${STAGEDIR}${WWWDIR}/documentserver/server/FileConverter/bin ${INSTALL_PROGRAM} ${WRKSRC}/document-server-package/common/documentserver/home/server/tools/pluginsmanager ${STAGEDIR}${WWWDIR}/documentserver/server/tools ${INSTALL_DATA} ${WRKSRC}/document-server-package/common/documentserver/home/npm/json ${STAGEDIR}${WWWDIR}/documentserver/npm ${INSTALL_LIB} ${WRKSRC}/document-server-package/common/documentserver/home/server/FileConverter/bin/*.so ${STAGEDIR}${PREFIX}/lib ${RM} ${STAGEDIR}${PREFIX}/bin/documentserver-letsencrypt.sh # install conf ${MKDIR} ${STAGEDIR}${ETCDIR}/documentserver/supervisor \ ${STAGEDIR}${ETCDIR}/documentserver/nginx/includes \ ${STAGEDIR}${ETCDIR}/documentserver/logrotate ${RM} ${WRKSRC}/document-server-package/common/documentserver/config/*-mac.json ${WRKSRC}/document-server-package/common/documentserver/config/*-windows.json cd ${WRKSRC}/document-server-package/common/documentserver/supervisor && ${COPYTREE_SHARE} . ${STAGEDIR}${ETCDIR}/documentserver/supervisor "-name *\.conf" cd ${WRKSRC}/document-server-package/common/documentserver/logrotate && ${COPYTREE_SHARE} . ${STAGEDIR}${ETCDIR}/documentserver/logrotate "-name *\.conf" @${CP} ${WRKSRC}/document-server-package/common/documentserver/nginx/ds-ssl.conf.tmpl ${WRKSRC}/document-server-package/common/documentserver/nginx/ds-ssl.conf .for f in ds.conf ds-ssl.conf includes/http-common.conf includes/ds-common.conf includes/ds-docservice.conf includes/ds-letsencrypt.conf includes/ds-mime.types.conf ${INSTALL_DATA} ${WRKSRC}/document-server-package/common/documentserver/nginx/${f} ${STAGEDIR}${ETCDIR}/documentserver/nginx/${f}.sample .endfor cd ${WRKSRC}/document-server-package/common/documentserver/nginx/includes && ${COPYTREE_SHARE} . ${STAGEDIR}${ETCDIR}/documentserver/nginx/includes "-name *\.conf" cd ${WRKSRC}/document-server-package/common/documentserver/config && ${COPYTREE_SHARE} . ${STAGEDIR}${ETCDIR}/documentserver ${INSTALL_DATA} ${FILESDIR}/local.json.sample ${STAGEDIR}${ETCDIR}/documentserver ${MKDIR} ${STAGEDIR}/${ETCDIR}/documentserver/newsyslog.conf.d ${INSTALL_DATA} ${WRKDIR}/onlyoffice.newsyslog.sample ${STAGEDIR}/${ETCDIR}/documentserver/newsyslog.conf.d # create missing dir ${MKDIR} ${STAGEDIR}/var/log/onlyoffice/documentserver/docservice \ ${STAGEDIR}/var/log/onlyoffice/documentserver/converter \ ${STAGEDIR}/var/log/onlyoffice/documentserver/metrics \ ${STAGEDIR}/var/db/onlyoffice/documentserver/App_Data/cache/files \ ${STAGEDIR}/var/db/onlyoffice/documentserver/App_Data/docbuilder \ ${STAGEDIR}${WWWDIR}/Data \ ${STAGEDIR}${WWWDIR}/documentserver/fonts create-caches-tarball: # do some cleanup first ${RM} -r ${WRKDIR}/.npm/_logs ${WRKDIR}/.npm/_update-notifier-last-checked ${WRKDIR}/.cache/yarn/v6/.tmp ${WRKDIR}/.cache/node-gyp # ${FIND} ${WRKDIR}/.cache -type f -perm 755 -exec file {} \; | ${EGREP} "ELF|PE32+|Mach-O" | ${AWK} -F ':' '{print $$1}' | ${XARGS} ${RM} ${FIND} ${WRKDIR}/.pkg-cache -type f -perm 755 -exec file {} \; | ${EGREP} "ELF|PE32+|Mach-O" | ${AWK} -F ':' '{print $$1}' | ${XARGS} ${RM} cd ${WRKDIR} && \ ${TAR} czf ${PORTNAME}-${DISTVERSION}-npm-cache.tar.gz .npm .pkg-cache -.include +.include diff --git a/www/onlyoffice-documentserver/files/extra-patch-pkg-fetch_lib-es5_build.js b/www/onlyoffice-documentserver/files/extra-patch-pkg-fetch_lib-es5_build.js index b45253b02607..e8cc8e840655 100644 --- a/www/onlyoffice-documentserver/files/extra-patch-pkg-fetch_lib-es5_build.js +++ b/www/onlyoffice-documentserver/files/extra-patch-pkg-fetch_lib-es5_build.js @@ -1,33 +1,38 @@ --- server/node_modules/@yao-pkg/pkg-fetch/lib-es5/build.js.orig 2024-01-25 21:40:25.773587000 +0100 +++ server/node_modules/@yao-pkg/pkg-fetch/lib-es5/build.js 2024-01-25 21:41:12.907517000 +0100 @@ -99,12 +99,6 @@ function getConfigureArgs(major, targetPlatform) { if (targetPlatform === 'linuxstatic') { args.push('--fully-static'); } - // Link Time Optimization - if (major >= 12) { - if (system_1.hostPlatform !== 'win') { - args.push('--enable-lto'); - } - } // production binaries do NOT take NODE_OPTIONS from end-users args.push('--without-node-options'); // The dtrace and etw support was removed in https://github.com/nodejs/node/commit/aa3a572e6bee116cde69508dc29478b40f40551a -@@ -115,7 +109,9 @@ function getConfigureArgs(major, targetPlatform) { +@@ -115,7 +109,14 @@ function getConfigureArgs(major, targetPlatform) { // bundled npm package manager args.push('--without-npm'); // Small ICU - args.push('--with-intl=small-icu'); + args.push('--with-intl=system-icu'); + args.push('--shared-openssl'); + args.push('--openssl-use-def-ca-store'); ++ args.push('--shared-brotli'); ++ args.push('--shared-cares'); ++ args.push('--shared-libuv'); ++ args.push('--shared-nghttp2'); ++ args.push('--shared-zlib'); // Workaround for nodejs/node#39313 // All supported macOS versions have zlib as a system library if (targetPlatform === 'macos') { -@@ -433,4 +429,4 @@ exports.default = build; +@@ -433,4 +434,4 @@ exports.default = build; }); } exports.default = build; -//# sourceMappingURL=build.js.map \ No newline at end of file +//# sourceMappingURL=build.js.map diff --git a/www/onlyoffice-documentserver/files/patch-document-server-package_Makefile b/www/onlyoffice-documentserver/files/patch-document-server-package_Makefile index 091c7e43df5c..c760d9de5b5b 100644 --- a/www/onlyoffice-documentserver/files/patch-document-server-package_Makefile +++ b/www/onlyoffice-documentserver/files/patch-document-server-package_Makefile @@ -1,160 +1,160 @@ --- document-server-package/Makefile.orig 2023-02-13 11:11:48.689223000 +0100 +++ document-server-package/Makefile 2023-02-13 11:27:26.937335000 +0100 @@ -23,6 +23,7 @@ PACKAGE_VERSION := $(PRODUCT_VERSION)-$(BUILD_NUMBER) PACKAGE_NAME := $(COMPANY_NAME_LOW)-$(PRODUCT_NAME_LOW) PACKAGE_VERSION := $(PRODUCT_VERSION)-$(BUILD_NUMBER) +UNAME_P ?= $(shell uname -p) UNAME_M ?= $(shell uname -m) ifeq ($(UNAME_M),x86_64) RPM_ARCH := x86_64 @@ -143,6 +144,22 @@ else DS_EXAMLE := /var/www/$(DS_PREFIX)-example DEV_NULL := /dev/null endif + ifeq ($(UNAME_S),FreeBSD) + PLATFORM := freebsd + SHARED_EXT := .so* + SHELL_EXT := .sh + ARCH_EXT := .zip + AR := 7z a -y + PACKAGES = tar + DS_PREFIX := $(COMPANY_NAME_LOW)/$(PRODUCT_SHORT_NAME_LOW) + NGINX_CONF := /usr/local/etc/onlyoffice/documentserver/nginx/includes + NGINX_LOG := /var/log/$(DS_PREFIX) + DS_ROOT := /usr/local/www/$(DS_PREFIX) + DS_FILES := /var/db/$(DS_PREFIX) + DS_EXAMLE := /usr/local/www/$(DS_PREFIX)-example + DEV_NULL := /dev/null -+ PKG_TARGET := node18-freebsd-x64 ++ PKG_TARGET := node18 + endif ifeq ($(UNAME_S),Darwin) PLATFORM := mac SHARED_EXT := .dylib @@ -160,6 +177,12 @@ else ifeq ($(UNAME_M),x86_64) ARCHITECTURE := 64 endif + ifeq ($(UNAME_P),amd64) + ARCHITECTURE := 64 + endif + ifeq ($(UNAME_P),aarch64) + ARCHITECTURE := 64 + endif ifneq ($(filter %86,$(UNAME_M)),) ARCHITECTURE := 32 endif @@ -319,7 +342,7 @@ documentserver: documentserver: mkdir -p $(DOCUMENTSERVER_FILES) - cp -rf -t $(DOCUMENTSERVER) ../build_tools/out/$(TARGET)/$(COMPANY_NAME_LOW)/$(PRODUCT_SHORT_NAME_LOW)/* + cp -rf ../build_tools/out/$(TARGET)/$(COMPANY_NAME_LOW)/$(PRODUCT_SHORT_NAME_LOW)/* $(DOCUMENTSERVER) mkdir -p $(DOCUMENTSERVER_CONFIG) mkdir -p $(DOCUMENTSERVER_CONFIG)/log4js @@ -328,25 +351,25 @@ documentserver: mv -f $(DOCUMENTSERVER)/server/Common/config/log4js/*.json $(DOCUMENTSERVER_CONFIG)/log4js/ # rename product specific folders - sed "s|onlyoffice\/documentserver|"$(DS_PREFIX)"|" -i $(DOCUMENTSERVER_CONFIG)/*.json + sed -i '' "s|onlyoffice\/documentserver|"$(DS_PREFIX)"|" $(DOCUMENTSERVER_CONFIG)/*.json # rename db account params - sed 's|\("db.*": "\)onlyoffice\("\)|\1'$(ONLYOFFICE_VALUE)'\2|' -i $(DOCUMENTSERVER_CONFIG)/*.json + sed -i '' 's|\("db.*": "\)onlyoffice\("\)|\1'$(ONLYOFFICE_VALUE)'\2|' $(DOCUMENTSERVER_CONFIG)/*.json # rename db schema name - sed 's|onlyoffice|'$(ONLYOFFICE_VALUE)'|' -i $(DOCUMENTSERVER)/server/schema/**/*.sql + sed -i '' 's|onlyoffice|'$(ONLYOFFICE_VALUE)'|' $(DOCUMENTSERVER)/server/schema/**/*.sql # ignore CREATE DATABASE commands in MySQL - sed -r "s/^(CREATE DATABASE|USE)/-- \1/" -i $(DOCUMENTSERVER)/server/schema/mysql/*.sql + sed -i '' -r "s/^(CREATE DATABASE|USE)/-- \1/" $(DOCUMENTSERVER)/server/schema/mysql/*.sql # rename product in license - sed 's|ONLYOFFICE|'$(COMPANY_NAME)'|' -i $(DOCUMENTSERVER)/server/3rd-Party.txt - sed 's|DocumentServer|'$(PRODUCT_NAME)'|' -i $(DOCUMENTSERVER)/server/3rd-Party.txt + sed -i '' 's|ONLYOFFICE|'$(COMPANY_NAME)'|' $(DOCUMENTSERVER)/server/3rd-Party.txt + sed -i '' 's|DocumentServer|'$(PRODUCT_NAME)'|' $(DOCUMENTSERVER)/server/3rd-Party.txt # Prevent for modification original config chmod ug=r $(DOCUMENTSERVER_CONFIG)/*.json - cp -fr -t $(DOCUMENTSERVER) $(3RD_PARTY_LICENSE_FILES) + cp -fr $(3RD_PARTY_LICENSE_FILES) $(DOCUMENTSERVER) rm -fr $(3RD_PARTY_LICENSE_FILES) ifeq ($(PLATFORM),win) @@ -356,34 +379,34 @@ endif endif [ -f $(LICENSE_FILE) ] \ - && cp -f -t $(DOCUMENTSERVER) $(LICENSE_FILE) \ - || cp -f -t $(DOCUMENTSERVER) LICENSE.txt + && cp -f $(LICENSE_FILE) $(DOCUMENTSERVER) \ + || cp -f LICENSE.txt $(DOCUMENTSERVER) chmod u+x $(DOCUMENTSERVER)/server/FileConverter/bin/x2t$(EXEC_EXT) #chmod u+x $(DOCUMENTSERVER)/server/FileConverter/bin/docbuilder$(EXEC_EXT) [ -f $(HTMLFILEINTERNAL)$(EXEC_EXT) ] && chmod u+x $(HTMLFILEINTERNAL)$(EXEC_EXT) || true chmod u+x $(DOCUMENTSERVER)/server/tools/allfontsgen$(EXEC_EXT) - sed "s|\(_dc=\)0|\1"$(PACKAGE_VERSION)"|" -i $(DOCUMENTSERVER)/web-apps/apps/api/documents/api.js + sed -i '' "s|\(_dc=\)0|\1"$(PACKAGE_VERSION)"|" $(DOCUMENTSERVER)/web-apps/apps/api/documents/api.js ifeq ($(PRODUCT_NAME_LOW), documentserver) - sed 's|\("packageType": \)[0-9]\+\(.*\)|\10\2|' -i $(DOCUMENTSERVER_CONFIG)/*.json - sed 's|\("editorDataStorage": "\).\+\(".*\)|\1editorDataMemory\2|' -i $(DOCUMENTSERVER_CONFIG)/*.json + sed -i '' 's|\("packageType": \)[0-9]\+\(.*\)|\10\2|' $(DOCUMENTSERVER_CONFIG)/*.json + sed -i '' 's|\("editorDataStorage": "\).\+\(".*\)|\1editorDataMemory\2|' $(DOCUMENTSERVER_CONFIG)/*.json endif ifeq ($(PRODUCT_NAME_LOW), $(filter $(PRODUCT_NAME_LOW),documentserver-ee documentserver-ie)) - sed 's|\("packageType": \)[0-9]\+\(.*\)|\11\2|' -i $(DOCUMENTSERVER_CONFIG)/*.json - sed 's|\("editorDataStorage": "\).\+\(".*\)|\1editorDataRedis\2|' -i $(DOCUMENTSERVER_CONFIG)/*.json + sed -i '' 's|\("packageType": \)[0-9]\+\(.*\)|\11\2|' $(DOCUMENTSERVER_CONFIG)/*.json + sed -i '' 's|\("editorDataStorage": "\).\+\(".*\)|\1editorDataRedis\2|' $(DOCUMENTSERVER_CONFIG)/*.json endif ifeq ($(PRODUCT_NAME_LOW), documentserver-de) - sed 's|\("packageType": \)[0-9]\+\(.*\)|\12\2|' -i $(DOCUMENTSERVER_CONFIG)/*.json - sed 's|\("editorDataStorage": "\).\+\(".*\)|\1editorDataRedis\2|' -i $(DOCUMENTSERVER_CONFIG)/*.json + sed -i '' 's|\("packageType": \)[0-9]\+\(.*\)|\12\2|' $(DOCUMENTSERVER_CONFIG)/*.json + sed -i '' 's|\("editorDataStorage": "\).\+\(".*\)|\1editorDataRedis\2|' $(DOCUMENTSERVER_CONFIG)/*.json endif cd $(DOCUMENTSERVER)/npm && \ npm install && \ - pkg ./node_modules/json $(PKG_TARGET:%=-t %) -o json + env PKG_CACHE_PATH=%%WRKDIR%%/.pkg-cache "%%WRKSRC%%/server/node_modules/.bin/pkg" ./node_modules/json $(PKG_TARGET:%=-t %) -o json ifeq ($(PLATFORM),win) cd $(DOCUMENTSERVER)/npm && \ @@ -397,7 +420,7 @@ documentserver-example: documentserver-example: mkdir -p $(DOCUMENTSERVER_EXAMPLE) - cp -rf -t $(DOCUMENTSERVER_EXAMPLE) ../build_tools/out/$(TARGET)/$(COMPANY_NAME_LOW)/$(PRODUCT_SHORT_NAME_LOW)-example/* common/documentserver-example/welcome + cp -rf ../build_tools/out/$(TARGET)/$(COMPANY_NAME_LOW)/$(PRODUCT_SHORT_NAME_LOW)-example/* common/documentserver-example/welcome $(DOCUMENTSERVER_EXAMPLE) mkdir -p $(DOCUMENTSERVER_EXAMPLE_CONFIG) @@ -406,7 +429,7 @@ documentserver-example: # Prevent for modification original config chmod ug=r $(DOCUMENTSERVER_EXAMPLE_CONFIG)/*.json - sed "s|{{OFFICIAL_PRODUCT_NAME}}|"$(OFFICIAL_PRODUCT_NAME)"|" -i $(DOCUMENTSERVER_EXAMPLE)/welcome/*.html + sed -i '' "s|{{OFFICIAL_PRODUCT_NAME}}|"$(OFFICIAL_PRODUCT_NAME)"|" $(DOCUMENTSERVER_EXAMPLE)/welcome/*.html /usr/bin/find $(DOCUMENTSERVER_EXAMPLE)/welcome -depth -type f -exec sed -i "s_{{year}}_$(shell date +"%Y")_g" {} \; @@ -499,6 +522,8 @@ $(DEB): $(DEB_DEPS) $(COMMON_DEPS) $(LINUX_DEPS) docum %.exe: cd $(@D) && $(ISCC) $(ISCC_PARAMS) common.iss + +freebsd: $(COMMON_DEPS) $(LINUX_DEPS) documentserver $(EXE): $(COMMON_DEPS) documentserver documentserver-example $(NGINX) $(PSQL) $(NSSM)