--- cluster-manager-18.02.0.rc13.24.g7f3cda9.orig/debian/Makefile
+++ cluster-manager-18.02.0.rc13.24.g7f3cda9/debian/Makefile
@@ -0,0 +1,24 @@
+
+default:
+	ln -sf $(PKG_ID).tar.gz ../cluster-manager_$(PKG_VERSION).orig.tar.gz
+	export DEBFULLNAME="Onedata Package Maintainer"; \
+	export DEBEMAIL="support@onedata.org"; \
+	dch  --create --package cluster-manager -v "$(PKG_VERSION)-$(PKG_BUILD)" \
+             "Build from $(PKG_VERSION)";\
+	debuild --prepend-path=$(ERLANG_BIN) \
+		-e REVISION="$(PKG_VERSION)" \
+		-e RELEASE="$(PKG_BUILD)" \
+		-e REBAR="$(REBAR)" \
+		 \
+		-uc -us -S
+	mkdir -p ../packages
+	cd .. && sg sbuild -c "sbuild -sd $(DISTRIBUTION) -j4 *$(PKG_VERSION)-$(PKG_BUILD).dsc"
+	cd .. && mv *$(PKG_VERSION).orig.tar.gz packages
+	cd .. && mv *$(PKG_VERSION)-$(PKG_BUILD).dsc packages
+	cd .. && mv *$(PKG_VERSION)-$(PKG_BUILD).diff.gz packages
+	cd .. && mv *$(PKG_VERSION)-$(PKG_BUILD)_amd64.changes packages
+	cd .. && mv *$(PKG_VERSION)-$(PKG_BUILD)_*.deb packages
+	cd ../packages && \
+		for debfile in *.deb; do \
+			sha256sum $${debfile} > $${debfile}.sha \
+		; done
--- cluster-manager-18.02.0.rc13.24.g7f3cda9.orig/debian/changelog
+++ cluster-manager-18.02.0.rc13.24.g7f3cda9/debian/changelog
@@ -0,0 +1,5 @@
+cluster-manager (18.02.0.rc13.24.g7f3cda9-1) UNRELEASED; urgency=medium
+
+  * Build from 18.02.0.rc13.24.g7f3cda9
+
+ -- Onedata Package Maintainer <support@onedata.org>  Wed, 22 May 2019 21:29:29 +0000
--- cluster-manager-18.02.0.rc13.24.g7f3cda9.orig/debian/compat
+++ cluster-manager-18.02.0.rc13.24.g7f3cda9/debian/compat
@@ -0,0 +1 @@
+7
--- cluster-manager-18.02.0.rc13.24.g7f3cda9.orig/debian/control
+++ cluster-manager-18.02.0.rc13.24.g7f3cda9/debian/control
@@ -0,0 +1,16 @@
+Source: cluster-manager
+Section: net
+Priority: extra
+Maintainer: Onedata Package Maintainer <support@onedata.org>
+Build-Depends: debhelper (>= 7), automake, cmake (>= 3.0.0), erlang (>= 18.0), erlang-src (>= 18.0), folly-dev (>= 2017.10.02.00), g++ (>= 4.9.0), git, golang-go, libsodium-dev, libtool, ninja-build, pkg-config, openssl, python
+Standards-Version: 3.9.3
+Homepage: https://onedata.org
+
+Package: cluster-manager
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}, adduser, logrotate, sudo, folly
+Homepage: https://onedata.org
+Description: Oneprovider cluster manager
+  The manager of oneprovider cluster providing storage resources, part of onedata project
+
+
--- cluster-manager-18.02.0.rc13.24.g7f3cda9.orig/debian/copyright
+++ cluster-manager-18.02.0.rc13.24.g7f3cda9/debian/copyright
@@ -0,0 +1,26 @@
+Format: http://dep.debian.net/deps/dep5
+Upstream-Name: cluster-manager
+Upstream-Contact: Onedata Package Maintainer <support@onedata.org>
+
+Files: *
+Copyright: 2016 ACK CYFRONET AGH
+License: MIT
+  Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use, copy,
+modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
--- cluster-manager-18.02.0.rc13.24.g7f3cda9.orig/debian/dirs
+++ cluster-manager-18.02.0.rc13.24.g7f3cda9/debian/dirs
@@ -0,0 +1,9 @@
+etc/init.d
+etc/cluster_manager
+etc/logrotate.d
+usr/lib/cluster_manager
+usr/bin
+usr/share/man/man1
+var/run/cluster_manager
+var/lib/cluster_manager
+var/log/cluster_manager
--- cluster-manager-18.02.0.rc13.24.g7f3cda9.orig/debian/init.script
+++ cluster-manager-18.02.0.rc13.24.g7f3cda9/debian/init.script
@@ -0,0 +1,147 @@
+#! /bin/bash
+### BEGIN INIT INFO
+# Provides:          cluster-manager
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Oneprovider cluster manager
+# Description:       The manager of oneprovider cluster providing storage resources, part of onedata project
+### END INIT INFO
+
+NAME=cluster_manager
+DAEMON=/usr/bin/$NAME
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Load the VERBOSE setting and other rcS variables
+. /lib/init/vars.sh
+. /lib/lsb/init-functions
+
+# `service` strips all environmental VARS so
+# if no HOME was set in /etc/default/$NAME then set one here
+# to the data directory for erlexec's sake
+if [ -z "$HOME" ]; then
+    export HOME=/var/lib/cluster_manager
+fi
+
+#
+# Function that starts the daemon/service
+#
+do_start()
+{
+    # Return
+    #   0 if daemon has been started
+    #   1 if daemon was already running
+    #   2 if daemon could not be started
+
+    # Startup with the appropriate user
+    start-stop-daemon --start \
+        --name cluster_manager \
+        --user cluster_manager \
+        --exec $DAEMON -- start \
+        || return 2
+}
+
+#
+# Function that stops the daemon/service
+#
+do_stop()
+{
+    # Identify the erts directory
+    ERTS_PATH=`$DAEMON ertspath`
+
+    # Attempt a clean shutdown.
+    $DAEMON stop
+
+    # Return
+    #   0 if daemon has been stopped
+    #   1 if daemon was already stopped
+    #   2 if daemon could not be stopped
+    #   other if a failure occurred
+    # Make sure it's down by using a more direct approach
+    start-stop-daemon --stop \
+                      --quiet \
+                      --retry=TERM/30/KILL/5 \
+                      --user cluster_manager \
+                      --exec $ERTS_PATH/run_erl
+    return $?
+}
+
+#
+# Function that graceful reload the daemon/service
+#
+do_reload() {
+    # Restart the VM without exiting the process
+    $DAEMON restart && return $? || return 2
+}
+
+# Checks the status of a node
+do_status() {
+    $DAEMON ping && echo $"$NAME is running" && return 0
+    echo $"$NAME is stopped" && return 2
+}
+
+case "$1" in
+    start)
+        [ "$VERBOSE" != no ] && log_daemon_msg "Starting $NAME"
+        $DAEMON ping >/dev/null 2>&1 && echo $"$NAME is already running" && exit 0
+        do_start
+        case "$?" in
+            0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+            2) [ "$VERBOSE" != no ] && log_end_msg 1
+                exit 1
+                ;;
+        esac
+        ;;
+    stop)
+        [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $NAME"
+        do_stop
+        case "$?" in
+            0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+            2) [ "$VERBOSE" != no ] && log_end_msg 1
+                exit 1
+                ;;
+        esac
+        ;;
+    ping)
+        # See if the VM is alive
+        $DAEMON ping || exit $?
+        ;;
+    reload|force-reload)
+        log_daemon_msg "Reloading $NAME"
+        do_reload
+        ES=$?
+        log_end_msg $ES
+        exit $ES
+        ;;
+    restart)
+        log_daemon_msg "Restarting $NAME"
+        do_stop
+        case "$?" in
+            0|1)
+                do_start
+                case "$?" in
+                    0) log_end_msg 0 ;;
+                    1) log_end_msg 1 && exit 1 ;; # Old process is still running
+                    *) log_end_msg 1 && exit 1 ;; # Failed to start
+                esac
+                ;;
+            *)
+                # Failed to stop
+                log_end_msg 1 && exit 1
+                ;;
+        esac
+        ;;
+    status)
+        do_status && exit 0 || exit $?
+        ;;
+    *)
+        echo "Usage: $SCRIPTNAME {start|stop|ping|restart|force-reload|status}" >&2
+        exit 3
+        ;;
+esac
+
+:
--- cluster-manager-18.02.0.rc13.24.g7f3cda9.orig/debian/postinst
+++ cluster-manager-18.02.0.rc13.24.g7f3cda9/debian/postinst
@@ -0,0 +1,57 @@
+#!/bin/sh
+# postinst script for cluster-manager
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# install startup script
+update-rc.d cluster_manager defaults >/dev/null
+
+# create group
+if ! getent group onedata >/dev/null; then
+        addgroup --system onedata
+fi
+
+# create user
+if ! getent passwd cluster_manager >/dev/null; then
+        adduser --ingroup onedata \
+                --home /var/lib/cluster_manager \
+                --disabled-password \
+                --system --shell /bin/bash --no-create-home \
+                --gecos "oneprovider cm user" cluster_manager
+fi
+
+for i in lib run log; do
+    chown -R cluster_manager:onedata /var/$i/cluster_manager
+done
+
+chown -R cluster_manager:onedata /usr/lib/cluster_manager
+chown -R cluster_manager:onedata /etc/cluster_manager
+
+chmod 0755 /var/run/cluster_manager /etc/cluster_manager
+chmod 0644 /etc/cluster_manager/*
+chmod -R +X /etc/cluster_manager
+chmod 0755 /usr/lib/cluster_manager/lib/env.sh
+chmod 0755 /usr/lib/cluster_manager/erts-*/bin/nodetool
+
+case "$1" in
+    configure)
+        
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
--- cluster-manager-18.02.0.rc13.24.g7f3cda9.orig/debian/postrm
+++ cluster-manager-18.02.0.rc13.24.g7f3cda9/debian/postrm
@@ -0,0 +1,65 @@
+#!/bin/sh
+# postrm script for cluster-manager
+#
+# see: dh_installdeb(1)
+
+
+# summary of how this script can be called:
+#        * <postrm> `remove'
+#        * <postrm> `purge'
+#        * <old-postrm> `upgrade' <new-version>
+#        * <new-postrm> `failed-upgrade' <old-version>
+#        * <new-postrm> `abort-install'
+#        * <new-postrm> `abort-install' <old-version>
+#        * <new-postrm> `abort-upgrade' <old-version>
+#        * <disappearer's-postrm> `disappear' <overwriter>
+#          <overwriter-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+set -e
+
+case "$1" in
+    purge)
+        rm -f /etc/default/cluster_manager
+
+        # ensure we remove the rc.d scripts installed by postinst
+        update-rc.d cluster_manager remove >/dev/null
+
+        if [ -d /var/log/cluster_manager ]; then
+                rm -r /var/log/cluster_manager
+        fi
+        if [ -d /var/run/cluster_manager ]; then
+                rm -r /var/run/cluster_manager
+        fi
+        if [ -d /etc/cluster_manager ]; then
+                rm -r /etc/cluster_manager
+        fi
+        if [ -e /etc/init.d/cluster_manager ]; then
+                rm  /etc/init.d/cluster_manager
+        fi
+        # Remove User & Group, killing any process owned by them
+        if getent passwd cluster_manager >/dev/null; then
+                pkill -u cluster_manager || true
+                deluser --quiet --system cluster_manager
+        fi
+        if getent group onedata >/dev/null; then
+                delgroup --quiet --system --only-if-empty onedata || true
+        fi
+    ;;
+
+    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+    ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1\`" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
--- cluster-manager-18.02.0.rc13.24.g7f3cda9.orig/debian/rules
+++ cluster-manager-18.02.0.rc13.24.g7f3cda9/debian/rules
@@ -0,0 +1,86 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# modified for node_package by dizzyd@basho.com and jared@basho.com
+
+# Uncomment this to turn on verbose mode.
+export DH_VERBOSE=1
+
+## Clear variables that may confound our build of sub-projects; also
+## note that it is necessary to use overlay_vars relative to .. as
+## the generate command EXECUTES in rel/
+build:
+	
+	unset CC CFLAGS CPPFLAGS LDFLAGS CXX CXXFLAGS \
+		&& OVERLAY_VARS="--overlay_vars=debian/vars.config" \
+		make REBAR_PROFILE=package rel
+	touch build
+
+clean:
+	dh_clean
+	rm -f build
+	make clean
+
+## dh_shlibdeps was added to figure out the dependencies on shared libraries
+##   and will populate the ${shlibs:Depends} callout in the control file
+install: build
+	dh_testdir
+	dh_testroot
+	dh_prep
+	dh_installdirs
+
+	cp -R _build/package/rel/cluster_manager/lib \
+              debian/cluster-manager/usr/lib/cluster_manager
+
+	cp -R _build/package/rel/cluster_manager/erts* \
+              debian/cluster-manager/usr/lib/cluster_manager
+
+	cp -R _build/package/rel/cluster_manager/releases \
+              debian/cluster-manager/usr/lib/cluster_manager
+
+## executables
+	if [ -d _build/package/rel/cluster_manager/bin ]; then \
+	    mkdir -p debian/cluster-manager/usr/bin && \
+	    install -p -D -m 0755 _build/package/rel/cluster_manager/bin/cluster_manager debian/cluster-manager/usr/bin/ && \
+	    echo -n; fi
+
+## install man pages if they exist
+	if [ -d doc/man/man1 ]; then \
+	    mkdir -p debian/usr/share/man/man1 && \
+	    if [ -f doc/man/man1/cluster_manager.1.gz ]; then \
+                                     install -p -D -m 0544 doc/man/man1/cluster_manager.1.gz \
+                                             debian/cluster-manager/usr/share/man/man1/ \
+                                 ; fi && \
+	    echo -n; fi
+
+	mkdir -p debian/cluster-manager/etc/cluster_manager
+	cp -R _build/package/rel/cluster_manager/etc/* \
+              debian/cluster-manager/etc/cluster_manager
+
+	mkdir -p debian/cluster-manager/var/lib
+	cp -R _build/package/rel/cluster_manager/data/* \
+              debian/cluster-manager/var/lib/cluster_manager
+
+	install -m755 debian/init.script \
+              debian/cluster-manager/etc/init.d/cluster_manager
+
+	dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info #todo check why onepanel build fails without this option
+
+# We have nothing to do by default.
+binary-indep: install build-stamp
+build-stamp:
+
+# Build architecture-dependent files here.
+binary-arch: install
+	dh_strip -a
+	dh_compress -a
+	dh_installdeb
+	dh_gencontrol
+	dh_builddeb
+
+binary: binary-indep binary-arch
--- cluster-manager-18.02.0.rc13.24.g7f3cda9.orig/debian/vars.config
+++ cluster-manager-18.02.0.rc13.24.g7f3cda9/debian/vars.config
@@ -0,0 +1,24 @@
+%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
+%% ex: ft=erlang ts=4 sw=4 et
+
+%% Platform-specific installation paths
+{platform_bin_dir,         "/usr/bin"}.
+{platform_data_dir,        "/var/lib/cluster_manager"}.
+{platform_etc_dir,         "/etc/cluster_manager"}.
+{platform_base_dir,        "/usr/lib/cluster_manager"}.
+{platform_lib_dir,         "/usr/lib/cluster_manager/lib"}.
+{platform_log_dir,         "/var/log/cluster_manager"}.
+
+{runner_script_dir,        "/usr/bin"}.
+{runner_base_dir,          "/usr/lib/cluster_manager"}.
+{runner_etc_dir,           "/etc/cluster_manager"}.
+{runner_log_dir,           "/var/log/cluster_manager"}.
+{runner_user,              "cluster_manager"}.
+{runner_wait_process,      "cluster_manager_sup"}.
+{runner_lib_dir,           "/usr/lib/cluster_manager/lib"}.
+{runner_data_dir,          "/var/lib/cluster_manager"}.
+{runner_patch_dir,         "/usr/lib/cluster_manager/lib/onedata-patches"}.
+{pipe_dir,                 "/tmp/cluster_manager/"}.
+{package_replacement_line, ""}.
+{package_conflicts_line,   ""}.
+{app_version, "18.02.0.rc13.24.g7f3cda9"}.
--- cluster-manager-18.02.0.rc13.24.g7f3cda9.orig/node_package/priv/templates/deb/vars.config
+++ cluster-manager-18.02.0.rc13.24.g7f3cda9/node_package/priv/templates/deb/vars.config
@@ -21,3 +21,4 @@
 {pipe_dir,                 "/tmp/{{package_install_name}}/"}.
 {package_replacement_line, "{{package_replacement_line_debian}}"}.
 {package_conflicts_line,   "{{package_replacement_line_debian}}"}.
+{app_version, "18.02.0.rc13.24.g7f3cda9"}.
