jdeb
                                
                                 jdeb copied to clipboard
                                
                                    jdeb copied to clipboard
                            
                            
                            
                        Support for multiple packages in control file
I have a control file with four separate packages. Each package is separated by an empty line (as per specification). The parser of the Maven plugin fails with an exception.
Caused by: java.text.ParseException: Empty line
       at org.vafer.jdeb.debian.ControlFile.parse(ControlFile.java:63)
        at org.vafer.jdeb.debian.ControlFile.parse(ControlFile.java:43)
        at org.vafer.jdeb.debian.BinaryPackageControlFile.<init>(BinaryPackageControlFile.java:60)
        at org.vafer.jdeb.ControlBuilder.createPackageControlFile(ControlBuilder.java:177)
        at org.vafer.jdeb.DebMaker.createSignedDeb(DebMaker.java:440)
The control file works fine with the Debian packaging tools. So I think, this is a problem of the jdeb parser.
The control file as used by jdeb is more like the control file of a binary package, it doesn't support multiple paragraphs as used in the control file of a source package.
If the bahviour is on purpose, then there should be a better error message. And it should be documented.
It's documented here with an example. How would you improve the documentation to make this clearer?
The documentation should state clearly, that jdeb only supports a subset of the control file specification. Especially that is doesn't support multiple packages. I can't find that in the current documentation.
@Eymux the spec allows multiple binary packages from one control file? Can you point me to that part of the spec?
http://people.canonical.com/~cjwatson/ubuntu-policy/policy.html/ch-controlfields.html
A control file consists of one or more paragraphs of fields[33]. The paragraphs are separated by blank
lines. Some control files allow only one paragraph; others allow several, in which case each paragraph
usually refers to a different package. (For example, in source packages, the first paragraph refers to
the source package, and later paragraphs refer to binary packages generated from the source.) 
"Some control files allow only one paragraph; others allow several" sounds we are not really outside of the spec but we should provide better docs and a better error message. Given that jdeb isn't really about source packages I think that's fair.
May I ask why you wanted to create multiple packages with one jdeb control file, @Eymux ?
We're creating several packages from the same sources for different scenarios, that can be installed individually. I already have a control file, that is used with Ant. After switching to Maven, I wanted to get rid of Ant as much as possible. And jdeb is the only Maven plugin for creating Debian packages, I'm aware of. It would have been nice, if jdeb supported source packages. May I ask, what jdeb is about?
Well, the use case of jdeb has always been binary packages.
I am not really aware of multiple binary packages from one control file.
You are creating source packages or binary packages?
While it would need quite some work I am not opposed to adding support for multi package support. It certainly could be a feature request for 2.0.
For your migration to Maven, you can consider using the maven-antrun-plugin to build several .deb from the same module.
@tcurdt: As far as I understand it, we're creating a source package and multiple binary packages. The control file is here: https://raw.githubusercontent.com/WollMux/WollMux/master/lhmdeb/control
@ebourg: I'm aware of that. But then I would have to change my control file to work with Maven. That's not trivial.
Well, I only see a few options here:
- you change your setup
- you provide a patch
- you provide funds to implement this
I am a little concerned on how a retrofit into the 1.x branch could look like. Maven itself isn't particularly great at multiple assets per build in itself IIRC.
This certainly could be added in 2.x but since I currently don't have a customer sponsoring the development that's mostly just plans and vaporware at this stage.
We're already working on a different solution.
I wish I could give you the money to work on this. Maven could use a comprehensive plugin for making Debian packages.
Well, so far most people have been quite happy with jdeb as is :) I guess it's just that the multi package requirement isn't that common.
It wasn't meant as critisism. jdeb just isn't what I need right now.
@Eymux no worries - all good :)