diff --git a/.github/workflows/deb-buildd.yml b/.github/workflows/deb-buildd.yml index 73667f0b..63e052f6 100644 --- a/.github/workflows/deb-buildd.yml +++ b/.github/workflows/deb-buildd.yml @@ -247,14 +247,6 @@ jobs: if [ "${{ inputs.dist-name }}" = "debian" ]; then MIRROR="http://deb.debian.org/debian" - elif [ "${{ inputs.dist-name }}" = "ubuntu" ] && [ "${{ inputs.build-arch }}" = "amd64" ]; - then - MIRROR="http://archive.ubuntu.com/ubuntu" - elif [ "${{ inputs.dist-name }}" = "ubuntu" ] && [ "${{ inputs.build-arch }}" != "amd64" ]; - then - MIRROR="http://ports.ubuntu.com/ubuntu-ports" - else - exit 1 fi if [ "${{ inputs.dist-name }}" = "debian" ]; then @@ -287,16 +279,27 @@ jobs: fi if [ "${{ inputs.dist-name }}" = "ubuntu" ]; then + MIRROR="http://archive.ubuntu.com/ubuntu" tee -a ~/.sbuildrc > /dev/null < /dev/null <= 0.15), libzstd-dev, @@ -22,7 +26,7 @@ Build-Depends: debhelper-compat (= 13), pkgconf, python3-docutils, python3:native, - rustc (>= 1.77), + rustc:native (>= 1.77), systemd-dev, uuid-dev, zlib1g-dev, @@ -41,6 +45,8 @@ Breaks: bcachefs-kernel-dkms (<< ${binary:Version}), bcachefs-kernel-dkms (>> ${binary:Version}), Replaces: bcachefs-kernel-dkms (<< ${binary:Version}), bcachefs-kernel-dkms (>> ${binary:Version}), +Built-Using: ${cargo:Built-Using} +Static-Built-Using: ${cargo:Static-Built-Using} Description: bcachefs userspace tools Userspace tools for bcachefs, a modern copy on write, checksumming, multi device filesystem. diff --git a/debian/rules b/debian/rules index 7f16cabb..a070d264 100755 --- a/debian/rules +++ b/debian/rules @@ -1,35 +1,37 @@ #!/usr/bin/make -f -include /usr/share/dpkg/architecture.mk +export DH_VERBOSE = 1 + +export DPKG_EXPORT_BUILDFLAGS = 1 +export DPKG_EXPORT_BUILDTOOLS = 1 + +export DEB_BUILD_OPTIONS += nolto +export DEB_BUILD_MAINT_OPTIONS += optimize=-lto + +export DEB_BUILD_MAINT_OPTIONS += hardening=+all + +include /usr/share/dpkg/default.mk include /usr/share/rustc/architecture.mk -export DH_VERBOSE=1 +export DEB_HOST_RUST_TYPE +export DEB_HOST_GNU_TYPE -export DEB_HOST_RUST_TYPE DEB_HOST_GNU_TYPE +export PATH := /usr/share/cargo/bin:$(PATH) +export CARGO = /usr/share/cargo/bin/cargo +export CARGO_HOME = $(CURDIR)/debian/cargo_home +export DEB_CARGO_CRATE = bcachefs-tools_$(DEB_VERSION_UPSTREAM) -export DEB_BUILD_MAINT_OPTIONS=hardening=+all -export CARGO=/usr/share/cargo/bin/cargo -export CARGO_HOME=$(CURDIR)/debian/cargo_home -export DEB_CARGO_CRATE=bcachefs-tools_$(DEB_VERSION_UPSTREAM) - -NUMJOBS = 1 -ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) - NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) - MAKEFLAGS += -j$(NUMJOBS) -endif +export PKG_CONFIG = ${DEB_HOST_MULTIARCH}-pkg-config +export PKG_CONFIG_PATH = /usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig:/usr/share/pkgconfig +export PKG_CONFIG_LIBDIR = /usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig PREFIX := /usr ROOT_SBINDIR := /usr/sbin export PREFIX ROOT_SBINDIR -DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) - -ifeq ($(DEB_BUILD_ARCH),amd64) - DEB_BUILD_MAINT_OPTIONS += optimize=-lto -endif - -export CARGO_ARGS = "--frozen" +export CARGO_ARGS = --frozen +export CARGO_BUILD_TARGET = ${DEB_HOST_RUST_TYPE} # WARNING: split debug info makes the package unreproducible! # @@ -49,25 +51,23 @@ export CARGO_ARGS = "--frozen" %: dh $@ --parallel --with dkms +override_dh_auto_clean: + $(CARGO) prepare-debian vendor + dh_auto_clean + +override_dh_auto_configure: + $(CARGO) prepare-debian vendor + dh_auto_configure + override_dh_clean: # HACK: breaks cargo checksumming by deleting some vendored files. -cargo_config: - rm -rf .cargo - mkdir -p .cargo - cp debian/cargo.config .cargo/config.toml - -override_dh_auto_build: - $(MAKE) -f debian/rules cargo_config - dh_auto_build - -override_dh_auto_clean: - $(MAKE) -f debian/rules cargo_config - dh_auto_clean - rm -rf .cargo - override_dh_usrlocal: # FIXME: fails with # dh_usrlocal: error: debian/bcachefs-tools/usr/local/libexec/bcachefsck_all is not a directory override_dh_auto_test: + +# Generate (Static-)Built-Using +execute_after_dh_auto_install: + /usr/share/cargo/bin/dh-cargo-built-using bcachefs-tools