kornelski / cargo-deb

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

Unclear how to handle man page generation #151

Open julianandrews opened 2 weeks ago

julianandrews commented 2 weeks ago

I use help2man to generate the man page for my project, and that needs to run post-build but before deb generation. Right now I generate the man page manually and add it to the repo. That works, but isn't ideal.

Since cargo build doesn't support post-build scripts, I was hoping there would be some way to tell cargo deb to run some post-build logic, but I'm not seeing a clean way to make that happen.

Is there a recommended way to generate the man page (or generally do post-build pre-cargo-deb logic)?

ximon18 commented 2 weeks ago

Use --no-build and handle this youreelf?

kornelski commented 2 weeks ago

Cargo doesn't support generation of man pages:

https://github.com/rust-lang/cargo/issues/545

and cargo-deb just wraps cargo build, so you need to create a workaround for this yourself.

julianandrews commented 2 weeks ago

I thought that might be the case, but wanted to check. Thanks!

I should be able to cobble something together using --no-build and some manual logic. For my purposes I can just write a shell script to generate the .deb. It won't be cross-platform, but then neither is help2man so that's no loss for me.

It would be really helpful if there were some documentation somewhere suggesting workarounds. Though, I recognize that as things stand there isn't an obvious best approach to recommend which makes that kind of tricky.