forked from TrueCloudLab/frostfs-node
[#409] Debian packaging
Debian package building, including: - users creation if not exist; - dirs creation and ownership/ACLs set; - man/doc/examples installation; - shell completion generation; - locode DB binary download Using: make debpackage Signed-off-by: Dmitriy Zabolotskiy <d.zabolotskiy@yadro.com>
This commit is contained in:
parent
846ff515e6
commit
92e9782c44
31 changed files with 568 additions and 1 deletions
2
debian/.gitignore
vendored
Normal file
2
debian/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
changelog
|
||||
*debhelper*
|
2
debian/clean
vendored
Normal file
2
debian/clean
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
man/
|
||||
debian/*.bash-completion
|
37
debian/control
vendored
Normal file
37
debian/control
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
Source: neofs-node
|
||||
Section: misc
|
||||
Priority: optional
|
||||
Maintainer: NeoSPCC <tech@nspcc.ru>
|
||||
Build-Depends: debhelper-compat (= 13), dh-sequence-bash-completion, devscripts
|
||||
Standards-Version: 4.5.1
|
||||
Homepage: https://fs.neo.org/
|
||||
Vcs-Git: https://github.com/nspcc-dev/neofs-node.git
|
||||
Vcs-Browser: https://github.com/nspcc-dev/neofs-node
|
||||
|
||||
Package: neofs-node-storage
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: Storage service for neofs-node
|
||||
NeoFS is a decentralized distributed object storage integrated with the NEO Blockchain.
|
||||
NeoFS Nodes are organized in a peer-to-peer network that takes care of storing and distributing user's data.
|
||||
Any Neo user may participate in the network and get paid for providing storage resources to other users or
|
||||
store their data in NeoFS and pay a competitive price for it.
|
||||
|
||||
Package: neofs-node-ir
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: InnerRing service for neofs-node
|
||||
NeoFS is a decentralized distributed object storage integrated with the NEO Blockchain.
|
||||
NeoFS Nodes are organized in a peer-to-peer network that takes care of storing and distributing user's data.
|
||||
Any Neo user may participate in the network and get paid for providing storage resources to other users or
|
||||
store their data in NeoFS and pay a competitive price for it.
|
||||
|
||||
Package: neofs-node-cli
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: cli tools for neofs-node
|
||||
NeoFS is a decentralized distributed object storage integrated with the NEO Blockchain.
|
||||
NeoFS Nodes are organized in a peer-to-peer network that takes care of storing and distributing user's data.
|
||||
Any Neo user may participate in the network and get paid for providing storage resources to other users or
|
||||
store their data in NeoFS and pay a competitive price for it.
|
||||
|
21
debian/copyright
vendored
Normal file
21
debian/copyright
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: neofs-node
|
||||
Upstream-Contact: tech@nspcc.ru
|
||||
Source: https://github.com/nspcc-dev/neofs-node
|
||||
|
||||
Files: *
|
||||
Copyright: 2018-2022 NeoSPCC (@nspcc-dev), contributors of neofs-node project
|
||||
(https://github.com/nspcc-dev/neofs-node/blob/master/CREDITS.md)
|
||||
|
||||
License: GPL-3
|
||||
This program is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published
|
||||
by the Free Software Foundation; version 3.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
4
debian/neofs-node-cli.docs
vendored
Normal file
4
debian/neofs-node-cli.docs
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
CONTRIBUTING.md
|
||||
CREDITS.md
|
||||
README.md
|
||||
cmd/neofs-adm/docs
|
3
debian/neofs-node-cli.install
vendored
Normal file
3
debian/neofs-node-cli.install
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
bin/neofs-adm usr/bin
|
||||
bin/neofs-cli usr/bin
|
||||
bin/neofs-lens usr/bin
|
1
debian/neofs-node-cli.manpages
vendored
Normal file
1
debian/neofs-node-cli.manpages
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
man/*
|
2
debian/neofs-node-ir.dirs
vendored
Normal file
2
debian/neofs-node-ir.dirs
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/etc/neofs/ir
|
||||
/var/lib/neofs/ir
|
3
debian/neofs-node-ir.docs
vendored
Normal file
3
debian/neofs-node-ir.docs
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
CONTRIBUTING.md
|
||||
CREDITS.md
|
||||
README.md
|
1
debian/neofs-node-ir.install
vendored
Normal file
1
debian/neofs-node-ir.install
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
bin/neofs-ir usr/bin
|
16
debian/neofs-node-ir.neofs-ir.service
vendored
Normal file
16
debian/neofs-node-ir.neofs-ir.service
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
[Unit]
|
||||
Description=NeoFS InnerRing node
|
||||
Requires=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/neofs-ir --config /etc/neofs/ir/config.yml
|
||||
User=neofs-ir
|
||||
Group=neofs-ir
|
||||
WorkingDirectory=/var/lib/neofs/ir
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
PrivateTmp=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
48
debian/neofs-node-ir.postinst
vendored
Normal file
48
debian/neofs-node-ir.postinst
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
set -e
|
||||
|
||||
# summary of how this script can be called:
|
||||
# * <postinst> `configure' <most-recently-configured-version>
|
||||
# * <old-postinst> `abort-upgrade' <new version>
|
||||
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
|
||||
# <new-version>
|
||||
# * <postinst> `abort-remove'
|
||||
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
|
||||
# <failed-install-package> <version> `removing'
|
||||
# <conflicting-package> <version>
|
||||
# for details, see https://www.debian.org/doc/debian-policy/ or
|
||||
# the debian-policy package
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
USERNAME=ir
|
||||
id -u neofs-ir >/dev/null 2>&1 || useradd -s /usr/sbin/nologin -d /var/lib/neofs/ir --system -M -U -c "NeoFS InnerRing node" neofs-ir
|
||||
if ! dpkg-statoverride --list /etc/neofs/$USERNAME >/dev/null; then
|
||||
chown -f -R root:neofs-$USERNAME /etc/neofs/$USERNAME
|
||||
chmod -f 0750 /etc/neofs/$USERNAME
|
||||
chmod -f u=rwX,g=rX,o= /etc/neofs/$USERNAME/* || true
|
||||
fi
|
||||
USERDIR=$(getent passwd "neofs-$USERNAME" | cut -d: -f6)
|
||||
if ! dpkg-statoverride --list neofs-$USERDIR >/dev/null; then
|
||||
chown -f -R neofs-$USERNAME: $USERDIR
|
||||
fi
|
||||
;;
|
||||
|
||||
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
|
40
debian/neofs-node-ir.postrm
vendored
Normal file
40
debian/neofs-node-ir.postrm
vendored
Normal file
|
@ -0,0 +1,40 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
set -e
|
||||
|
||||
# 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 https://www.debian.org/doc/debian-policy/ or
|
||||
# the debian-policy package
|
||||
|
||||
|
||||
case "$1" in
|
||||
purge)
|
||||
rm -rf /var/lib/neofs/ir/*
|
||||
;;
|
||||
|
||||
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
|
34
debian/neofs-node-ir.preinst
vendored
Normal file
34
debian/neofs-node-ir.preinst
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
set -e
|
||||
|
||||
# summary of how this script can be called:
|
||||
# * <new-preinst> `install'
|
||||
# * <new-preinst> `install' <old-version>
|
||||
# * <new-preinst> `upgrade' <old-version>
|
||||
# * <old-preinst> `abort-upgrade' <new-version>
|
||||
# for details, see https://www.debian.org/doc/debian-policy/ or
|
||||
# the debian-policy package
|
||||
|
||||
|
||||
case "$1" in
|
||||
install|upgrade)
|
||||
;;
|
||||
|
||||
abort-upgrade)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "preinst 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
|
37
debian/neofs-node-ir.prerm
vendored
Normal file
37
debian/neofs-node-ir.prerm
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
set -e
|
||||
|
||||
# summary of how this script can be called:
|
||||
# * <prerm> `remove'
|
||||
# * <old-prerm> `upgrade' <new-version>
|
||||
# * <new-prerm> `failed-upgrade' <old-version>
|
||||
# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
|
||||
# * <deconfigured's-prerm> `deconfigure' `in-favour'
|
||||
# <package-being-installed> <version> `removing'
|
||||
# <conflicting-package> <version>
|
||||
# for details, see https://www.debian.org/doc/debian-policy/ or
|
||||
# the debian-policy package
|
||||
|
||||
|
||||
case "$1" in
|
||||
remove|upgrade|deconfigure)
|
||||
;;
|
||||
|
||||
failed-upgrade)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "prerm 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
|
2
debian/neofs-node-storage.dirs
vendored
Normal file
2
debian/neofs-node-storage.dirs
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/etc/neofs/storage
|
||||
/srv/neofs
|
4
debian/neofs-node-storage.docs
vendored
Normal file
4
debian/neofs-node-storage.docs
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
docs/storage-node-configuration.md
|
||||
CONTRIBUTING.md
|
||||
CREDITS.md
|
||||
README.md
|
1
debian/neofs-node-storage.install
vendored
Normal file
1
debian/neofs-node-storage.install
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
bin/neofs-node usr/bin
|
16
debian/neofs-node-storage.neofs-storage.service
vendored
Normal file
16
debian/neofs-node-storage.neofs-storage.service
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
[Unit]
|
||||
Description=NeoFS Storage node
|
||||
Requires=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/neofs-node --config /etc/neofs/storage/config.yml
|
||||
User=neofs-storage
|
||||
Group=neofs-storage
|
||||
WorkingDirectory=/srv/neofs
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
PrivateTmp=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
48
debian/neofs-node-storage.postinst
vendored
Normal file
48
debian/neofs-node-storage.postinst
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
set -e
|
||||
|
||||
# summary of how this script can be called:
|
||||
# * <postinst> `configure' <most-recently-configured-version>
|
||||
# * <old-postinst> `abort-upgrade' <new version>
|
||||
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
|
||||
# <new-version>
|
||||
# * <postinst> `abort-remove'
|
||||
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
|
||||
# <failed-install-package> <version> `removing'
|
||||
# <conflicting-package> <version>
|
||||
# for details, see https://www.debian.org/doc/debian-policy/ or
|
||||
# the debian-policy package
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
USERNAME=storage
|
||||
id -u neofs-storage >/dev/null 2>&1 || useradd -s /usr/sbin/nologin -d /srv/neofs --system -M -U -c "NeoFS Storage node" neofs-storage
|
||||
if ! dpkg-statoverride --list /etc/neofs/$USERNAME >/dev/null; then
|
||||
chown -f -R root:neofs-$USERNAME /etc/neofs/$USERNAME
|
||||
chmod -f 0750 /etc/neofs/$USERNAME
|
||||
chmod -f u=rwX,g=rX,o= /etc/neofs/$USERNAME/* || true
|
||||
fi
|
||||
USERDIR=$(getent passwd "neofs-$USERNAME" | cut -d: -f6)
|
||||
if ! dpkg-statoverride --list neofs-$USERDIR >/dev/null; then
|
||||
chown -f -R neofs-$USERNAME: $USERDIR
|
||||
fi
|
||||
;;
|
||||
|
||||
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
|
40
debian/neofs-node-storage.postrm
vendored
Normal file
40
debian/neofs-node-storage.postrm
vendored
Normal file
|
@ -0,0 +1,40 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
set -e
|
||||
|
||||
# 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 https://www.debian.org/doc/debian-policy/ or
|
||||
# the debian-policy package
|
||||
|
||||
|
||||
case "$1" in
|
||||
purge)
|
||||
rm -rf /srv/neofs/*
|
||||
;;
|
||||
|
||||
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
|
34
debian/neofs-node-storage.preinst
vendored
Normal file
34
debian/neofs-node-storage.preinst
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
set -e
|
||||
|
||||
# summary of how this script can be called:
|
||||
# * <new-preinst> `install'
|
||||
# * <new-preinst> `install' <old-version>
|
||||
# * <new-preinst> `upgrade' <old-version>
|
||||
# * <old-preinst> `abort-upgrade' <new-version>
|
||||
# for details, see https://www.debian.org/doc/debian-policy/ or
|
||||
# the debian-policy package
|
||||
|
||||
|
||||
case "$1" in
|
||||
install|upgrade)
|
||||
;;
|
||||
|
||||
abort-upgrade)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "preinst 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
|
37
debian/neofs-node-storage.prerm
vendored
Normal file
37
debian/neofs-node-storage.prerm
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
set -e
|
||||
|
||||
# summary of how this script can be called:
|
||||
# * <prerm> `remove'
|
||||
# * <old-prerm> `upgrade' <new-version>
|
||||
# * <new-prerm> `failed-upgrade' <old-version>
|
||||
# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
|
||||
# * <deconfigured's-prerm> `deconfigure' `in-favour'
|
||||
# <package-being-installed> <version> `removing'
|
||||
# <conflicting-package> <version>
|
||||
# for details, see https://www.debian.org/doc/debian-policy/ or
|
||||
# the debian-policy package
|
||||
|
||||
|
||||
case "$1" in
|
||||
remove|upgrade|deconfigure)
|
||||
;;
|
||||
|
||||
failed-upgrade)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "prerm 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
|
41
debian/rules
vendored
Executable file
41
debian/rules
vendored
Executable file
|
@ -0,0 +1,41 @@
|
|||
#!/usr/bin/make -f
|
||||
|
||||
# Do not try to strip Go binaries
|
||||
export DEB_BUILD_OPTIONS := nostrip
|
||||
|
||||
%:
|
||||
dh $@ --with bash-completion
|
||||
|
||||
override_dh_auto_test:
|
||||
|
||||
override_dh_auto_install:
|
||||
echo $(DEB_BUILD_OPTIONS)
|
||||
dh_auto_install
|
||||
|
||||
bin/neofs-adm gendoc -t man man/
|
||||
bin/neofs-cli gendoc -t man man/
|
||||
|
||||
bin/neofs-adm completion bash > debian/neofs-adm.bash-completion
|
||||
bin/neofs-cli completion bash > debian/neofs-cli.bash-completion
|
||||
install -m 0755 -d debian/neofs-node-cli/usr/share/fish/completions
|
||||
install -m 0755 -d debian/neofs-node-cli/usr/share/zsh/vendor-completions/
|
||||
bin/neofs-adm completion fish > debian/neofs-node-cli/usr/share/fish/completions/neofs-adm.fish
|
||||
bin/neofs-adm completion zsh > debian/neofs-node-cli/usr/share/zsh/vendor-completions/_neofs-adm
|
||||
bin/neofs-cli completion fish > debian/neofs-node-cli/usr/share/fish/completions/neofs-cli.fish
|
||||
bin/neofs-cli completion zsh > debian/neofs-node-cli/usr/share/zsh/vendor-completions/_neofs-cli
|
||||
|
||||
install -T config/example/ir.yaml debian/neofs-node-ir/etc/neofs/ir/config.yml
|
||||
install -T config/example/ir-control.yaml debian/neofs-node-ir/etc/neofs/ir/control.yml
|
||||
install -T config/example/node.yaml debian/neofs-node-storage/etc/neofs/storage/config.yml
|
||||
install -T config/example/node-control.yaml debian/neofs-node-storage/etc/neofs/storage/control.yml
|
||||
|
||||
override_dh_installsystemd:
|
||||
dh_installsystemd --no-enable --no-start --name=neofs-ir
|
||||
dh_installsystemd --no-enable --no-start --name=neofs-storage
|
||||
|
||||
override_dh_installchangelogs:
|
||||
dh_installchangelogs -k CHANGELOG.md
|
||||
|
||||
override_dh_installdocs:
|
||||
dh_installdocs
|
||||
|
1
debian/source/format
vendored
Normal file
1
debian/source/format
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
3.0 (quilt)
|
Loading…
Add table
Add a link
Reference in a new issue