Skip to content

Commit

Permalink
Add build scripts for debian pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulh committed Jul 14, 2023
1 parent 03b6f0a commit 6c09435
Show file tree
Hide file tree
Showing 29 changed files with 11,844 additions and 4 deletions.
46 changes: 46 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
GOCMD=go
GOTEST=$(GOCMD) test
GOVET=$(GOCMD) vet
BINARY_NAME=calaos-container
VERSION?=1.0.0

GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
WHITE := $(shell tput -Txterm setaf 7)
CYAN := $(shell tput -Txterm setaf 6)
RESET := $(shell tput -Txterm sgr0)

.PHONY: all test build

all: build

## Help:
help: ## Show this help.
@echo ''
@echo 'Usage:'
@echo ' ${YELLOW}make${RESET} ${GREEN}<target>${RESET}'
@echo ''
@echo 'Targets:'
@awk 'BEGIN {FS = ":.*?## "} { \
if (/^[a-zA-Z_-]+:.*?##.*$$/) {printf " ${YELLOW}%-20s${GREEN}%s${RESET}\n", $$1, $$2} \
else if (/^## .*$$/) {printf " ${CYAN}%s${RESET}\n", substr($$1,4)} \
}' $(MAKEFILE_LIST)

## Build:
build: ## Build the project and put the output binary in bin/
@mkdir -p bin
$(GOCMD) build -v -o bin/$(BINARY_NAME) .

clean: ## Remove build related file
rm -fr ./bin
rm -fr ./out
rm -f ./junit-report.xml checkstyle-report.xml ./coverage.xml ./profile.cov yamllint-checkstyle.xml

## Test:
test: ## Run the tests of the project
# $(GOTEST) -v -race ./... $(OUTPUT_OPTIONS)
@echo test disabled

coverage: ## Run the tests of the project and export the coverage
$(GOTEST) -cover -covermode=count -coverprofile=profile.cov ./...
$(GOCMD) tool cover -func profile.cov
Binary file added bin/calaos-container
Binary file not shown.
1 change: 1 addition & 0 deletions debian/.debhelper/calaos-container/dbgsym-build-ids
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9a106f7c45341688341edd85237782c9196f7ac6
12 changes: 12 additions & 0 deletions debian/.debhelper/calaos-container/dbgsym-root/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Package: calaos-container-dbgsym
Source: calaos-container (1.0-0)
Version: 1.0.0-0~bookworm0
Auto-Built-Package: debug-symbols
Architecture: amd64
Maintainer: Calaos Team <[email protected]>
Installed-Size: 9230
Depends: calaos-container (= 1.0.0-0~bookworm0)
Section: debug
Priority: optional
Description: debug symbols for calaos-container
Build-Ids: 9a106f7c45341688341edd85237782c9196f7ac6
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1545a016a6a17703c2cedc821c603125 usr/lib/debug/.build-id/9a/106f7c45341688341edd85237782c9196f7ac6.debug
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
calaos-container (1.0-0) UNRELEASED; urgency=medium

* Initial release

-- Calaos Team <[email protected]> Tue, 01 Jul 2023 00:00:00 +0200
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
./bin/calaos-container
./scripts/x11docker
Empty file.
30 changes: 30 additions & 0 deletions debian/.debhelper/generated/calaos-container/postinst.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Automatically added by dh_installsystemd/13.11.4
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
# The following line should be removed in trixie or trixie+1
deb-systemd-helper unmask 'calaos-container.service' >/dev/null || true

# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled 'calaos-container.service'; then
# Enables the unit on first installation, creates new
# symlinks on upgrades if the unit file has changed.
deb-systemd-helper enable 'calaos-container.service' >/dev/null || true
else
# Update the statefile to add new symlinks (if any), which need to be
# cleaned up on purge. Also remove old symlinks.
deb-systemd-helper update-state 'calaos-container.service' >/dev/null || true
fi
fi
# End automatically added section
# Automatically added by dh_installsystemd/13.11.4
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
if [ -d /run/systemd/system ]; then
systemctl --system daemon-reload >/dev/null || true
if [ -n "$2" ]; then
_dh_action=restart
else
_dh_action=start
fi
deb-systemd-invoke $_dh_action 'calaos-container.service' >/dev/null || true
fi
fi
# End automatically added section
5 changes: 5 additions & 0 deletions debian/.debhelper/generated/calaos-container/prerm.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Automatically added by dh_installsystemd/13.11.4
if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
deb-systemd-invoke stop 'calaos-container.service' >/dev/null || true
fi
# End automatically added section
1 change: 1 addition & 0 deletions debian/calaos-container.debhelper.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dh_gencontrol
2 changes: 1 addition & 1 deletion debian/calaos-container.install
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
calaos-container usr/bin
bin/calaos-container usr/bin
scripts/x11docker usr/bin
12 changes: 12 additions & 0 deletions debian/calaos-container.postrm.debhelper
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Automatically added by dh_installsystemd/13.11.4
if [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
systemctl --system daemon-reload >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_installsystemd/13.11.4
if [ "$1" = "purge" ]; then
if [ -x "/usr/bin/deb-systemd-helper" ]; then
deb-systemd-helper purge 'calaos-container.service' >/dev/null || true
fi
fi
# End automatically added section
3 changes: 3 additions & 0 deletions debian/calaos-container.substvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
shlibs:Depends=libc6 (>= 2.34), libdevmapper1.02.1 (>= 2:1.02.97), libgpgme11 (>= 1.4.1)
misc:Depends=
misc:Pre-Depends=
8 changes: 8 additions & 0 deletions debian/calaos-container/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Package: calaos-container
Source: calaos-container (1.0-0)
Version: 1.0.0-0~bookworm0
Architecture: amd64
Maintainer: Calaos Team <[email protected]>
Installed-Size: 22710
Depends: libc6 (>= 2.34), libdevmapper1.02.1 (>= 2:1.02.97), libgpgme11 (>= 1.4.1), bash, podman
Description: Calaos-OS container service
4 changes: 4 additions & 0 deletions debian/calaos-container/DEBIAN/md5sums
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
7e62a4c4310565a1beb44eca7daddde3 lib/systemd/system/calaos-container.service
bfba85cce7f575423fff9a163110e02c usr/bin/calaos-container
76eb3a0df90ff27a69fb3a5a90846c8b usr/bin/x11docker
ee8994ea36678b03ee182c1a83915a97 usr/share/doc/calaos-container/changelog.Debian.gz
32 changes: 32 additions & 0 deletions debian/calaos-container/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh
set -e
# Automatically added by dh_installsystemd/13.11.4
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
# The following line should be removed in trixie or trixie+1
deb-systemd-helper unmask 'calaos-container.service' >/dev/null || true

# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled 'calaos-container.service'; then
# Enables the unit on first installation, creates new
# symlinks on upgrades if the unit file has changed.
deb-systemd-helper enable 'calaos-container.service' >/dev/null || true
else
# Update the statefile to add new symlinks (if any), which need to be
# cleaned up on purge. Also remove old symlinks.
deb-systemd-helper update-state 'calaos-container.service' >/dev/null || true
fi
fi
# End automatically added section
# Automatically added by dh_installsystemd/13.11.4
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
if [ -d /run/systemd/system ]; then
systemctl --system daemon-reload >/dev/null || true
if [ -n "$2" ]; then
_dh_action=restart
else
_dh_action=start
fi
deb-systemd-invoke $_dh_action 'calaos-container.service' >/dev/null || true
fi
fi
# End automatically added section
14 changes: 14 additions & 0 deletions debian/calaos-container/DEBIAN/postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
set -e
# Automatically added by dh_installsystemd/13.11.4
if [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
systemctl --system daemon-reload >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_installsystemd/13.11.4
if [ "$1" = "purge" ]; then
if [ -x "/usr/bin/deb-systemd-helper" ]; then
deb-systemd-helper purge 'calaos-container.service' >/dev/null || true
fi
fi
# End automatically added section
7 changes: 7 additions & 0 deletions debian/calaos-container/DEBIAN/prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
set -e
# Automatically added by dh_installsystemd/13.11.4
if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
deb-systemd-invoke stop 'calaos-container.service' >/dev/null || true
fi
# End automatically added section
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Calaos-OS container daemon
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/calaos-container
Restart=always

[Install]
WantedBy=multi-user.target
Binary file added debian/calaos-container/usr/bin/calaos-container
Binary file not shown.
Loading

0 comments on commit 6c09435

Please sign in to comment.