kornelski / cargo-deb

Make Debian packages directly from Rust/Cargo projects
https://lib.rs/cargo-deb
MIT License
431 stars 52 forks source link

cargo deb does not handle links files #92

Open mikael-hermansson-icomera opened 1 year ago

mikael-hermansson-icomera commented 1 year ago

I have an application which using a symlinks to select what mode it should run: . Meaning the debian package need to install a symlinks.

Normally dh_helper has a file named package.links which is readed by the helper and creates a symlink in the deb package the symlink is then unpacked when package is installed on the target.

This does not seem to work with cargo help first try was:

[package.metadata.deb] maintainer-scripts = "debian/"

But this does not care about the links file. Probably cause this is not correct since it is not a script.

A second try:

conf-files = ["links"]

Still could not get it to work.

The work around is currently to add a debian/postinst and add a ln -fs to the script. But this feels wrong. It would be nice if cargo deb also handled the dh_links feature.

Alternative a toml setting:

[package.metadata.deb] links=[..] # similar to assets...

Or maybe this is already supported and I am missing something?

dcampbell24 commented 2 weeks ago

Did you try setting

[package.metadata.deb]
preserve-symlinks = true

I like the idea of having a symlinks = [["target", "link-name"]], so you don't have to have already created the symlink.