mmstick / cargo-deb

A cargo subcommand that generates Debian packages from information in Cargo.toml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Guidance on how to build multiple versions of same .deb

julianandrews opened this issue · comments

I've got a project where I need to install assets to one of two locations, depending on the distribution version (assets go to /usr/lib for Buster/Hirsute, and to /usr/libexec/ for Bullseye/Impish).

Is there a good way to build both packages from the same config? I tried using variants, but I want the package name to stay the same.

@julianandrews I think you can create a "base" build and using variants build for different environments. Example:

[package.metadata.deb]
# common .deb name (e.g. my-project_x.y.z_amd64.deb)
name = "my-project"

[package.metadata.deb.variants.buster]
assets = [
       ["assets/*", "usr/lib/", "664"]

[package.metadata.deb.variants.bullseye]
assets = [
       ["assets/*", "usr/libexec/", "664"]

hth

@apiraino - that seems to work. Thanks!