fix: Simplify debian/rules to resolve build errors

- Remove unsupported DEB_HOST_ARCH_GNU_TYPE variable
- Remove invalid --dbg-package=apt-ostree-dbg reference
- Simplify cross-compilation logic to avoid complex conditionals
- Fix binary install path to use standard release target
- Resolves dpkg-architecture and dh_strip errors in CI build

Fixes Debian package build failures in CI workflow.
This commit is contained in:
joe 2025-08-15 15:08:55 -07:00
parent 089fbdddf9
commit b4fa6fe1c2

12
debian/rules vendored
View file

@ -14,14 +14,11 @@ export CARGO_TARGET_DIR = $(CURDIR)/debian/cargo/target
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
# Rust target for cross-compilation # Rust target for cross-compilation (simplified)
RUST_TARGET := $(shell dpkg-architecture -qDEB_HOST_ARCH_GNU_TYPE) RUST_TARGET := $(DEB_HOST_ARCH)
# Build flags # Build flags
CARGO_FLAGS := --release CARGO_FLAGS := --release
ifneq ($(DEB_HOST_ARCH),$(DEB_BUILD_ARCH))
CARGO_FLAGS += --target $(RUST_TARGET)
endif
override_dh_auto_build: override_dh_auto_build:
@echo "Building apt-ostree for $(DEB_HOST_ARCH)..." @echo "Building apt-ostree for $(DEB_HOST_ARCH)..."
@ -34,7 +31,7 @@ override_dh_auto_build:
override_dh_auto_install: override_dh_auto_install:
@echo "Installing apt-ostree binary..." @echo "Installing apt-ostree binary..."
# Install the apt-ostree binary to the correct location # Install the apt-ostree binary to the correct location
install -D -m 755 debian/cargo/target/$(if $(filter $(DEB_HOST_ARCH),$(DEB_BUILD_ARCH)),release,$(RUST_TARGET)/release)/apt-ostree \ install -D -m 755 debian/cargo/target/release/apt-ostree \
debian/apt-ostree/usr/bin/apt-ostree debian/apt-ostree/usr/bin/apt-ostree
# Create additional directories # Create additional directories
mkdir -p debian/apt-ostree/usr/share/doc/apt-ostree mkdir -p debian/apt-ostree/usr/share/doc/apt-ostree
@ -65,8 +62,7 @@ override_dh_auto_clean:
override_dh_strip: override_dh_strip:
# Strip debug symbols from binary # Strip debug symbols from binary
dh_strip --dbg-package=apt-ostree-dbg dh_strip
# Keep debug package for development
override_dh_shlibdeps: override_dh_shlibdeps:
# Handle shared library dependencies # Handle shared library dependencies