Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do example as standalone package for DEB #373

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ repo-rpm
apt-rpm/builddir
/apt-rpm/*documentserver*.spec
rpm/builddir
common/documentserver*/**/*.conf
common/documentserver/**/*.conf
common/documentserver-example/**/includes/*.conf
common/documentserver*/nginx/*.tmpl
/common/documentserver/bin/*.sh
common/documentserver/config
Expand Down
82 changes: 79 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ RPM = $(RPM_PACKAGE_DIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)$(RPM_RELEASE_SUFFIX)
DEB = deb/$(PACKAGE_NAME)_$(PACKAGE_VERSION)_$(DEB_ARCH)$(DEB_RELEASE_SUFFIX).deb
EXE = $(EXE_BUILD_DIR)/$(COMPANY_NAME)-$(PRODUCT_NAME)-$(PRODUCT_VERSION).$(BUILD_NUMBER)-x64.exe
TAR = $(TAR_PACKAGE_DIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)$(TAR_RELEASE_SUFFIX)-$(TAR_ARCH).tar.gz
DEB_CORE = deb-core/$(PACKAGE_NAME)-core$(PACKAGE_VERSION)_$(DEB_ARCH)$(DEB_RELEASE:%=~%).deb
DEB_EXAMPLE = deb-example/$(PACKAGE_NAME)-example_$(PACKAGE_VERSION)_$(DEB_ARCH)$(DEB_RELEASE:%=~%).deb

PACKAGE_SERVICES ?= ds-docservice ds-converter ds-metrics

Expand Down Expand Up @@ -134,7 +136,7 @@ else
SHELL_EXT := .sh
ARCH_EXT := .zip
AR := 7z a -y
PACKAGES = deb rpm tar apt-rpm
PACKAGES = deb deb-core deb-example rpm tar apt-rpm
DS_PREFIX := $(COMPANY_NAME_LOW)/$(PRODUCT_SHORT_NAME_LOW)
NGINX_CONF := /etc/nginx/includes
NGINX_LOG := /var/log/$(DS_PREFIX)
Expand Down Expand Up @@ -189,6 +191,7 @@ DEB_DEPS += deb/build/debian/config
DEB_DEPS += deb/build/debian/control
DEB_DEPS += deb/build/debian/copyright
DEB_DEPS += deb/build/debian/postinst
DEB_DEPS += deb/build/debian/preinst
DEB_DEPS += deb/build/debian/postrm
DEB_DEPS += deb/build/debian/prerm
DEB_DEPS += deb/build/debian/rules
Expand All @@ -198,6 +201,40 @@ DEB_DEPS += deb/build/debian/$(PACKAGE_NAME).install
DEB_DEPS += deb/build/debian/$(PACKAGE_NAME).links
DEB_DEPS += deb/build/debian/$(PACKAGE_NAME).dirs

DEB_CORE_DEPS += deb-core/build/debian/source/format
DEB_CORE_DEPS += deb-core/build/debian/changelog
DEB_CORE_DEPS += deb-core/build/debian/compat
DEB_CORE_DEPS += deb-core/build/debian/config
DEB_CORE_DEPS += deb-core/build/debian/control
DEB_CORE_DEPS += deb-core/build/debian/copyright
DEB_CORE_DEPS += deb-core/build/debian/postinst
DEB_CORE_DEPS += deb-core/build/debian/preinst
DEB_CORE_DEPS += deb-core/build/debian/postrm
DEB_CORE_DEPS += deb-core/build/debian/prerm
DEB_CORE_DEPS += deb-core/build/debian/rules
DEB_CORE_DEPS += deb-core/build/debian/templates
DEB_CORE_DEPS += deb-core/build/debian/triggers
DEB_CORE_DEPS += deb-core/build/debian/$(PACKAGE_NAME)-core.install
DEB_CORE_DEPS += deb-core/build/debian/$(PACKAGE_NAME)-core.links
DEB_CORE_DEPS += deb-core/build/debian/$(PACKAGE_NAME)-core.dirs

DEB_EXAMPLE_DEPS += deb-example/build/debian/source/format
DEB_EXAMPLE_DEPS += deb-example/build/debian/changelog
DEB_EXAMPLE_DEPS += deb-example/build/debian/compat
DEB_EXAMPLE_DEPS += deb-example/build/debian/config
DEB_EXAMPLE_DEPS += deb-example/build/debian/control
DEB_EXAMPLE_DEPS += deb-example/build/debian/copyright
DEB_EXAMPLE_DEPS += deb-example/build/debian/postinst
DEB_EXAMPLE_DEPS += deb-example/build/debian/preinst
DEB_EXAMPLE_DEPS += deb-example/build/debian/postrm
DEB_EXAMPLE_DEPS += deb-example/build/debian/prerm
DEB_EXAMPLE_DEPS += deb-example/build/debian/rules
DEB_EXAMPLE_DEPS += deb-example/build/debian/templates
DEB_EXAMPLE_DEPS += deb-example/build/debian/triggers
DEB_EXAMPLE_DEPS += deb-example/build/debian/$(PACKAGE_NAME)-example.install
DEB_EXAMPLE_DEPS += deb-example/build/debian/$(PACKAGE_NAME)-example.links
DEB_EXAMPLE_DEPS += deb-example/build/debian/$(PACKAGE_NAME)-example.dirs

COMMON_DEPS += common/documentserver/nginx/includes/ds-common.conf
COMMON_DEPS += common/documentserver/nginx/includes/ds-docservice.conf
COMMON_DEPS += common/documentserver/nginx/includes/ds-letsencrypt.conf
Expand Down Expand Up @@ -273,7 +310,7 @@ M4_PARAMS += -D M4_PACKAGE_SERVICES='$(PACKAGE_SERVICES)'

.PHONY: all clean clean-docker rpm deb packages deploy-bin

all: rpm deb apt-rpm
all: rpm deb deb-core deb-example apt-rpm

apt-rpm:$(APT_RPM)

Expand All @@ -285,6 +322,10 @@ rpm_aarch64 : $(RPM)

deb: $(DEB)

deb-core: $(DEB_CORE)

deb-example: $(DEB_EXAMPLE)

exe: $(EXE)

tar: $(TAR)
Expand All @@ -296,6 +337,16 @@ clean:
deb/*.changes \
deb/*.ddeb \
deb/*.deb \
deb-core/build \
deb-core/*.buildinfo \
deb-core/*.changes \
deb-core/*.ddeb \
deb-core/*.deb \
deb-example/build \
deb-example/*.buildinfo \
deb-example/*.changes \
deb-example/*.ddeb \
deb-example/*.deb \
$(APT_RPM_BUILD_DIR)\
$(RPM_BUILD_DIR)\
$(TAR_PACKAGE_DIR)/*.tar.gz\
Expand Down Expand Up @@ -492,9 +543,34 @@ deb/build/debian/% : deb/template/%.m4
deb/build/debian/$(PACKAGE_NAME).% : deb/template/package.%.m4
mkdir -pv $(@D) && m4 -I"$(BRANDING_DIR)" $(M4_PARAMS) $< > $@

$(DEB): $(DEB_DEPS) $(COMMON_DEPS) $(LINUX_DEPS) documentserver documentserver-example
deb-core/build/debian/% : deb-core/template/%
mkdir -pv $(@D) && cp -fv $< $@

deb-core/build/debian/% : deb-core/template/%.m4
mkdir -pv $(@D) && m4 -I"$(BRANDING_DIR)" $(M4_PARAMS) -D M4_PACKAGE_VERSION=$(PACKAGE_VERSION)$(DEB_RELEASE:%=~%) $< > $@

deb-core/build/debian/$(PACKAGE_NAME)-core.% : deb-core/template/package.%.m4
mkdir -pv $(@D) && m4 -I"$(BRANDING_DIR)" $(M4_PARAMS) $< > $@

deb-example/build/debian/% : deb-example/template/%
mkdir -pv $(@D) && cp -fv $< $@

deb-example/build/debian/% : deb-example/template/%.m4
mkdir -pv $(@D) && m4 -I"$(BRANDING_DIR)" $(M4_PARAMS) -D M4_PACKAGE_VERSION=$(PACKAGE_VERSION)$(DEB_RELEASE:%=~%) $< > $@

deb-example/build/debian/$(PACKAGE_NAME)-example.% : deb-example/template/package.%.m4
mkdir -pv $(@D) && m4 -I"$(BRANDING_DIR)" $(M4_PARAMS) $< > $@


$(DEB): $(DEB_DEPS)
cd deb/build && dpkg-buildpackage -b -uc -us -a$(DEB_ARCH)

$(DEB_CORE): $(DEB_CORE_DEPS) $(COMMON_DEPS) $(LINUX_DEPS) documentserver
cd deb-core/build && dpkg-buildpackage -b -uc -us -a$(DEB_ARCH)

$(DEB_EXAMPLE): $(DEB_EXAMPLE_DEPS) $(COMMON_DEPS) $(LINUX_DEPS) documentserver-example
cd deb-example/build && dpkg-buildpackage -b -uc -us -a$(DEB_ARCH)

%.exe:
cd $(@D) && $(ISCC) $(ISCC_PARAMS) $(PACKAGE_NAME).iss

Expand Down
43 changes: 43 additions & 0 deletions common/documentserver-example/nginx/ds.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
upstream example {
server localhost:3000;
}

map $http_host $this_host {
"" $host;
default $http_host;
}

map $http_x_forwarded_proto $the_scheme {
default $http_x_forwarded_proto;
"" $scheme;
}

map $http_x_forwarded_host $the_host {
default $http_x_forwarded_host;
"" $this_host;
}

map $http_upgrade $proxy_connection {
default upgrade;
"" close;
}

proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
proxy_set_header X-Forwarded-Host $the_host;
proxy_set_header X-Forwarded-Proto $the_scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;


server {
listen 0.0.0.0:80;
listen [::]:80 default_server;
server_tokens off;

set $secure_link_secret verysecretstring;
include /etc/nginx/includes/ds-example.conf;

#example page
rewrite ^/$ $the_scheme://$the_host/example/ redirect;
}
5 changes: 5 additions & 0 deletions deb-core/template/changelog.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
M4_PACKAGE_NAME-core (M4_PACKAGE_VERSION) stable; urgency=low

* Change details

-- M4_PUBLISHER_NAME <M4_SUPPORT_MAIL> Tue, 28 Apr 2015 09:50:00 +0000
1 change: 1 addition & 0 deletions deb-core/template/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10
60 changes: 60 additions & 0 deletions deb-core/template/config.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/sh

set -e

. /usr/share/debconf/confmodule

DB_TYPE=""
DB_HOST=""
DB_PORT=""
DB_NAME=""
DB_USER=""
DB_PWD=""

db_fset M4_ONLYOFFICE_VALUE/db-type seen true
db_fset M4_ONLYOFFICE_VALUE/cluster-mode seen true
db_fset M4_ONLYOFFICE_VALUE/ds-port seen true
db_fset M4_ONLYOFFICE_VALUE/docservice-port seen true
db_fset M4_ONLYOFFICE_VALUE/example-port seen true
db_fset M4_ONLYOFFICE_VALUE/jwt-enabled seen true
db_fset M4_ONLYOFFICE_VALUE/jwt-secret seen true
db_fset M4_ONLYOFFICE_VALUE/jwt-header seen true

db_input medium M4_ONLYOFFICE_VALUE/db-type || true
db_input medium M4_ONLYOFFICE_VALUE/db-host || true
db_input medium M4_ONLYOFFICE_VALUE/db-port || true
db_input medium M4_ONLYOFFICE_VALUE/db-name || true
db_input medium M4_ONLYOFFICE_VALUE/db-user || true
db_go

db_input critical M4_ONLYOFFICE_VALUE/db-pwd || true
db_go

db_input medium M4_ONLYOFFICE_VALUE/rabbitmq-host || true
db_input medium M4_ONLYOFFICE_VALUE/rabbitmq-user || true
db_input medium M4_ONLYOFFICE_VALUE/rabbitmq-pwd || true

ifelse(eval(ifelse(M4_PRODUCT_NAME,documentserver-ee,1,0)||ifelse(M4_PRODUCT_NAME,documentserver-ie,1,0)||ifelse(M4_PRODUCT_NAME,documentserver-de,1,0)),1,
db_input medium M4_ONLYOFFICE_VALUE/redis-host || true
,)dnl
db_go

db_get M4_ONLYOFFICE_VALUE/db-type
DB_TYPE="$RET"

db_get M4_ONLYOFFICE_VALUE/db-host
DB_HOST="$RET"

db_get M4_ONLYOFFICE_VALUE/db-port
DB_PORT="$RET"

db_get M4_ONLYOFFICE_VALUE/db-name
DB_NAME="$RET"

db_get M4_ONLYOFFICE_VALUE/db-user
DB_USER="$RET"

db_get M4_ONLYOFFICE_VALUE/db-pwd
DB_PWD="$RET"

exit 0
38 changes: 38 additions & 0 deletions deb-core/template/control.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
include(variables.m4)
Source: M4_PACKAGE_NAME-core
Section: web
Priority: optional
Maintainer: M4_PUBLISHER_NAME <M4_SUPPORT_MAIL>
Build-Depends: debhelper (>= 8.0.0)

Replaces: M4_PACKAGE_NAME
Package: M4_PACKAGE_NAME-core
Architecture: M4_DEB_ARCH
Depends: ${shlibs:Depends}, ${misc:Depends},
adduser,
ca-certificates,
coreutils,
curl,
libasound2,
libcairo2,
libcurl3 | libcurl4,
libcurl3-gnutls,
libgconf-2-4,
libgtk-3-0,
libstdc++6 (>= 4.8.4),
libxml2,
libxss1,
libxtst6,
logrotate,
nginx-extras (>= 1.3.13),
postgresql-client (>= 9.1) | mysql-client | mysql-community-client | mariadb-client,
pwgen,
ifelse(eval(ifelse(M4_PRODUCT_NAME,documentserver-ee,1,0)||ifelse(M4_PRODUCT_NAME,documentserver-ie,1,0)||ifelse(M4_PRODUCT_NAME,documentserver-de,1,0)),1,
` redis-tools,'
,)dnl
ttf-mscorefonts-installer,
xvfb,
zlib1g
Recommends:
Description: defn(`DEB[Summary]')
defn(`DEB[Description]')
37 changes: 37 additions & 0 deletions deb-core/template/copyright.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: M4_PUBLISHER_NAME
Upstream-Contact: M4_PUBLISHER_NAME <M4_SUPPORT_MAIL>
Source: M4_PUBLISHER_URL

Files: *
Copyright: (c) Copyright M4_PUBLISHER_NAME, 2020 <M4_SUPPORT_MAIL>

ifdef(COMMERCIAL, License: Commercial,
License: AGPLv3
This program is a free software product. You can redistribute it and/or
modify it under the terms of the GNU Affero General Public License (AGPL)
version 3 as published by the Free Software Foundation. In accordance with
Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
that Ascensio System SIA expressly excludes the warranty of non-infringement
of any third-party rights.

This program is distributed WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html

You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
EU, LV-1021.

The interactive user interfaces in modified source and object code versions
of the Program must display Appropriate Legal Notices, as required under
Section 5 of the GNU AGPL version 3.

Pursuant to Section 7(b) of the License you must retain the original Product
logo when distributing the program. Pursuant to Section 7(e) we decline to
grant you any rights under trademark law for use of our trademarks.

All the Product's GUI elements, including illustrations and icon sets, as
well as technical writing content are licensed under the terms of the
Creative Commons Attribution-ShareAlike 4.0 International. See the License
terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
)
1 change: 1 addition & 0 deletions deb-core/template/package.dirs.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
etc/M4_DS_PREFIX/supervisor
9 changes: 9 additions & 0 deletions deb-core/template/package.install.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
../../common/documentserver/bin/*.sh usr/bin
../../common/documentserver/config/* etc/M4_DS_PREFIX
../../common/documentserver/home/* var/www/M4_DS_PREFIX
../../common/documentserver/nginx/*.tmpl etc/M4_DS_PREFIX/nginx
../../common/documentserver/nginx/includes/*.conf etc/M4_DS_PREFIX/nginx/includes

../../common/documentserver/systemd/*.service /usr/lib/systemd/system

../../common/documentserver/logrotate/*.conf etc/M4_DS_PREFIX/logrotate
21 changes: 21 additions & 0 deletions deb-core/template/package.links.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
etc/M4_DS_PREFIX/logrotate/ds.conf etc/logrotate.d/ds.conf

etc/M4_DS_PREFIX/nginx/includes/ds-common.conf etc/nginx/includes/ds-common.conf
etc/M4_DS_PREFIX/nginx/includes/ds-docservice.conf etc/nginx/includes/ds-docservice.conf
etc/M4_DS_PREFIX/nginx/includes/ds-letsencrypt.conf etc/nginx/includes/ds-letsencrypt.conf
etc/M4_DS_PREFIX/nginx/includes/http-common.conf etc/nginx/includes/http-common.conf
etc/M4_DS_PREFIX/nginx/includes/ds-mime.types.conf etc/nginx/includes/ds-mime.types.conf

var/www/M4_DS_PREFIX/server/FileConverter/bin/libDjVuFile.so lib/libDjVuFile.so
var/www/M4_DS_PREFIX/server/FileConverter/bin/libdoctrenderer.so lib/libdoctrenderer.so
var/www/M4_DS_PREFIX/server/FileConverter/bin/libgraphics.so lib/libgraphics.so
var/www/M4_DS_PREFIX/server/FileConverter/bin/libHtmlFile.so lib/libHtmlFile.so
var/www/M4_DS_PREFIX/server/FileConverter/bin/libHtmlRenderer.so lib/libHtmlRenderer.so
var/www/M4_DS_PREFIX/server/FileConverter/bin/libkernel.so lib/libkernel.so
var/www/M4_DS_PREFIX/server/FileConverter/bin/libkernel_network.so lib/libkernel_network.so
var/www/M4_DS_PREFIX/server/FileConverter/bin/libPdfReader.so lib/libPdfReader.so
var/www/M4_DS_PREFIX/server/FileConverter/bin/libPdfWriter.so lib/libPdfWriter.so
var/www/M4_DS_PREFIX/server/FileConverter/bin/libXpsFile.so lib/libXpsFile.so
var/www/M4_DS_PREFIX/server/FileConverter/bin/libUnicodeConverter.so lib/libUnicodeConverter.so
var/www/M4_DS_PREFIX/server/FileConverter/bin/libicudata.so.58 lib/libicudata.so.58
var/www/M4_DS_PREFIX/server/FileConverter/bin/libicuuc.so.58 lib/libicuuc.so.58
Loading