mirror of
https://dev.lirent.ru/Vatrog/vm-automation-signaling.git
synced 2026-06-25 20:36:36 +03:00
9bde398b6c
- core: runtime attach/detach of a per-endpoint adapter trio (runtime-safe add_adapter + vmsig_core_detach_endpoint, deferred reap) - roster: VMSIG_EV_ROSTER + CAP_ROSTER, retained per-endpoint and replayed to late subscribers - discovery: inotify trigger dir, vmid/endpoint slot allocator, host probe; vmsigd daemon with config + per-uid admission - input driver and vgpu perception built in-tree; vgpu perception as a separate library - memctx: own the supplied ro_fd (closed at detach) - deb packaging: install rules, systemd unit, tmpfiles, default config
47 lines
1.9 KiB
Makefile
47 lines
1.9 KiB
Makefile
# vmsig packaging — `make deb` builds the .deb over a `cmake --install` stage.
|
|
# Private values are NOT baked into the tree: pass them via the variables below (the
|
|
# defaults are neutral placeholders; CI overrides them from vars/secrets).
|
|
#
|
|
# make deb LIBVMIE_PATH=/path/to/vmie VERSION=1.2.3 \
|
|
# MAINTAINER="Name <addr>" DEPENDS="libc6, libvmie0"
|
|
|
|
VERSION ?= 0.0.0
|
|
MAINTAINER ?= vmsig packaging <root@localhost>
|
|
# libvmie0 is vmie's own runtime package (SONAME libvmie.so.0): libvmsig.so and
|
|
# libvgpu-perception.so dynamically link it, so it is a HARD runtime dependency.
|
|
DEPENDS ?= libc6, libvmie0
|
|
ARCH ?= amd64
|
|
LIBVMIE_PATH ?=
|
|
|
|
BUILD_DIR ?= .build-pkg
|
|
STAGE ?= $(CURDIR)/dist/stage
|
|
DIST ?= $(CURDIR)/dist
|
|
|
|
.PHONY: deb clean
|
|
|
|
# Armed package: the shipped daemon needs vmie for memctx. vmie stays an external dependency
|
|
# (the package Depends on its runtime; pass DEPENDS to add it).
|
|
deb:
|
|
@test -n "$(LIBVMIE_PATH)" || { echo "set LIBVMIE_PATH=/path/to/vmie sources (armed memctx)"; exit 1; }
|
|
rm -rf $(STAGE)
|
|
cmake -S . -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=Release -DVMSIG_INSTALL=ON \
|
|
-DVMSIG_WITH_VMIE=ON -DLIBVMIE_PATH=$(LIBVMIE_PATH)
|
|
cmake --build $(BUILD_DIR) -j
|
|
DESTDIR=$(STAGE) cmake --install $(BUILD_DIR) --prefix /usr
|
|
mkdir -p $(STAGE)/DEBIAN
|
|
sed -e 's/@VERSION@/$(VERSION)/' \
|
|
-e 's|@MAINTAINER@|$(MAINTAINER)|' \
|
|
-e 's/@DEPENDS@/$(DEPENDS)/' \
|
|
packaging/deb/control.in > $(STAGE)/DEBIAN/control
|
|
cp packaging/deb/conffiles $(STAGE)/DEBIAN/conffiles
|
|
install -m 0755 packaging/deb/postinst $(STAGE)/DEBIAN/postinst
|
|
install -m 0755 packaging/deb/prerm $(STAGE)/DEBIAN/prerm
|
|
# strip inherited setgid from staged dirs (a setgid build tree => dpkg-deb rejects DEBIAN)
|
|
find $(STAGE) -type d -exec chmod g-s {} +
|
|
mkdir -p $(DIST)
|
|
dpkg-deb --root-owner-group --build $(STAGE) $(DIST)/vmsig_$(VERSION)_$(ARCH).deb
|
|
@echo "built: $(DIST)/vmsig_$(VERSION)_$(ARCH).deb"
|
|
|
|
clean:
|
|
rm -rf $(BUILD_DIR) $(DIST)
|