kornelski / cargo-deb

A cargo subcommand that generates Debian packages from information in Cargo.toml
https://lib.rs/cargo-deb
MIT License
404 stars 48 forks source link

`License` is not set in the `control` file #119

Closed jszwedko closed 7 months ago

jszwedko commented 7 months ago

Hi all!

I noticed that the License field is not set in the generated control file. This can be reproduced within this repository:

$ cargo run
$ dpkg-deb --info /home/ubuntu/workspace/cargo-deb/target/debian/cargo-deb_2.0.2-1_amd64.deb
 new Debian package, version 2.0.
 size 1345084 bytes: control archive=592 bytes.
     505 bytes,    15 lines      control
     185 bytes,     3 lines      md5sums
 Package: cargo-deb
 Version: 2.0.2-1
 Architecture: amd64
 Vcs-Browser: https://github.com/kornelski/cargo-deb
 Vcs-Git: https://github.com/kornelski/cargo-deb
 Homepage: https://lib.rs/crates/cargo-deb
 Section: utility
 Priority: optional
 Maintainer: Kornel Lesiński <kornel@geekhood.net>
 Installed-Size: 4303
 Depends: libc6 (>= 2.34)
 Description: Make Debian packages (.deb) easily with a Cargo subcommand
  A simple subcommand for the Cargo package manager for building Debian packages
  from Rust projects.

Notice the missing License field there. And then:

$ ar xv /home/ubuntu/workspace/cargo-deb/target/debian/cargo-deb_2.0.2-1_amd64.deb
x - debian-binary
x - control.tar.xz
x - data.tar.xz
$ tar xvf control.tar.xz
control
md5sums
$ cat control
Package: cargo-deb
Version: 2.0.2-1
Architecture: amd64
Vcs-Browser: https://github.com/kornelski/cargo-deb
Vcs-Git: https://github.com/kornelski/cargo-deb
Homepage: https://lib.rs/crates/cargo-deb
Section: utility
Priority: optional
Maintainer: Kornel Lesiński <kornel@geekhood.net>
Installed-Size: 4303
Depends: libc6 (>= 2.34)
Description: Make Debian packages (.deb) easily with a Cargo subcommand
 A simple subcommand for the Cargo package manager for building Debian packages
 from Rust projects.

We can see it isn't in the control file. This results in the License being listed as Unknown in our APT repository when uploading the package.

kornelski commented 7 months ago

I don't think such field exists?

License is usually specified in debian/copyright file.

jszwedko commented 7 months ago

Thanks @kornelski , you are right, it looks to be an issue with some external tooling that we have that is looking for the field in the control file. We'll update that to look in debian/copyright in addition. Some tools, like https://github.com/jordansissel/fpm, seem to add it to the control file.