[Pkg-rust-maintainers] Override file format for debcargo

Vasudev Kamath vasudev at copyninja.info
Thu Jul 6 16:54:07 UTC 2017


Vasudev Kamath <vasudev at copyninja.info> writes:

> # This section basically to update Source package related fields.
> [source]
> # This is only needed when bumping S-V. Currently
> # debcargo has 4.0.0 hard coded in it.
> policy = "4.0.0"
>
> # In case of missing home page in Cargo.toml this field can be used.
> homepage = "https://clap.rs"

2 more additions for this section of toml files are *section* to
override Section field in debian/control

Crates might need external dependencies like development headers or
other tools which debcargo can not figure out by itself we need another
key *build_depends which will be of TOML array type.

If you think any further overrides are needed, let me know.

>
> # These are fields needed to update Package section of control files.
> # One each inline table for every binary package produced by debcargo.
> [package."librust-clap-2-dev"]
> # short description, needed to provide meaningful short description.
> summary = "Simple, efficient and full featured Command line argument parser - source"
>
> # This field provides long description. Please note that one need to
> # wrap lines at 80 characters. Other formatting as per policy is taken
> # care in code.
> description = """
> clap is used to parse and validate string of command line arguments provided by
> user at runtime. It provides help and version flags by default and additionally
> provide help subcommands in addition to traditional flags.
> This package provides clap with following default features.
>  * suggestions: provides did you mean suggestions on typos
>  * color: turns on colored error messages.
>  * wrap_help: Wrap the help at actual terminal width when available.
> """

One additional field I can think of here is *depends* to add additional
dependencies. I first thought this might be needed for binary crates
like debcargo itself but then ${shlibs:Depends} should handle adding
external library dependencies. So I'm not quite sure if this field will
be useful or can be dropped. In any case I've coded it into debcargo.

>
> # This section is for overriding copyright values. We use inline tables
> # for this. File name should come after . between quotes (TOML specs)
> # User should note that he should provide both copyright notice and the
> # license 
> [files."*"]
> # This is array and each copyright should be put in this array.
> copyright = ["2015-2016, Kevin B. Knapp <kbknapp at gmail.com"]
> # License. for the section.
> license = "MIT"
>
> [files."debian/*"]
> copyright = ["2017, Vasudev Kamath <vasudev at copyninja.info"]
> license = "MIT"
>

I could not think of any other fields needed for this section. Possibly
we might need some fields for DEP-5 headers like Source in case homepage
value is missing in Cargo.toml. But this value can be simply used from
*source* section.

I've put some initial code needed for parsing override toml file and
accessing required values on branch *feature/overrides*. Kept in new
branch since feature/dep5-copyright is already working code and this
code is still WIP.

I would be happy to get some reviews and suggestions.

Best Regards,
Vasudev




More information about the Pkg-rust-maintainers mailing list