Skip to content

Commit

Permalink
[#11] Add Debian packaging
Browse files Browse the repository at this point in the history
 - uses "make all" to download and build database
 - packages it to debian package to be placed in /var/lib/neofs/ir

Using:
```make debpackage```

Signed-off-by: Dmitriy Zabolotskiy <d.zabolotskiy@yadro.com>
  • Loading branch information
DmitryZabolotsky authored and realloc committed Oct 28, 2022
1 parent 8327094 commit bbb5840
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
tmp/
in/
locode_db
locode_db
# debhelpers
**/.debhelper
21 changes: 20 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@
VERSION ?= "$(shell git describe --tags --match "v*" --dirty --always --abbrev=8 2>/dev/null || cat VERSION 2>/dev/null || echo "develop")"
NEOFSCLI ?= neofs-cli

.PHONY: all clean version help unlocode
.PHONY: all clean version help unlocode debpackage

DIRS = in tmp

space := $(subst ,, )

# .deb package versioning
OS_RELEASE = $(shell lsb_release -cs)
PKG_VERSION ?= $(shell echo $(VERSION) | sed "s/^v//" | \
sed -E "s/(.*)-(g[a-fA-F0-9]{6,8})(.*)/\1\3~\2/" | \
sed "s/-/~/")-${OS_RELEASE}

all: $(DIRS) locode_db

$(DIRS):
Expand Down Expand Up @@ -56,3 +62,16 @@ clean:
rm -f in/*
rm -f tmp/*
rm -f locode_db

# Package for Debian
debpackage:
dch --package neofs-locode-db \
--controlmaint \
--newversion $(PKG_VERSION) \
--force-bad-version \
--distribution $(OS_RELEASE) \
"Please see CHANGELOG.md for code changes for $(VERSION)"
dpkg-buildpackage --no-sign -b

debclean:
dh clean
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
neofs-locode-db (0.2.1) stable; urgency=medium

* Initial change.

-- NeoSPCC <tech@nspcc.ru> Wed, 19 Oct 2022 12:33:04 +0300

17 changes: 17 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Source: neofs-locode-db
Section: misc
Priority: optional
Maintainer: NeoSPCC <tech@nspcc.ru>
Build-Depends: debhelper-compat (= 13), git, devscripts, wget, neofs-cli
Standards-Version: 4.5.1
Homepage: https://fs.neo.org/
Vcs-Git: https://github.com/nspcc-dev/neofs-locode-db.git
Vcs-Browser: https://github.com/nspcc-dev/neofs-locode-db

Package: neofs-locode-db
Architecture: any
Depends: ${misc:Depends}
Description: Compiled UN/LOCODE database for NeoFS
NeoFS uses UN/LOCODE in storage node attributes and storage policies.
Inner ring nodes converts UN/LOCODE into human-readable set of attributes
such as continent, country name, etc.
11 changes: 11 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: neofs-locode-db
Upstream-Contact: tech@nspcc.ru
Source: https://github.com/nspcc-dev/neofs-locode-db

Files: *
Copyright: 2018-2022 NeoSPCC (@nspcc-dev)

License: CC-BY-SA-4.0
This project is licensed under the CC Attribution-ShareAlike 4.0 International
https://creativecommons.org/licenses/by-sa/4.0/legalcode
1 change: 1 addition & 0 deletions debian/neofs-locode-db.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
locode_db var/lib/neofs/ir
17 changes: 17 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/make -f

export DEB_BUILD_OPTIONS := nostrip nocheck

%:
dh $@

override_dh_auto_build:
$(MAKE) all

override_dh_installchangelogs:
dh_installchangelogs -k CHANGELOG.md

override_dh_clean:
dh_clean
rm -f locode_db

1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)

0 comments on commit bbb5840

Please sign in to comment.