|
| 1 | +[[packages]] |
| 2 | +name = "netavark" |
| 3 | +commit_id = "debian/1.14.0-2" |
| 4 | +scm_url = "https://salsa.debian.org/debian/netavark" |
| 5 | + |
| 6 | +# The Debian packaging for netavark targets trixie/sid: it builds via dh-cargo |
| 7 | +# against a wall of librust-*-dev packages that don't exist in the bookworm |
| 8 | +# archive VyOS builds against, and bookworm's rustc (1.63) is below netavark's |
| 9 | +# rust-version = "1.76" floor. Rewrite debian/control and debian/rules to build |
| 10 | +# directly against crates.io with a rustup-installed toolchain instead, and |
| 11 | +# drop the quilt patches that only exist to pin Cargo.toml/Cargo.lock to |
| 12 | +# whatever librust-*-dev versions happen to be in the trixie/sid archive - our |
| 13 | +# network build uses upstream's own (pristine) Cargo.lock instead. |
| 14 | +# |
| 15 | +# debian/patches/series and debian/control/rules are edited in place here |
| 16 | +# rather than via a patch file: mk-build-deps (which runs before build_cmd) |
| 17 | +# reads debian/control straight off disk, before dpkg-buildpackage's automatic |
| 18 | +# quilt-patch application would ever get a chance to apply a patch to it. |
| 19 | +pre_build_hook = """ |
| 20 | +sed -i \ |
| 21 | + -e '/^0009-Revert-fix-deps-update-rust-crate-rand-to-0.9.0.patch$/d' \ |
| 22 | + -e '/^0010-Revert-fix-deps-update-rust-crate-sysctl-to-0.6.0.patch$/d' \ |
| 23 | + -e '/^0012-relax-tokio-stream-dependency.patch$/d' \ |
| 24 | + -e '/^0013-Relax-nispor-dependency.patch$/d' \ |
| 25 | + -e '/^0013-Build-against-url-2.5.2.patch$/d' \ |
| 26 | + -e '/^0013-compile-against-prost-12.6.patch$/d' \ |
| 27 | + -e '/^0015-update-zbus.patch$/d' \ |
| 28 | + debian/patches/series |
| 29 | +
|
| 30 | +cat > debian/control <<'EOF' |
| 31 | +Source: netavark |
| 32 | +Section: net |
| 33 | +Priority: optional |
| 34 | +Maintainer: Reinhard Tartler <siretart@tauware.de> |
| 35 | +Build-Depends: debhelper-compat (= 13), |
| 36 | + pkg-config, |
| 37 | + protobuf-compiler |
| 38 | +Standards-Version: 4.7.2 |
| 39 | +Homepage: https://github.com/containers/netavark |
| 40 | +Vcs-Browser: https://salsa.debian.org/debian/netavark |
| 41 | +Vcs-Git: https://salsa.debian.org/debian/netavark.git |
| 42 | +Rules-Requires-Root: no |
| 43 | +
|
| 44 | +Package: netavark |
| 45 | +Architecture: any |
| 46 | +Depends: ${misc:Depends}, ${shlibs:Depends} |
| 47 | +Provides: container-network-stack (= 2) |
| 48 | +Recommends: aardvark-dns, nftables |
| 49 | +Breaks: aardvark-dns (<< 1.12) |
| 50 | +Enhances: podman |
| 51 | +Description: Rust based network stack for containers |
| 52 | + Netavark is designed to work with but is also applicable |
| 53 | + for other OCI container management applications. |
| 54 | +EOF |
| 55 | +
|
| 56 | +cat > debian/rules <<'EOF' |
| 57 | +#!/usr/bin/make -f |
| 58 | +
|
| 59 | +# cf. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1091318 |
| 60 | +export NETAVARK_DEFAULT_FW := nftables |
| 61 | +
|
| 62 | +# VyOS builds on Debian bookworm, whose librust-*-dev / dh-cargo stack is far |
| 63 | +# behind what this package needs, so we build directly against crates.io via |
| 64 | +# the upstream Cargo.lock instead of Debian's offline vendored-crate scheme. |
| 65 | +%: |
| 66 | + dh $@ |
| 67 | +
|
| 68 | +override_dh_auto_build: |
| 69 | + cargo build --release --bin netavark --bin netavark-dhcp-proxy-client |
| 70 | +
|
| 71 | +override_dh_auto_test: |
| 72 | +
|
| 73 | +override_dh_auto_install: |
| 74 | + install -D -m 0755 target/release/netavark \ |
| 75 | + debian/netavark/usr/lib/podman/netavark |
| 76 | + install -D -m 0755 target/release/netavark-dhcp-proxy-client \ |
| 77 | + debian/netavark/usr/lib/podman/netavark-dhcp-proxy-client |
| 78 | + install -D -m 664 contrib/systemd/system/netavark-dhcp-proxy.socket \ |
| 79 | + debian/netavark/usr/lib/systemd/system/netavark-dhcp-proxy.socket |
| 80 | + sed -e 's;@@NETAVARK@@;/usr/lib/podman/netavark;g' \ |
| 81 | + < contrib/systemd/system/netavark-dhcp-proxy.service.in \ |
| 82 | + > debian/netavark/usr/lib/systemd/system/netavark-dhcp-proxy.service |
| 83 | + sed -e 's;@@NETAVARK@@;/usr/lib/podman/netavark;g' \ |
| 84 | + < contrib/systemd/system/netavark-firewalld-reload.service.in \ |
| 85 | + > debian/netavark/usr/lib/systemd/system/netavark-firewalld-reload.service |
| 86 | +
|
| 87 | +override_dh_auto_clean: |
| 88 | + rm -rf target |
| 89 | +EOF |
| 90 | +chmod 0755 debian/rules |
| 91 | +
|
| 92 | +# bookworm's rustc (1.63) predates netavark's rust-version = "1.76"; install a |
| 93 | +# current stable toolchain and shadow any apt-installed one via /usr/local/bin, |
| 94 | +# which every later shell invocation in this build picks up ahead of /usr/bin. |
| 95 | +if [ ! -x "$HOME/.cargo/bin/rustup" ]; then |
| 96 | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable |
| 97 | +else |
| 98 | + "$HOME/.cargo/bin/rustup" update stable |
| 99 | +fi |
| 100 | +sudo ln -sf "$HOME/.cargo/bin/cargo" /usr/local/bin/cargo |
| 101 | +sudo ln -sf "$HOME/.cargo/bin/rustc" /usr/local/bin/rustc |
| 102 | +sudo ln -sf "$HOME/.cargo/bin/rustup" /usr/local/bin/rustup |
| 103 | +""" |
| 104 | + |
| 105 | +[[packages]] |
| 106 | +name = "aardvark-dns" |
| 107 | +commit_id = "debian/1.14.0-3" |
| 108 | +scm_url = "https://salsa.debian.org/debian/aardvark-dns" |
| 109 | + |
| 110 | +# aardvark-dns and netavark are versioned in lockstep upstream (this |
| 111 | +# aardvark-dns Depends: netavark (>> 1.14)) and share the same trixie-only |
| 112 | +# dh-cargo/librust-*-dev packaging problem on bookworm - see the netavark |
| 113 | +# entry above for the full rationale. Same fix: build directly against |
| 114 | +# crates.io with a rustup-installed toolchain. |
| 115 | +pre_build_hook = """ |
| 116 | +sed -i -e '/^relax-deps.patch$/d' debian/patches/series |
| 117 | +
|
| 118 | +cat > debian/control <<'EOF' |
| 119 | +Source: aardvark-dns |
| 120 | +Section: net |
| 121 | +Priority: optional |
| 122 | +Maintainer: Reinhard Tartler <siretart@tauware.de> |
| 123 | +Build-Depends: debhelper-compat (= 13) |
| 124 | +Standards-Version: 4.7.2 |
| 125 | +Homepage: https://github.com/containers/aardvark-dns |
| 126 | +Vcs-Browser: https://salsa.debian.org/debian/aardvark-dns |
| 127 | +Vcs-Git: https://salsa.debian.org/debian/aardvark-dns.git |
| 128 | +Rules-Requires-Root: no |
| 129 | +
|
| 130 | +Package: aardvark-dns |
| 131 | +Architecture: any |
| 132 | +Depends: netavark (>> 1.14), ${misc:Depends}, ${shlibs:Depends} |
| 133 | +Enhances: podman |
| 134 | +Description: Container-focused DNS server |
| 135 | + Netavark is designed to work with podman but is also applicable for other OCI |
| 136 | + container management applications. |
| 137 | +EOF |
| 138 | +
|
| 139 | +cat > debian/rules <<'EOF' |
| 140 | +#!/usr/bin/make -f |
| 141 | +
|
| 142 | +# VyOS builds on Debian bookworm, whose librust-*-dev / dh-cargo stack is far |
| 143 | +# behind what this package needs, so we build directly against crates.io via |
| 144 | +# the upstream Cargo.lock instead of Debian's offline vendored-crate scheme. |
| 145 | +%: |
| 146 | + dh $@ |
| 147 | +
|
| 148 | +override_dh_auto_build: |
| 149 | + cargo build --release --bin aardvark-dns |
| 150 | +
|
| 151 | +override_dh_auto_test: |
| 152 | +
|
| 153 | +override_dh_auto_install: |
| 154 | + install -D -m 0755 target/release/aardvark-dns \ |
| 155 | + debian/aardvark-dns/usr/lib/podman/aardvark-dns |
| 156 | +
|
| 157 | +override_dh_auto_clean: |
| 158 | + rm -rf target |
| 159 | +EOF |
| 160 | +chmod 0755 debian/rules |
| 161 | +
|
| 162 | +if [ ! -x "$HOME/.cargo/bin/rustup" ]; then |
| 163 | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable |
| 164 | +else |
| 165 | + "$HOME/.cargo/bin/rustup" update stable |
| 166 | +fi |
| 167 | +sudo ln -sf "$HOME/.cargo/bin/cargo" /usr/local/bin/cargo |
| 168 | +sudo ln -sf "$HOME/.cargo/bin/rustc" /usr/local/bin/rustc |
| 169 | +sudo ln -sf "$HOME/.cargo/bin/rustup" /usr/local/bin/rustup |
| 170 | +""" |
| 171 | + |
1 | 172 | [[packages]] |
2 | 173 | name = "podman" |
3 | 174 | commit_id = "v5.8.4" |
|
0 commit comments