secubox-deb/packages/secubox-daemon/debian/rules
CyberMind-FR a110f7c55a fix(daemon): rename secubox-c3box → secubox-daemon-c3box (closes #378)
packages/secubox-daemon/ declared a secondary binary package named
secubox-c3box, but packages/secubox-c3box/ is also a distinct source
package (the Python FastAPI dashboard) that produces a .deb with the
same name. dpkg only allows one binary named secubox-c3box on a host
at a time, so whichever package the build matrix produced last would
silently displace the other on install.

The two packages do completely different things: the Go variant ships
/usr/bin/c3box (Situational Awareness for the WireGuard mesh) and
depends on secubox-daemon; the Python variant ships
/usr/lib/secubox/c3box/ (FastAPI Services Portal) and depends on
secubox-core. File paths don't overlap, but the binary-package-name
collision does.

Rename the Go variant to secubox-daemon-c3box, matching Debian's
source-binary disambiguation convention (cf. linux → linux-image-*).
The Python secubox-c3box keeps the canonical name.

Add Conflicts: secubox-c3box (<< 1.1~) so an old install is removed
cleanly when the new package lands. Operators that currently have
both produce-paths in their build matrix should install only one
package per host.

Files touched:
  - packages/secubox-daemon/debian/control       (Package: stanza
    rename + Conflicts: + description update)
  - packages/secubox-daemon/debian/rules         (debian/secubox-c3box/
    install paths → debian/secubox-daemon-c3box/)
  - debian/secubox-c3box.{postinst,prerm}        (git mv to
    secubox-daemon-c3box.{postinst,prerm})

Surfaced by the Phase 1 consolidation audit (commit a85129f5).
2026-05-27 07:23:57 +02:00

43 lines
1.8 KiB
Makefile
Executable File

#!/usr/bin/make -f
export DH_VERBOSE=1
export GOFLAGS=-mod=readonly
%:
dh $@
override_dh_auto_build:
# Binaries are pre-built in ../../daemon/build/
# To rebuild from source: cd ../../daemon && make build
@echo "Using pre-built binaries from daemon/build/"
override_dh_auto_install:
# secubox-daemon package
install -d debian/secubox-daemon/usr/bin
install -m 755 ../../daemon/build/secuboxd debian/secubox-daemon/usr/bin/
install -m 755 ../../daemon/build/secuboxctl debian/secubox-daemon/usr/bin/
install -d debian/secubox-daemon/lib/systemd/system
install -m 644 ../../daemon/systemd/secuboxd.service debian/secubox-daemon/lib/systemd/system/
install -d debian/secubox-daemon/etc/secubox
install -m 640 ../../daemon/testdata/secuboxd.yaml debian/secubox-daemon/etc/secubox/secuboxd.yaml.example
install -m 644 ../../daemon/testdata/hamgraph.json debian/secubox-daemon/etc/secubox/
# secubox-daemon-c3box package (Go variant, distinct from the Python secubox-c3box)
install -d debian/secubox-daemon-c3box/usr/bin
install -m 755 ../../daemon/build/c3box debian/secubox-daemon-c3box/usr/bin/
install -d debian/secubox-daemon-c3box/lib/systemd/system
install -m 644 ../../daemon/systemd/c3box.service debian/secubox-daemon-c3box/lib/systemd/system/
install -d debian/secubox-daemon-c3box/usr/share/c3box/www
cp -r ../../daemon/c3box/frontend/* debian/secubox-daemon-c3box/usr/share/c3box/www/ 2>/dev/null || true
override_dh_auto_clean:
# Don't clean pre-built binaries in ../../daemon/build/
@echo "Keeping pre-built binaries"
override_dh_strip:
# Skip stripping - Go binaries are cross-compiled and already stripped with -ldflags "-s -w"
@echo "Skipping dh_strip for pre-built Go binaries"
override_dh_dwz:
# Skip dwz - no debug info in stripped Go binaries
@echo "Skipping dh_dwz for pre-built Go binaries"