-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to handle different dependency names on differing distros? #124
Comments
See https://github.com/cat-in-136/cargo-generate-rpm#overwrite-configuration As same as the original rpm, it is frequently possible to avoid explicitly specifying a dependent package names with automatic dependency resolution or so library names. If not, use the configuration overwrite. |
Ok, the documentation is vague on details, and everything I've tried doesn't actually work. My Cargo.toml looks like this: [package]
name = "sshd-config"
description = "Himmelblau Required SSHD Configuration"
version.workspace = true
authors.workspace = true
rust-version.workspace = true
edition.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
[lib]
path = "src/lib.rs"
[package.metadata.deb]
name = "himmelblau-sshd-config"
depends = ["openssh-server"]
assets = [
["../../platform/debian/sshd_config", "etc/ssh/sshd_config.d/himmelblau.conf", "644"],
]
[package.metadata.generate-rpm]
name = "himmelblau-sshd-config"
assets = [
{ source = "../../platform/el/sshd_config", dest = "/etc/ssh/sshd_config.d/himmelblau.conf", mode = "644" },
]
[package.metadata.generate-rpm.requires]
sshd = "*" I've created a separate toml file for modifying the requires: [package.metadata.generate-rpm.requires]
openssh-server = "*" Then my build commands: The results: # rpm -qpR packaging/himmelblau-sshd-config-0.8.0-1.x86_64-tumbleweed.rpm
/bin/sh
sshd
rpmlib(CompressedFileNames) = 3.0.4-1
rpmlib(FileDigests) = 4.6.0-1
rpmlib(PayloadFilesHavePrefix) = 4.0-1
rpmlib(PayloadIsZstd) = 5.4.18-1
# rpm -qpR packaging/himmelblau-sshd-config-0.8.0-1.x86_64-rocky9.rpm
/bin/sh
sshd
rpmlib(CompressedFileNames) = 3.0.4-1
rpmlib(FileDigests) = 4.6.0-1
rpmlib(PayloadFilesHavePrefix) = 4.0-1
rpmlib(PayloadIsZstd) = 5.4.18-1 Clearly the Nothing I have tried works as you describe. |
As written README, it simply overwrites See as following: $ cat Cargo.toml /tmp/foobar (master)
[package]
name = "foobar"
description = "foobar"
license = "MIT"
version = "0.1.0"
edition = "2021"
[dependencies]
[package.metadata.generate-rpm]
name = "foobarbaz"
assets = [
{ source = "target/release/foobar", dest = "/usr/bin/foobar", mode = "755" },
]
[package.metadata.generate-rpm.requires]
sshd = "*"
#[package.metadata.generate-rpm.variants.suse.requires]
#openssh-server = "*"
$ cat openSUSEDepends.toml
[package.metadata.generate-rpm.requires]
openssh-server = "*"
$ cargo generate-rpm ; rpm -qpR target/generate-rpm/foobarbaz-0.1.0-1.x86_64.rpm | grep ssh
sshd
$ cargo generate-rpm --metadata-overwrite=openSUSEDepends.toml#package.metadata.generate-rpm ; rpm -qpR target/generate-rpm/foobarbaz-0.1.0-1.x86_64.rpm | grep ssh
openssh-server metadata-overwrite is muddled because it comprehensively supports a variety of requirements. For simple patching, comment out the Cargo.toml of above example and |
I'm trying to build RPMs for SUSE and Rocky, but the dependency names for some packages aren't the same. How am I supposed to handle this?
The text was updated successfully, but these errors were encountered: